Problems with cron
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:
I've made a symlink from /system/bin to /bin
And I've made a crontab file with the following line in it:
* * * * * /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:
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
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:
service crond /system/xbin/crond -c /data/cron
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.