robertoj Posted August 20, 2023 Posted August 20, 2023 (edited) Hello, I have a lidar scanner, which I already made it work with a USB-TTL serial adapter... with a decoding python program... it works great However, I tried to use one of the serial ports in the pins of my orange Pi zero... UART1, in pins PG6,PG7... I have strange behavior When I test the serial port with picocom or screen, I see the flow of characters: picocom -b 230400 /dev/ttyS1 screen /dev/ttyS1 230400 However, my python program fails to read at the first character. With the python's own miniterm, I get the same error Spoiler roberto@orangepizero:~$ python3 -m serial.tools.miniterm /dev/ttyS1 230400 --- Miniterm on /dev/ttyS1 230400,8,N,1 --- --- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H --- ��␆S��␀�␀��␀��␀��␀��␀��␀�b␀�d�V� �,␀�␀��␀��␀�b␀�d␀���␋Y���,␀\D��,␀�2�_D��Exception in thread rx: --- exit --- Traceback (most recent call last): File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner self.run() File "/usr/lib/python3.9/threading.py", line 892, in run self._target(*self._args, **self._kwargs) File "/usr/lib/python3/dist-packages/serial/tools/miniterm.py", line 499, in reader data = self.serial.read(self.serial.in_waiting or 1) File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 577, in read raise SerialException( serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?) roberto@orangepizero:~$ Anybody who is using ttyS1 successfully in Python? THANKS!! Post data: I enabled the ttyS1 with the addition of "uart1" after "usbhost3" inside armbianEnv.txt I also changed "console=serial" to "console=ttyS0" I get a few lines of characters, but then serial/serialposix.py exits with the exception Edited August 20, 2023 by robertoj 0 Quote
robertoj Posted August 20, 2023 Author Posted August 20, 2023 Strangely, I entered "sudo chmod 777 /dev/ttyS1" and "python3 -m serial.tools.miniterm /dev/ttyS1 230400" worked This is something that other apps using serial need, like ROS 0 Quote
robertoj Posted August 21, 2023 Author Posted August 21, 2023 Since I don't like using chmod 777, I returned to using the USB-serial adapter, which does not require the chmod 0 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.