dzungpv / mitsubishi2MQTT

Mitsubishi to MQTT with ESP8266/ESP32 module
GNU General Public License v3.0
68 stars 13 forks source link

Possible to allow a custom NTP server? #19

Closed lrgabriel closed 7 months ago

lrgabriel commented 7 months ago

Hello! First, thank you - your fork has solved a bunch of my problems!

Second, my devices are on a VLAN with no internet access, but there is a local NTP server. Is there any possible way to specify a custom NTP server address (hopefully an IPv4 address?)

Thanks for your time!

dzungpv commented 7 months ago

Yes, it is possible, you can change the server here: https://github.com/dzungpv/mitsubishi2MQTT/blob/9c2bcdda142fff1290fbef9550f4f9214b3f510f/main/config.h#L197 and build the code, now it use pool.ntp.org server, you can use domain base NTP server with mDNS service in your VLAN, it does not support IP address: https://github.com/espressif/arduino-esp32/blob/d14873ab8a95b86c8f38ceaed01642dd2909dcb3/cores/esp32/esp32-hal-time.c#L56. I can add it to the config easy, but it is rarely use and make code more complex.

lrgabriel commented 7 months ago

Thank you!

Before I get too deep--is there any actual benefit to having accurate time on the device? Is it used for anything critical, especially if I'm not using certificate validation for MQTT?

Thanks again.

dzungpv commented 7 months ago

Thank you!

Before I get too deep--is there any actual benefit to having accurate time on the device? Is it used for anything critical, especially if I'm not using certificate validation for MQTT?

Thanks again.

No, real-time just for display date-time on the status page, without it not affect any of the core feature. Certificate validation for MQTT mean you are using secure MQTT connection otherwise it using normal MQTT, just like https and http for webserver.