Reading from Raspberry Pi port
Posted: Fri Oct 02, 2015 7:39 am
The Raspberry Pi is hooked up to a RF69 board through the GPIO. Using the OEM (the hardware that I bought) software, I am able to get the current reading. However, I do not want to use the OEM software as it is in their database. I am hoping to read and insert the reading into my own database.
I have written a python script to get the data but I am getting weird symbols instead. I have posted my script below
#!/usr/bin/env python
import time
import serial
ser = serial.Serial(
port = '/dev/ttyAMA0',
baudrate = 9600,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS,
timeout=3,
)
ser.open()
response = ser.readlines()
ser.close()
print response
Some of the data I received
['!!!!!\x86\84a\x04\xff']
['!!!!!\x84\84a\x04\xff']
['!!!\xa1!!%!5\xd5']
Note: I am not good at Python, just picked it up two weeks ago.
I have written a python script to get the data but I am getting weird symbols instead. I have posted my script below
#!/usr/bin/env python
import time
import serial
ser = serial.Serial(
port = '/dev/ttyAMA0',
baudrate = 9600,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS,
timeout=3,
)
ser.open()
response = ser.readlines()
ser.close()
print response
Some of the data I received
['!!!!!\x86\84a\x04\xff']
['!!!!!\x84\84a\x04\xff']
['!!!\xa1!!%!5\xd5']
Note: I am not good at Python, just picked it up two weeks ago.