/dev/serial0 disappeared with RPi update

65 views
Skip to first unread message

Chris Richmond

unread,
Jul 5, 2019, 11:49:01 AM7/5/19
to weewx-user
I've got a work-around, but just asking anyway...

While messing around getting a UPS set up for the new Vue setup I did an OS update, which seems to have broken
udev or something related to getting /dev/serial0 created. udev was working such that the weewx account could talk
to /dev/serial0 before this.  After the update, even root couldn't start weewx with this message:
Jul  5 08:07:24 pi2c weewx[976]: import of driver failed: [Errno 2] could not open port /dev/serial0: [Errno 2] No such file or directory: '/dev/serial0' (<class 'serial.serialutil.SerialException'>)
Jul  5 08:07:24 pi2c weewx[976]: engine: Unable to load driver: [Errno 2] could not open port /dev/serial0: [Errno 2] No such file or directory: '/dev/serial0'

enable_uart=1 is enabled in /boot/config.txt.  This is about all that's interesting from the boot logs (/var/syslog):
Jul  5 08:04:09 pi2c kernel: [    1.035375] uart-pl011 20201000.serial: cts_event_workaround enabled
Jul  5 08:04:09 pi2c kernel: [    1.038405] 20201000.serial: ttyAMA0 at MMIO 0x20201000 (irq = 81, base_baud = 0) is a PL011 rev2

I ended up pointing the weewx.conf like this:     port = /dev/ttyAMA0
and after that I could start weewx as weewx (not root).

This is the version of the OS I have now that doens't work the same as before:
Jul  5 08:04:09 pi2c kernel: [    0.000000] Linux version 4.19.42+ (dom@dom-XPS-13-9370) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611)) #1219 Tu
Jul  5 08:04:09 pi2c kernel: [    0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d
pi2c_/home/weewx> cat /etc/debian_version 
9.9

This is the other RPi with the VP2 that does work as expected on /dev/serial0:
Mar 24 14:20:40 pi2a kernel: [    0.000000] Linux version 4.9.35+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #1014 Fri Jun 30 14:34:49 BST 2017
Mar 24 14:20:40 pi2a kernel: [    0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d

Mar 24 14:20:41 pi2a kernel: [    1.010518] 20201000.serial: ttyAMA0 at MMIO 0x20201000 (irq = 81, base_baud = 0) is a PL011 rev2
Mar 24 14:20:45 pi2a kernel: [   18.585113] uart-pl011 20201000.serial: no DMA platform data

pi2a_/var/log> cat /etc/debian_version 
8.0

Both are RPi model B+.

Chris


vince

unread,
Jul 5, 2019, 12:00:05 PM7/5/19
to weewx-user
Is there a question in there someplace ?

Perhaps you might try a google search for "No such file or directory: '/dev/serial0'" and see if that helps any.

Leon Shaner

unread,
Jul 5, 2019, 12:02:14 PM7/5/19
to vince, weewx-user
I took his note to be a heads up when upgrading from Raspbian Stretch to Raspbian Buster.
Sounds like they named it Buster, appropriately, because things are breaking.  :S

Regards,
\Leon
--
Leon Shaner :: Dearborn, Michigan (iPad)

On Jul 5, 2019, at 12:00 PM, vince <vince...@gmail.com> wrote:


Is there a question in there someplace ?

Perhaps you might try a google search for "No such file or directory: '/dev/serial0'" and see if that helps any.

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/75adbc5c-a3cf-481a-941f-b6e3ada9610b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chris Richmond

unread,
Jul 6, 2019, 9:58:55 AM7/6/19
to weewx-user
Leon has it; posted mostly as a heads-up.  Of course I googled first, and the more relevent references were about RPi 3's and bluetooth and
the fact that there was a change where the uart(s) gets disabled by default now.  The /boot/config.txt has the uart enable, and /boot/cmdline.txt
has a default console thing to remove (was already done).  Anyhow, since it wasn't a permissions issue, I figured I'd notify/ask where there are
known RPi and serial port users in case someone has a better idea.  That's all.

Thought I'd sent this, saves an extra post. Turns out it was a udev issue, and self inflicted (I know, shocking).  I grepped syslog for udev and
found a couple of obscure error messages, but it was a quote problem in the rules file (single verses double).
Maybe it was always broken and it was simply the reboot that exposed it.My change control isn't good enough to know for sure.
Anyway, weewx is back using /dev/serial0.

Thx, Chris

Reply all
Reply to author
Forward
0 new messages