Using the program 'screen' works fine; I can see data being transmitted to the XRF module.
How do I get the data from the serial port, so I can do some processing on it? I tried perl but it didn't read anything.
I haven't tried this on a Pi, but I use python to access a serial port on a Beagle Bone.
Python serial can be installed using
Then you can use the following code snippet:
Obviously replacing "/dev/ttyS0" with the name of the serial port, and 9600 with the baud rate you need. response will be an array containing the lines which are returned by the serial port.
More details of the python API can be found at http://pyserial.sourceforge.net/
The name of the serial port on a pi is: ttyAMA0
so my code is: