Error with NTP server breaks autoexec.bat
This is my autoexec.bat:
//clearIO //Flags 0 PowerSave 1 Flags 134743044 startDriver NTP ntp_setServer fritz.box ntp_timeZoneOfs 2 waitFor NTPState 1 SetupEnergyStats 1 60 1440 1 //startDriver TuyaMCU //startDriver tmSensor mqtt_broadcastInterval 30 mqtt_broadcastItemsPerSec 30 waitFor MQTTState 1 //tuyaMcu_defWiFiState 4 //tuyaMcu_sendQueryState delay_s 5 setPinRole 6 BL0937CF setPinChannel 6 0 setPinRole 7 BL0937CF1 setPinChannel 7 0 setPinRole 8 Rel setPinChannel 8 1 setPinRole 23 WifiLED_n setPinChannel 23 0 setPinRole 24 Btn setPinChannel 24 1 setPinRole 26 BL0937SEL setPinChannel 26 0 setStartValue 0 1 setStartValue 1 1 delay_s 5 DeviceName "OpenBKsteckdoseTVwohn" DeviceShortName "OpenBKsteckdoseTVwohn" MqttHost ha.fritz.box MqttPort 1883 MqttUser MQTT //MqttPassword MqttClient OpenBKsteckdoseTVwohn MqttGroup bekens_n WiFiSsid mySSID //WiFiPass MeinWlanPasswort delay_s 5 setChannelLabel 1 SchalterOBKtvWohn delay_s 5 scheduleHADiscovery
After some time, I got this in Log:
Info:NTP:NTP_CheckForReceive: Error while receiving server's msg
normally, after NTP-Error occours, the script should continue. I noticed the problem because setChannelLabel 1 SchalterOBKtvWohn was not executed. The Name of the Switch is still "Toogle 1"
The problem is independent from Chip (Beken, BL, LN) OBK-Version is: 1.18.152
Maybe you can use "code" with line breaks to make the content better readable?
Is NTP working at all?
I ask, because you want the script to wait until NTP is synced ("waitFor NTPState 1").
Is it working when providing IP instead of name?
Maybe you can use "code" with line breaks to make the content better readable? I have done this.
Is NTP working at all? Is it working when providing IP instead of name?
Yes, with IP it is no problem. the autoexec.bat run through in this case. --> "Toggle 1" is changed to "SchalterOBKtvWohn" through setChannelLabel command
I meant a quote not for a line but the whole block, like this
//clearIO
//Flags 0
PowerSave 1
Flags 134743044
startDriver NTP
ntp_setServer fritz.box
ntp_timeZoneOfs 2
waitFor NTPState 1
....
If ever possible use IP instead of DNS names, name resolution with lwip has been a problem for quite some time also with mqtt.
For NTP, name resolution is not even "officially supported", the documentation only lists "ServerIP"