I thought I'd format a card and start from scratch but I have so much invested in this image I'd like to figure it out. I've learned that I can run the serial terminal in the background
sudo picocom &
However I can't seem to get this start at reboot. With this running in the bacground I can call scripts that use the port. However when I try to call the python script from php I get the following error
Code: Select all
Traceback (most recent call last):
File "cgi-bin/serial-to-arduino.py", line 4, in <module>
port = serial.Serial('/dev/ttyACM0', baudrate=9600, timeout=0)
File "/usr/local/lib/python2.7/dist-packages/serial/serialutil.py", line 261, in __init__
File "/usr/local/lib/python2.7/dist-packages/serial/serialposix.py", line 278, in open
raise SerialException("could not open port %s: %s" % (self._port, msg))
serial.serialutil.SerialException: could not open port /dev/ttyACM0: [Errno 13] Permission denied: '/dev/ttyACM0'
I suspect the big problem here is the permissions issue at the end of the error. How can I give the web permission to execute python scripts?