Raspberry Pi 5 / Ubuntu 24.04 Can't get GPIO14/15;TX.RX;pins8/10 to work

976 views
Skip to first unread message

James H Phelan

unread,
Mar 16, 2025, 4:34:44 PM3/16/25
to HomeBrew Robotics Club

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.

RoverDoc

-- 
James H Phelan
"Nihil est sine ratione cur potius sit quam non sit"
Leibniz

Marco Walther

unread,
Mar 16, 2025, 7:08:52 PM3/16/25
to hbrob...@googlegroups.com
On 3/16/25 13:34, 'James H Phelan' via HomeBrew Robotics Club 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?

Make some LEDs blink?! Preferably with RaspiOS;-)

>
> I can't get GPIO 14/15, TX/RX, pins 8/10 to communicate on my Raspberry
> Pi 5 with the RoboClaw 2x7a.

Can you talk UART to anything on those pins?

>
> 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.

On the same pins on the RoboClaw, right?

>
> 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.

A little bit;-)

>
> I Ubuntu 24.04 configures things differently than previous versions.

Not really.

>
> 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.

You should be able to get LEDs and 'digital inputs' with a switch
working on both pins, Python would probably be the best way to test that.

Once you know, that Python can turn LEDs on/off `and` sees inputs on the
pins, I would call the pins good.

>
> 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?

I tried serial0 on GPIO14/GPIO15 and that seems to work fine on my
Pi5;-) I'll attach an email originally written to Michael;-)

>
> 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.

One of the little USB-TTLuart boards is handy, as long as you know, it
works with your computer;-)

-- Marco

>
> RoverDoc
>
> --
> James H Phelan
> "Nihil est sine ratione cur potius sit quam non sit"
> Leibniz
>
> --
> 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
> <mailto:hbrobotics+...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/
> hbrobotics/555312ea-9651-4b56-a8c6-4500a3718b4a%40hal-pc.org <https://
> groups.google.com/d/msgid/hbrobotics/555312ea-9651-4b56-
> a8c6-4500a3718b4a%40hal-pc.org?utm_medium=email&utm_source=footer>.
Serial '0' in Pi5 Ubuntu 24.04 - Marco Walther <marcow46@gmail.com> - 2025-03-04 2235.eml

Chris Albertson

unread,
Mar 16, 2025, 9:41:59 PM3/16/25
to hbrob...@googlegroups.com

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.


What voltages on the TX/RX pins is the RoboClaw expecting? Are they logic level or RS-232?    RS-232 requires both positive and negative volts.   logic level is zero and either 3.3 or 5

Test a GPIO RX/TX pin with a loop-back.  Jumper the pins and verify the data you read is the same as what is sent.


Sergei Grichine

unread,
Mar 17, 2025, 12:58:50 AM3/17/25
to hbrob...@googlegroups.com

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

Best Regards, 
-- Sergei
   

--
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.

James H Phelan

unread,
Mar 17, 2025, 10:06:44 AM3/17/25
to hbrob...@googlegroups.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

[pi5]
dtoverlay=uart0-pi5
dtoverlay=uart1-pi5
ros@pisigyn:~$ sudo reboot

ros@pisigyn:~$ ls -l /dev/ttyAMA*
crw-rw---- 1 root dialout 204, 64 Mar 17 05:55 /dev/ttyAMA0
crw-rw---- 1 root dialout 204, 65 Mar 17 05:55 /dev/ttyAMA1
crw-rw---- 1 root dialout 204, 74 Mar 17 05:55 /dev/ttyAMA10
try UART0: GPIO14/15; TX/RX; pins8/10 again
scope set to UART protocol
TX of scope to RX of Pi
RX of scope to TX of Pi
ros@pisigyn:~$ minicom -D /dev/ttyAMA0
minicom -> scope: NO characters
minicom <- scope: characters echo

loopback, scope analog: no spikes, just minimal single blips.

CONCLUSION: TX on GPIO14 is broken

RoverDoc

Sergei Grichine

