top of page

Hardware

Public·109 members

Raspberry PI Serial Communication

I have been having trouble running serial commands with Raspberry PI. I have followed the instructions here: https://docs.petoi.com/apis/raspberry-pi-serial-port-as-an-interface -Login Shell over serial monitor is disabled

-Serial port hardware is enabled

-One wire interface is disabled


I have cloned the opencat repository to the pi, and here is the output when I run ardSerial.py: pi@raspberrypi:~/OpenCat/serialMaster $ ./ardSerial.py

ardSerial date:  Oct 10, 2023


*** Available serial ports: ***

/dev/ttyS0

Waiting for the robot to boot up

No port found! Please make sure the serial port can be recognized by the computer first.

Replug mode

Please disconnect and reconnect the device from the COMPUTER side

2023-11-08 09:25:30,275 main - INFO - Exception

Traceback (most recent call last):

  File "/home/pi/OpenCat/serialMaster/./ardSerial.py", line 885, in <module>

    raise e

  File "/home/pi/OpenCat/serialMaster/./ardSerial.py", line 862, in <module>

    connectPort(goodPorts)

  File "/home/pi/OpenCat/serialMaster/./ardSerial.py", line 701, in connectPort

    replug(PortList, needSendTask)

  File "/home/pi/OpenCat/serialMaster/./ardSerial.py", line 713, in replug

    window = tk.Tk()

             ^^^^^^^

  File "/usr/lib/python3.11/tkinter/__init__.py", line 2326, in init

    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)

              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

_tkinter.TclError: no display name and no $DISPLAY environment variable

* Port ttyS0 is not connected to a Petoi device!


I have verified that the switch on the back of the Nyboard is set to Rpi, and I have verified good continuity between the connections on the back of the Pi to the back of the Nyboard. None of the pins are shorted. I have also verified that I can control the GPIO pins on the Pi with a simple LED control python script with a breadboard. I can run the ardSerial.py and example.py if I set the Nyboard to Arduino and connect the Pi and Nyboard through micro usb. Does anyone have experience with this issue?

106 Views
Jason
Jason
Nov 17, 2023

When using the serial port ttyS0, The switch on the back of the Nyboard does not need to be set to Rpi, it also should be set to Arduino.

Members

bottom of page