JeeLink receiver in C

Posted at Feb 01/2010 07:00PM by amvv: Forgot to say, that you run it ffrom the command line, with the serial port device as a parameter. E.g.:

weather_listener /dev/ttyUSB1

This is a listener for the JeeLink, written in C, that dumps the received data to a text file

It also decodes the messages, and puts tghe data in a MySQL database.

It includes an error handler to stop it when you hit Ctrl+C and not hang the serial port leaving the JeeNode incommunicable.

It uses 9600 Baud, as I didn't manage to get it running with 57600 - probably a flags problem...9600 is enough for me and most uses anyway...

I adapted the JeeNode RF12 demo to only output the messages that are OK, but I think this code should also just process those...(not sure though)

use the following command to compile it:

gcc -o weather_listener -DWITHMYSQL $(mysql_config --cflags) weather.c \
    $(mysql_config --libs)

See the attached "weather.c" file for the source code.

If you have any questions, just drop a line.

weather.c (13.4 KB) jcw, 2010-09-15 18:54