My Problem: I've got an Arduino connected to my Pi via /dev/ttyUSB0 and I always have to initialize the connection via screen, otherwise I cannot send any values via Bash or Python.
What I'm doing: From the Arduino I receive sensor values like this:
<43.30,43.50> <43.30,43.70> <43.50,43.70> <43.60,43.30> <43.50,43.60> <43.50,43.60> <43.50,44.10> <43.50,43.60> <43.30,43.60> <43.50,43.70>
That data I'm parsing via Python and later Java...
I also can send data to the Arduino: 0 and 1 to turn a switch on and off.
When I connect via screen I can see the input values and send values. Then, when I close screen, I can also use my script, eg this one:
#!/usr/bin/python import serial, time ser = serial.Serial('/dev/ttyUSB0', 9600) ser.write("1") ser.close
But the every time I reboot my Pi, the script doesn't work until I connect via screen to /dev/ttyUSB0. Does anybody know why?