unread,
Mar 17, 2025, 11:12:59 AM3/17/25
to hbrob...@googlegroups.com
Just a note: raspi-config has a way of enabling/disabling console login on tty0, so that login prompt would appear there.

You can install it on Ubuntu:
     sudo apt install raspi-config
If you connect any device to those pins, console should be disabled.

--
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.


--
Best Regards,
-- Sergei

James H Phelan

unread,
Mar 17, 2025, 11:40:36 AM3/17/25
to hbrob...@googlegroups.com

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

Chris Albertson

unread,
Mar 17, 2025, 1:20:48 PM3/17/25
to hbrob...@googlegroups.com
I’m still thinking it might be a voltage issue. If RoboClaw wants RS-232, then no way a straight connection work. And if it is logic level, a 3.3 to 5.0 volt will be marginal.

> On Mar 17, 2025, at 8:40 AM, 'James H Phelan' via HomeBrew Robotics Club <hbrob...@googlegroups.com> wrote:
>

Michael Wimble

unread,
Mar 17, 2025, 1:32:03 PM3/17/25
to hbrob...@googlegroups.com
The roboclaw uart adapts to both 3.3 and 5v logic.

> On Mar 17, 2025, at 10:20 AM, Chris Albertson <alberts...@gmail.com> wrote:
>
> I’m still thinking it might be a voltage issue. If RoboClaw wants RS-232, then no way a straight connection work. And if it is logic level, a 3.3 to 5.0 volt will be marginal.
>
>> On Mar 17, 2025, at 8:40 AM, 'James H Phelan' via HomeBrew Robotics Club <hbrob...@googlegroups.com> wrote:
>>
>
> --
> 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/ABD7D7D2-7128-41A0-B7C9-7E0DB4F20CF9%40gmail.com.

Chris Albertson

unread,
Mar 17, 2025, 3:40:35 PM3/17/25
to hbrob...@googlegroups.com
Buy a logic analyzer.    The best deal is the Saleae logic analyzer clone.  These are cheap as dirt on Aliexpress but affordable on Amazon too, and you get next day delivery.
They work 100% perfect with the Saleae software.   You can see things like the data sent over serial or I2c and the duty cycle of PWM and even record all of this at the same time.
They make better analyses but for low-speed data (under about 1 or 2 MHz). like we have with robots even the $10 clones work well.

For robotics, I’d say a logic analyzer is a more useful tool then even an oscilloscope.  In this case it will let you see the commands sent and the PWM output in real time.

Here is an Amazon link.


James H Phelan

unread,
Mar 17, 2025, 4:53:00 PM3/17/25
to hbrob...@googlegroups.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

H Y

unread,
Jun 24, 2025, 8:44:57 AM6/24/25
to HomeBrew Robotics Club
Hello,

I'm facing the issue on Raspberry Pi 5 GPIO 14 TX Pin as you mentioned. Have reached to a solution ?

17 Mart 2025 Pazartesi tarihinde saat 23:53:00 UTC+3 itibarıyla James H Phelan şunları yazdı:

Michael Wimble

unread,
Jun 24, 2025, 5:17:00 PM6/24/25
to hbrob...@googlegroups.com
From my git repo at https://github.com/wimblerobotics/ros2_roboclaw_driver

Using UARTs on the Raspberry Pi 5

Enabling the UARTs

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.

Assigning yourself to the dialout group.

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
exit

Replace 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.

Test that the UART is working.

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.

H Y

unread,
Jun 25, 2025, 6:02:27 AM6/25/25
to HomeBrew Robotics Club
I tried every step as you mentioned but still UART0 doesn't work and UART1 works. I'll try with another Pi 5 but nothing worked on two Pi 5 I have.

25 Haziran 2025 Çarşamba tarihinde saat 00:17:00 UTC+3 itibarıyla Michael Wimble şunları yazdı:

Sergei Grichine

unread,
Jun 25, 2025, 7:50:03 AM6/25/25
to hbrob...@googlegroups.com

By default, is there a login prompt on UART0? Should we disable it first?


Best Regards, 
-- Sergei
   

Reply all
Reply to author
Forward
0 new messages