Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Serial communication with Arduino only works while the screen is running

I'm on Linux and for some reason I can only use the serial port while screen is monitoring it. When screen is not running, the Python code doesn't crash or something. The Arduino just doesn't respond. Is there something I'm missing?

pi@raspberrypi ~ $ screen "/dev/ttyACM0" 115200

pi@raspberrypi ~ $ sudo python
>>> import serial
>>> s = serial.Serial("/dev/ttyACM0", 115200)
>>> s.write("EXP\n")
4
like image 508
Jasper Avatar asked Dec 19 '12 13:12

Jasper


1 Answers

Are you sure it's not asleep?

Some machines disable things like USB when it's in low power mode (which screen savers could be).

like image 156
Eric Fossum Avatar answered Oct 20 '22 16:10

Eric Fossum