I am using a JeeNode with an extended RFM12Demo-sketch as an I/O-board an OpenWRT-system (a special kind of Linux) on a BR6104KP-Router. The communication goes via the serial interface of the JeeNode to a serial interface on the router.
I am using the following shellscipt to get the data from the JEENode and process them :
stty 19200 -raw -crtscts -echo -ixoff -F /dev/ttyS1
while true ; do read help < /dev/ttyS1 echo 0 > /sys/class/gpio/gpio12/value echo $help
here comes some processing ...
echo 1 > /sys/class/gpio/gpio12/value done
I have a DS18B20-sensor connected and i use digital inputs and outputs.
Everything worked fine beside that randomly a message from a digital input was missed. This input is connected to a reedrelais on a gascounter. Everytime i get a pulse i send a message via the serial port and increase a variable which is also included in the message. So you can see that sometimes a message is missing. You can also see that the time between 2 messages is 2 times as normal. Now i have connected more DS18B20-sensors. Every 20 seconds the JeeNode is reading this sensors and sending for each sensor a message via serial. But i get only the message from the first sensor. When i use a terminalprogram to read this messages i get all messages. This messages comes very short one after the other. I think the problem is that the reading of the ttyS1 is not buffered.
Does anybody have an idea how to solve this ?
I would like to stay with the shellscript, because this router has only 16MB Ram, this means it is difficult to install an additional scriptlanguage like perl on python.