ttyS0, ttyAMA0, serial0

I was having trouble getting Observer program to run. This likely would have applied to all but I didn’t try that before making the change.

I was getting:

serial.serialutil.SerialException

could not open port /dev/ttyS0

I had enable_uart=1 in the boot config text file.

When I go to /dev/ I do see ttyAMA0, and do NOT see ttyS0. Even with enable_uart=1.

I tried multiple things and ultimately went in to sphero_sdk/observer/client/dal/serial_observer_port.py and changed the serial port from ttyS0 to serial0 and now it works.

I don’t know if this will apply to everyone. But I can now set_all_leds.py which was basically my Hello World.

3 Likes

I have tried the following and it works:
sudo ln -s /dev/ttyAMA0 /dev/ttyS0

Thanks
sudo ln -s /dev/ttyAMA0 /dev/ttyS0
worked for me on my raspberry pi 3
I had to
pip3 install aiohttp
pip3 install pyserial-asyncio
first.
then sudo ln -s /dev/ttyAMA0 /dev/ttyS0 worked!!!

Thanks again.

1 Like

the command
sudo ln -s /dev/ttyAMA0 /dev/ttyS0
has to run after reboot

one other thing:
If I change to the directory for the led programs before doing pipenv shell
things don’t work

1 Like