Emonhub stopped and can't restart

Did you do this?

on “sudo dpkg --configure -a” and “update”:
still error: “Package python3-serial is not available”

pi@emonpi:~ $ sudo dpkg --configure -a
pi@emonpi:~ $ sudo apt update
Get:1 http://archive.raspberrypi.org/debian buster InRelease [32.6 kB]
Hit:2 http://raspbian.raspberrypi.org/raspbian buster InRelease
Get:3 http://archive.raspberrypi.org/debian buster/main armhf Packages [330 kB]
Fetched 363 kB in 2s (173 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
1 package can be upgraded. Run 'apt list --upgradable' to see it.
pi@emonpi:~ $ sudo apt-get install -y python3-serial python3-configobj python3-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python3-serial is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'python3-serial' has no installation candidate
E: Unable to locate package python3-configobj

Odd.

I have just deleted the dkpg status file and forced it to rebuild. Note the apt update changed to what you see but I find the serial package.

pi@emon-serial:~ $ sudo apt-get update
Get:1 http://archive.raspberrypi.org/debian buster InRelease [32.6 kB]
Hit:2 http://raspbian.raspberrypi.org/raspbian buster InRelease
Get:3 http://archive.raspberrypi.org/debian buster/main armhf Packages [330 kB]
Fetched 363 kB in 8s (43.2 kB/s)
Reading package lists... Done
pi@emon-serial:~ $ apt-cache search python3-serial
python3-serial - pyserial - module encapsulating access for the serial port
python3-serial-asyncio - Async I/O extension package for pyserial
pi@emon-serial:~ $

Try this

sudo mv /var/lib/dpkg/status /var/lib/dpkg/status.old
sudo touch /var/lib/dpkg/status
sudo dpkg --configure -a
sudo apt-get update
apt-cache search python3-serial

the result off all 5 commands:

pi@emonpi:~ $ sudo mv /var/lib/dpkg/status /var/lib/dpkg/status.old
pi@emonpi:~ $ sudo touch /var/lib/dpkg/status
pi@emonpi:~ $ sudo dpkg --configure -a
pi@emonpi:~ $ sudo apt-get update
Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:2 http://archive.raspberrypi.org/debian buster InRelease
Reading package lists... Done
pi@emonpi:~ $ apt-cache search python3-serial
pi@emonpi:~ $

I have just noticed something. try this (note apt rather than apt-get)

sudo apt update
pi@emonpi:~ $ sudo apt update
Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:2 http://archive.raspberrypi.org/debian buster InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
pi@emonpi:~ $

and

apt-cache search python3-serial
pi@emonpi:~ $ apt-cache search python3-serial
pi@emonpi:~ $

Oh for crying out loud :angry:.

This is really weird!

yes, terrible, some errors are indeed not amusing and taking a lot of the brain energy aka headache :face_with_head_bandage:.

Can there be something else wrong regarding the undervoltage
or the sd card (burned flash memory?) because I’m using two emontx devices with some 40 sensors?:

I don’t think so,I see the undervoltage messages occasionally on all my Pis

You don’t run any firewalls or proxies that could be silently blocking it?

Just to put things back please

sudo cp /var/lib/dpkg/status.old /var/lib/dpkg/status

Won’t solve the problem though.

That could be the problem.
Very strange is that port 63712 and 63713 and 443 are assigned to the rapsberry pi ip-address for port sharing.

What is the port number that should be open for updating?

no idea.

I checked the proxy and firewall, but there are no restrictions that I can find.
The only thing after restarting thats also is showing is a LSB / DHCP error:

“Failed to start LSB: DHCP server”

pi@emonpi:~ $ systemctl status isc-dhcp-server.service
● isc-dhcp-server.service - LSB: DHCP server
   Loaded: loaded (/etc/init.d/isc-dhcp-server; generated)
   Active: failed (Result: exit-code) since Mon 2020-06-29 11:34:20 BST; 3min 6s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 584 ExecStart=/etc/init.d/isc-dhcp-server start (code=exited, status=1/FAILURE)

Jun 29 11:34:18 emonpi dhcpd[632]: bugs on either our web page at www.isc.org or in the README file
Jun 29 11:34:18 emonpi dhcpd[632]: before submitting a bug.  These pages explain the proper
Jun 29 11:34:18 emonpi dhcpd[632]: process and the information we find helpful for debugging.
Jun 29 11:34:18 emonpi dhcpd[632]:
Jun 29 11:34:18 emonpi dhcpd[632]: exiting.
Jun 29 11:34:20 emonpi isc-dhcp-server[584]: Starting ISC DHCPv4 server: dhcpdcheck syslog for diagnostics. ... failed!
Jun 29 11:34:20 emonpi isc-dhcp-server[584]:  failed!
Jun 29 11:34:20 emonpi systemd[1]: isc-dhcp-server.service: Control process exited, code=exited, status=1/FAILURE
Jun 29 11:34:20 emonpi systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.
Jun 29 11:34:20 emonpi systemd[1]: Failed to start LSB: DHCP server.
pi@emonpi:~ $

Yes ignore that.

Because it was to difficult I started all over again with rewriting the sd card and updating all (at least 10min waiting before reboot like for wifi).
And by importing the backup.

to be continued …

Emonhub is running again, a green light :-).
But all inputs are missing still from both emontx.
How can I check what the values should be for “base id” and port baud rate that’s now set to “38400”?

2019-10-17 10:33:47,945 INFO     MainThread Creating EmonHubJeeInterfacer 'RFM2Pi' 
2019-10-17 10:33:47,947 DEBUG    MainThread Opening serial port: /dev/ttyAMA0 @ 38400 bits/s
2019-10-17 10:42:24,985 INFO     MainThread EmonHub emonHub emon-pi variant v2.1.2
2019-10-17 10:42:24,985 INFO     MainThread Opening hub...
2019-10-17 10:42:24,986 INFO     MainThread Logging level set to DEBUG
2019-10-17 10:42:24,986 INFO     MainThread Creating EmonHubJeeInterfacer 'RFM2Pi' 
2019-10-17 10:42:24,988 DEBUG    MainThread Opening serial port: /dev/ttyAMA0 @ 38400 bits/s
2019-10-17 10:42:26,991 WARNING  MainThread Device communication error - check settings
2019-10-17 10:42:26,992 INFO     MainThread Setting RFM2Pi frequency: 433 (4b)
2019-10-17 10:42:27,994 INFO     MainThread Setting RFM2Pi group: 210 (210g)
2019-10-17 10:42:28,997 INFO     MainThread Setting RFM2Pi quiet: 0 (0q)
2019-10-17 10:42:29,999 INFO     MainThread Setting RFM2Pi baseid: 5 (5i)