Quantcast
Channel: xda-developers - Android Software and Hacking General [Developers Only]
Viewing all articles
Browse latest Browse all 3614

Problems with cron

$
0
0
Hi, I have made cron work on my 7" china tablet, it runs almost like I'd like it to..

I've made a passwd file in /etc with the following contents:

Code:

root:x:0:0::/data/cron:/system/bin/bash
I've made a symlink from /system/bin to /bin

And I've made a crontab file with the following line in it:

Code:

* * * * * /system/xbin/cat /sys/class/power_supply/battery/capacity > /dev/ttyACM0
Now the problem.. Cron runs fine, running the small bash code every minute, but..

ttyACM0 is a serial line to a microController - but the problem is that nothing is received on the controller, despite the cron running the script.

now if I LS /dev/tty* I get the following:

Code:

root@android:/ # ls /dev/ttyA* -l
ls /dev/ttyA* -l
crw------- root    root    166,  0 2013-09-07 13:11 ttyACM0
-rw-rw-rw- root    root            3 2013-09-07 13:14 ttyACM0
root@android:/ #

The cron creates an identical file in /dev and write it's data to this file, and not the *real* ttyACM0 serial..

I start the crond service in init.rc like this:

Code:

service crond /system/xbin/crond -c /data/cron       
        user root
        disabled
        oneshot

on property:dev.bootcomplete=1
        .
        .
        start crond


If I change the cronscript to output to a flat file somewhere else (like /data/test_output), I can see the file with LS, but I'm not able to delete it nor cat it.

What's going on?

I need this to work in order to trigger a charger once the battery goes too low, and turn it off again once it has reached a given threshold. Not being able to send a simple command via serial really offsides this project.

Please help :)

Viewing all articles
Browse latest Browse all 3614

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>