Team,
Is my Raspberry Pi 5 broken, or just not configured right?
Is there a simple test to tell if a particular GPIO port is working?
I can't get GPIO 14/15, TX/RX, pins 8/10 to communicate on my Raspberry Pi 5 with the RoboClaw 2x7a.
I'm able to use MotionStudio to run the RoboClaw via USB and also with
Arduino via S1/S2 so I know the RoboClaw works.
Yes, it's plugged in and wired up
right.
From what I gather on the interwebs RPi5 UART problems is a known issue with some discussion but I find no definitive answer.
The Pi5 handles UARTS completely differently from previous models.
I Ubuntu 24.04 configures things differently than previous versions.
Python3 handles communication differently so some older drivers no longer work.
I've consulted 3 Artificial Stupidities:
Claude-3.5-Sonnet who's supposed to be a great coder but couldn't keep context so gave inappropriate advice.
GPT-4o stayed on track better but went down similar troubleshooting paths without resolution, and
Grok maintained context better but made obvious errors like giving the wrong physical pins for GPIO ports. With that, how do I trust advice about areas I don't know?
All 3 had me reconfigure
/boot/firmware/config.txt, -/cmdline.txt; device tree settings;
multiple command line configurations; a load of test programs --
all for naught. In the end my system was so
over-(mis-?)-configured that I went back to a virgin install.
At one time I was able to use GPIO4/5 to communicate with the RoboClaw but that didn't answer the big question:
Is my Raspberry Pi 5 broken, or just not configured right?
Under one of the trial configurations I was able to produce a square wave on GPIO14/TX that I could see on my digital O'scope, so something was working. But loop-back tests failed to receive data.
Am I failing to transmit, failing to receive, both?
In the end I consulted a Real Intelligence (Mike Wimble) who was able to get it to work on his system, but a clone of his OS and code failed to work on mine.
So --
1) has anybody encountered this issue?
2) were you able to fix it?
3) can you explain exactly how you did it?
4) is there a simple test to tell if a particular GPIO port is working?
I have a Digilent Analog Discovery
2 digital oscilloscope if that helps.
-- James H Phelan "Nihil est sine ratione cur potius sit quam non sit" Leibniz
On Mar 16, 2025, at 1:34 PM, 'James H Phelan' via HomeBrew Robotics Club <hbrob...@googlegroups.com> wrote:Team,
Is my Raspberry Pi 5 broken, or just not configured right?
Is there a simple test to tell if a particular GPIO port is working?
I can't get GPIO 14/15, TX/RX, pins 8/10 to communicate on my Raspberry Pi 5 with the RoboClaw 2x7a.
I'd guess, the easiest way to test it is to connect TX and RX pins, as Chris suggested, and see the echo in picocom:
(Use Ctrl/A + Ctrl/X to exit):
picocom /dev/tty1 -b 115200
--
You received this message because you are subscribed to the Google Groups "HomeBrew Robotics Club" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hbrobotics+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/hbrobotics/F29BC5E5-C099-47DE-A97E-340C36DB1129%40gmail.com.
Team,
Thanks for all your help and suggestions!
Try the other UART:
ros@pisigyn:~$ sudo nano /boot/firmware/config.txt
[pi5]
#dtoverlay=uart0-pi5
dtoverlay=uart1-pi5
ros@pisigyn:~$ sudo reboot
ros@pisigyn:~$ ls -l /dev/ttyAMA*
crw-rw---- 1 root dialout 204, 65 Mar 17 05:01 /dev/ttyAMA1
crw-rw---- 1 root dialout 204, 74 Mar 17 05:01 /dev/ttyAMA10
GPIO0/1;ID_SD/ID_SC;pins27/28
Pi ID_SD -> scope RX
Pi ID_SC -> scope TX
ros@pisigyn:~$ minicom -D /dev/ttyAMA1
scope set to UART protocol
minicom -> scope: characters echo
minicom <- scope: characters echo
scope set to analog:
characters appear as single spikes (rather than the cluster I
expect).
IT WORKS!
Try UART0 again:
ros@pisigyn:~$ sudo nano /boot/firmware/config.txt
RoverDoc
sudo apt install raspi-config--
You received this message because you are subscribed to the Google Groups "HomeBrew Robotics Club" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hbrobotics+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/hbrobotics/4cb03c29-ae7c-454c-b253-eb7ffa418543%40hal-pc.org.
ros@pisigyn:~$ cat
/boot/firmware/cmdline.txt
zswap.enabled=1 zswap.zpool=z3fold zswap.compressor=zstd
multipath=off dwc_otg.lpm_enable=0 console=tty1
root=LABEL=writable rootfstype=ext4 rootwait fixrtc quiet splash
James H Phelan "Nihil est sine ratione cur potius sit quam non sit" Leibniz
To view this discussion visit https://groups.google.com/d/msgid/hbrobotics/CA%2BKVXVP8bLbLzmRN-_kvCxTK%3DDbOxDu81%3DJ78VuxgQTcKyC5qA%40mail.gmail.com.
![]() | |
To view this discussion visit https://groups.google.com/d/msgid/hbrobotics/3DE971EF-2445-44DB-A2D9-E60B5EC94CC3%40gmail.com.
I/O
RoboClaw's I/O is setup to interface to both 5V and 3.3V logic.
This is accomplished by internally
current limiting and clipping any voltages over 3.3V. RoboClaw
outputs 3.3V which will work with
any 5V or 3.3V logic. This is also done to protect the I/O from
damage.
James H Phelan "Nihil est sine ratione cur potius sit quam non sit" Leibniz
I will not accept any resposibility for damage to any device as a result of you following these instructions. This is what worked for me. Your mileage may vary and you assume all risks. Instructions for use with other Raspberry Pi devices may be similar, but I have not tested them.
If you miswire the Raspberry Pi to the RoboClaw, you could damage the Raspberry Pi and possibly the RoboClaw. Again, you follow these instructions at your own risk. Especially be sure that all wiring is donwe with both the Raspberry Pi and the RoboClaw completely powered off.
There are at least two UARTs you can use with the Raspberry Pi 5. To use them, you need to add lines to the config.txt file via
sudo nano /boot/firmware/config.txt
Of course, you can use your own favorite editor instead of nano.
The two UARTs are symbolically called UART0 and UART1. To enable one or both, add the following to the config.txt file. I added these lines to the end of the file on my Raspberry Pi 5.
[pi5]
dtoverlay=uart0-pi5
dtoverlay=uart1-pi5
The first dtoverlay line enables UART0 and, as you probably guessed, the second dtoverlay line enables UART1. Put either or both of those lines after the [pi5] line. Understand that by putting these lines in the config.txt file, you are assigning a pair of pins for use as UART communication for each UART, and those pins cannot then be used for other functionality.
See This link for a description and description of the GPIO pins on the Raspberry Pi board.
UART0 assigns GPIO14 (a.k.a TXD) as a transmit pin and GPIO15 (a.k.a. RXD) as a receive pin.UART1 assigns GPIO0 (a.k.a. ID_SD) as a transmit pin and GPIO1 (a.k.a. ID_SC) as a receive pin.
After you make the above change to the config.txt file you need to reboot the Raspberry Pi. You will see UART0 show up in the device tree as ttyAMA0 and UART1 show up as ttyAMA1. Remember, only those devices that you enabled will show up in the device tree. E.g.
# This next line is a shell command. The resulting output is the three lines after that. ls -l /dev/ttyAMA* crw-rw-rw- 1 root dialout 204, 64 Mar 16 17:30 /dev/ttyAMA0 crw-rw-rw- 1 root dialout 204, 65 Mar 16 17:57 /dev/ttyAMA1 crw-rw-rw- 1 root dialout 204, 74 Mar 16 17:30 /dev/ttyAMA10
You can ignore the ttyAMA10 device for purposes of this code.
By default, the devices are only able to be accessed by the root user or some user which is a member of the dialout group. In order to eliminate the complication needing to be the root user to use one of the UART devices, you should add yourself to the dialout group. First, find out your user name via:
whoami
The single line response will show your user name. Then you need to add that user (yourself) to the dialout group. Do it in two commands:
sudo su
usermod -a -G dialout myusername
exitReplace myusername in the second line with the actual username result from the whoamicommand.
Adding yourself to a group won't actually take effect until you log in again. So, log out of your current Linux session and log back in again. If you execute the following command:
groups
you should see the list of group names that you are a member of. Obviously, dialout should be in that list. Now you can access the UART(s) you enabled without needing special permission.
Before connecting the Raspberry Pi to the Roboclaw device itself, verify that the Raspberry Pi UART is actually functional. Put a jumper between the transmit and receive pins for the UART port you enabled. E.g., if you enabled UART0, put a jumper between GPIO14 and GPIO15. If you enabled UART1, put a jumper beween GPIO0 and GPIO1.
Now, simply use minicom (or your favorite terminal emulator) to test the UART. Issue the command:
minicom -D /dev/ttyAMA0
if you enabled UART0. For UART1, the device is /dev/ttyAMA1.
When minicom comes up, you should be able to type some characters on the keyboard and see them echoed in the screen. To exit minicom, type control-A followed by Q and then hit Enter when it asks if you want to "Leave without reset?". You can explore minicom if you want to play with attributes of the UART port, such as setting a different baud rate, but I'm not covering that here.
--
You received this message because you are subscribed to the Google Groups "HomeBrew Robotics Club" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hbrobotics+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/hbrobotics/077358d1-cd57-43c3-9d01-c116a3f28535n%40googlegroups.com.
By default, is there a login prompt on UART0? Should we disable it first?
To view this discussion visit https://groups.google.com/d/msgid/hbrobotics/4551952c-f700-4f95-81e8-120b0694fabcn%40googlegroups.com.