The Pi can now be pinged via its new hostname (ohpi) or its new static IP address (192.168.1.10). I can access OpenHAB’s admin interface using either http://ohpi:8080 or http://192.168.1.10:8080. Perfect!
However, FireMotD continues to report the Pi’s IP address is the old one: 192.168.1.115. Why?
On line 223 of /opt/FireMotD/FireMotD there’s script to determine the IP address. The relevant portion is this: /sbin/ip route get 8.8.8.8 | head -1 | awk -F' ' '{print $(NF)}'
When executed, the command correctly reports 192.168.1.10 and not 192.168.1.115. So why is FireMotD reporting the old IP address?
How long have you been waiting since you changed your IP Address? I did the same when I installed my openhab and as you, FireMotD didn’t show the right IP address. After some research I found out that FireMotD runs once per day (between 12:00 and 06:00 if I recall properly) and updates its logs. If you login BEFORE FireMotD runs, it will report false information.
If you wanna update that information right now, execute the following command:
/opt/FireMotD/FireMotD –S
This command will update its internal log file (that you can find at /var/tmp/FireMotD.json) and the information displayed will be the right one.
@dcalvo
Thank you for your reply. Unfortunately the suggested solution (update information with /opt/FireMotD/FireMotD -S) did not correct the problem.
[18:19:30] openhabian@ohpi:~$ /opt/FireMotD/FireMotD –S
/opt/FireMotD/FireMotD: line 1850: break: only meaningful in a `for', `while', or `until' loop
OK, I don’t know why it produced that response but it did. Anyway, I then ran FireMotD (without -S) and it reported the old IP address:
– EDIT –
My apologies it appears you were correct! I ran it again but this time with sudo FireMotD and it definitely updated its JSON file with the new IP address. Thank you!
Yes, that’s the same as what I have in my /etc/cron.d/firemotd. I changed the IP address late in the afternoon so, as you explained, FireMotD would not detect my modification until its next update after midnight (or if I run it manually with the -S option).
Thanks again, I’ve marked your response as the solution.