IP Address showing up as date/time with a comma appended

I am running mycodo v8.15.12. I am rebuilding my system from the ground up by backing up and restoring settings from one install (with identical hardware) to the new one. Almost everything works great except for a few missing dependencies (e.g. highcharts) that I had to install manually.

One thing left is that the Generic 20x4 LCD is displaying the date and time correctly on line 0, then where I was hoping to see the IP address, it is showing the date and time again, except with a comma after it. Here is the definition of the Function:

Here is the definition of the first three lines:

Here is the resulting screen:

If this is like any of the few other issues I have had, it is that I am missing a dependency somewhere. But I have run the Diagnostic function to retrieve all dependencies. As I said before, this is a result of restoring the settings from a working system with the same hardware but somewhat older mycodo software - maybe from 6 months ago. Maybe it’s a missing library on the RPi4B?

Anyone else seen this before? Am I missing some key data to share here?

Thank you!

A reboot solved this. I have no idea why and don’t think it is worth following up on unless it is able to be replicated.

That is a strange behavior. It seems that perhaps the IP could not be acquired and it duplicated or skipped a line somehow, but I’m not sure where that comma came from. You can see the bash command to obtain an IP address is long and likely prone to failure if it doesn’t receive the appropriate response. If you have a better, more reliable, method for obtaining the IP address, I’m open to updating the modules.

1 Like

I assume that this is not reliable enough because lots of machines don’'t have hostnames?

ip_address = socket.gethostbyname(socket.gethostname())

As I said before, it started working for no reason I know of, other than a reboot. I’m happy.

Realizing that this is way too trivial as most computers probably think they’re localhost. Never mind. :slight_smile: