# Reading data from serial

**URL:** <https://discourse.nodered.org/t/reading-data-from-serial/93670>\
**Category:** General\
**Created:** [3 December 2024 19:28 UTC](https://discourse.nodered.org/t/reading-data-from-serial/93670 "2024-12-03T19:28:17Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [3 December 2024 19:28 UTC](https://discourse.nodered.org/t/reading-data-from-serial/93670/1 "2024-12-03T19:28:17Z")

</div>

Using a Pi 3B+ with a RF module fitted to receive energy data, which has worked (and still works) for a number of years, but I'm in the process of rebuilding a new server from scratch using Bullseye, instead of Stretch.  
I'm using a second SD card, so I can switch between both whilst the new server is being slowly developed!

However, I'm not receiving any data in `/dev/ttyAMA0` despite making the same changes I've made to the old system;

Which was adding;

```auto
[all]
dtoverlay=pi3-disable-bt
enable_uart=1

```

to `/boot/firmware/config.txt`

and disabled bluetooth from using the UART - `sudo systemctl disable hciuart`  
Rebooted, and no data appears

![serial](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/d/cd8d855642cef03cca39a920128a2617c835a5af.jpeg)

At this stage I retried the old system, by swopping the SD card, and data flowed as usual, so the Pi & RF module are working OK.

Back to the new system... I've tried;

Run `raspi-config` \> Interface Options \> Serial Port enable disable, and have;

 ![serial](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/2/b250640277648a37fa401039d7de2b1cfa4965e8.jpeg)

Also tried;

```auto
pi@newserver:~ $ ls /dev/tty*
/dev/tty /dev/tty17 /dev/tty26 /dev/tty35 /dev/tty44 /dev/tty53 /dev/tty62
/dev/tty0 /dev/tty18 /dev/tty27 /dev/tty36 /dev/tty45 /dev/tty54 /dev/tty63
/dev/tty1 /dev/tty19 /dev/tty28 /dev/tty37 /dev/tty46 /dev/tty55 /dev/tty7
/dev/tty10 /dev/tty2 /dev/tty29 /dev/tty38 /dev/tty47 /dev/tty56 /dev/tty8
/dev/tty11 /dev/tty20 /dev/tty3 /dev/tty39 /dev/tty48 /dev/tty57 /dev/tty9
/dev/tty12 /dev/tty21 /dev/tty30 /dev/tty4 /dev/tty49 /dev/tty58 /dev/ttyAMA0
/dev/tty13 /dev/tty22 /dev/tty31 /dev/tty40 /dev/tty5 /dev/tty59 /dev/ttyprintk
/dev/tty14 /dev/tty23 /dev/tty32 /dev/tty41 /dev/tty50 /dev/tty6 /dev/ttyS0
/dev/tty15 /dev/tty24 /dev/tty33 /dev/tty42 /dev/tty51 /dev/tty60
/dev/tty16 /dev/tty25 /dev/tty34 /dev/tty43 /dev/tty52 /dev/tty61
pi@newserver:~ $

```

and `/dev/ttyAMA0` exists.

I've installed Minicom and checked - `sudo minicom -D /dev/ttyAMA0 -b38400` but again no data appears. (and yes data is being transmitted)

It's important that I get this working, so would appreciate any advice.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [3 December 2024 19:58 UTC](https://discourse.nodered.org/t/reading-data-from-serial/93670/2 "2024-12-03T19:58:41Z")

</div>

So going from Stretch to Bullseye the comms have stopped.

With what you have described it would seem it is an O/S problem.

I'd check the RasPi forums and see if you can get help there.

Sorry, a bit lame, but that's how I see the problem.

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [3 December 2024 20:25 UTC](https://discourse.nodered.org/t/reading-data-from-serial/93670/3 "2024-12-03T20:25:14Z")

</div>

Hi Paul,

anything being printed via `cat /dev/ttyAMA0`  
I can do this to watch my Zwave RF module do magic.

I'm not a pro here by any means, but I would check to see if data is actually being received, I think `cat` will reveal that?

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [3 December 2024 20:28 UTC](https://discourse.nodered.org/t/reading-data-from-serial/93670/4 "2024-12-03T20:28:07Z")

</div>

> [@marcus-j-davies](#):
>
> anything being printed via `cat /dev/ttyAMA0`

No, nothing at all 😒

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [3 December 2024 20:29 UTC](https://discourse.nodered.org/t/reading-data-from-serial/93670/5 "2024-12-03T20:29:20Z")

</div>

What does this command give?  
`ls /dev/serial/by-id/`

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [3 December 2024 20:30 UTC](https://discourse.nodered.org/t/reading-data-from-serial/93670/6 "2024-12-03T20:30:16Z")

</div>

A bit daring - but could you create an echo loop on the GPIO's - to see if rx,tx is working?

(Disclaimer: again im no pro 😅)

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [3 December 2024 20:30 UTC](https://discourse.nodered.org/t/reading-data-from-serial/93670/7 "2024-12-03T20:30:39Z")

</div>

> [@Colin](#):
>
> What does this command give?

```auto
paul@myserver:~ $ ls /dev/serial/by-id/
ls: cannot access '/dev/serial/by-id/': No such file or directory

```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [3 December 2024 20:35 UTC](https://discourse.nodered.org/t/reading-data-from-serial/93670/8 "2024-12-03T20:35:58Z")

</div>

Ah, that will be because you are using the built in uart, not a plugin one. Sorry, I don't know how to use that in Bullseye. They must have changed something in Bullseye.

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [3 December 2024 20:38 UTC](https://discourse.nodered.org/t/reading-data-from-serial/93670/9 "2024-12-03T20:38:20Z")

</div>

Any magic with adding this in your config?

```auto
core_freq=250

```

Im seeing a lot of threads doing that, to get UART working - strange that there is no issue under stretch however

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [3 December 2024 20:44 UTC](https://discourse.nodered.org/t/reading-data-from-serial/93670/10 "2024-12-03T20:44:34Z")

</div>

> [@marcus-j-davies](#):
>
> Any magic with adding this in your config?

I'm going to back up the SD card first (just in case it breaks things!!)

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [3 December 2024 20:45 UTC](https://discourse.nodered.org/t/reading-data-from-serial/93670/11 "2024-12-03T20:45:20Z")

</div>

feel free to take me off your xmas card list if it goes bang! 😬

See: [https://forums.raspberrypi.com/viewtopic.php?t=213499](https://forums.raspberrypi.com/viewtopic.php?t=213499)

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [3 December 2024 21:51 UTC](https://discourse.nodered.org/t/reading-data-from-serial/93670/12 "2024-12-03T21:51:10Z")

</div>

> [@marcus-j-davies](#):
>
> Any magic with adding this in your config?

I'm afraid not, just the same.

Whilst awaiting for the SD card to create an image on my laptop, I put my original 'Stretch' SD card in the same pi, and tried `cat /dev/ttyAMA0` and which returned the expected result, spitting data out of the Serial In node.

 ![serial](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/a/7a959c3afb486b0a38215114facf1d8980cb305a.jpeg)

So no further forward...

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [3 December 2024 21:54 UTC](https://discourse.nodered.org/t/reading-data-from-serial/93670/13 "2024-12-03T21:54:37Z")

</div>

Mmmm...

Sorry, not sure what else to try - I'm not educated enough in a lot of this. 🙁

---

<div class="post-metadata">

**Author:** ![edje11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/edje11/32/572_2.png) [@edje11](https://discourse.nodered.org/u/edje11)\
**Post date:** [3 December 2024 21:57 UTC](https://discourse.nodered.org/t/reading-data-from-serial/93670/14 "2024-12-03T21:57:19Z")

</div>

Some forums talk about **dtoverlay=disable-bt** instead of **dtoverlay=pi3-disable-bt**

The other thing is that you have in raspi-config **The serial login shell is enabled** , my experience is that this keeps the serial occupied (sometimes).This was not with Buster, but you can give it a try.

Just my 2 cents

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [3 December 2024 22:09 UTC](https://discourse.nodered.org/t/reading-data-from-serial/93670/15 "2024-12-03T22:09:10Z")

</div>

> [@edje11](#):
>
> Some forums talk about **dtoverlay=disable-bt** instead of **dtoverlay=pi3-disable-bt**

No change

> [@edje11](#):
>
> **The serial login shell is enabled** , my experience is that this keeps the serial occupied (sometimes)

I've disabled it now and no change, but thanks for trying.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [3 December 2024 22:35 UTC](https://discourse.nodered.org/t/reading-data-from-serial/93670/16 "2024-12-03T22:35:26Z")

</div>

Looks like a lot of good info here [Configuring The GPIO Serial Port On Raspbian Jessie and Stretch Including Pi 3 and 4 - Spell Foundry](https://spellfoundry.com/2016/05/29/configuring-gpio-serial-port-raspbian-jessie-including-pi-3-4/)  
Including trying ttyS0

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [4 December 2024 20:04 UTC](https://discourse.nodered.org/t/reading-data-from-serial/93670/17 "2024-12-04T20:04:31Z")

</div>

@dceejay I tried what was suggested in the write up but didn't make much progress, however... in the comments below the article, someone mentioned that a script had been written to [auto configure the UART](https://github.com/itemir/rpi_boat_utils/tree/master/uart_control) so I gave it a try, and I'm now back working 😃

I had also previously added these lines to the `/boot/firmware/config.txt`

```auto
[all]
dtoverlay=pi3-disable-bt
enable_uart=1

```

and they also have to remain in place.

Thanks for the help.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [18 December 2024 20:04 UTC](https://discourse.nodered.org/t/reading-data-from-serial/93670/18 "2024-12-18T20:04:38Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
