Here is my setup:
Raspberry Pi B
|
|
Arduberry
|
|
Hygrometer
I have no issues sending data to the Arduberry and doing an action. My problem is reading data back from the Arduino to display on the Pi.
Here is my Pi python code:
import requests
import serial
import syslog
import time
ser = serial.Serial('/dev/ttyAMA0' ,9600)
print('Start Logic')
time.sleep(2)
print('Write to Arduino')
ser.write('g')
while True:
print ser.read()
I also tried ser.readline() to no avail. I think the issue is within this python code but I'm not certain.
I opened up a very slow website to find out what an Arduberry is and it told me nothing.
What is an Arduberry?
With a normal Arduino the Python code must allow time for the Arduino to reset when the serial port is opened. This Python - Arduino demo illustrates the issue.
The while loop takes care of any delay, I manually wait 10 seconds or so before trying to send/retrieve data. I wonder if it has something to do with me trying to grab analog input data and that being the data I want to send back. Does it need to be encoded/decoded before being sent back to the pi?
That's a different webpage than the one I looked at but it still has no useful information. I am amazed by how many websites think moving images are more useful than actual data.
Is an Arduberry an Arduino board with an Atmega microprocessor - if so which one?
OR is it just a dumb interface between an RPi and Arduino compatible shields. If so I can't see how your question is an Arduino question.
So uh, I pulled a NOOB. Apparently you cannot monitor the serial connection and communicate at the same time. Problem solved. Wow, this was a real dumb solution. Sorry I wasted your time