OpenEVSE / openevse_wifi_server

15 stars 12 forks source link

Print IP address to LCD at startup #8

Closed glynhudson closed 5 years ago

glynhudson commented 5 years ago

Like with the ESP version it would be useful if the server could print the local IP address of the system to the LCD display at startup.

jeremypoulter commented 5 years ago

Unfortunately the local IP address is not so simple on Linux, what logic does the EmonPi use to select what the local IP is?

glynhudson commented 5 years ago

True. However on a RasPi we can assume we either need to return IP address for eth0 or wlan0

The emonPi LCD uses SIOCGIFADDR in a python script to return IP address for any interface, however we just return and display eth0 and wlan0: https://github.com/openenergymonitor/emonpi/blob/master/lcd/emonPiLCD.py#L329

We can assume if wlan0 IP address is present we should return that and if not return eth0