konnected-io / konnected-security

Konnected connects wired sensors and switches to SmartThings, Home Assistant, Hubitat and OpenHAB
https://konnected.io
Apache License 2.0
416 stars 322 forks source link

v2.3.0 boot freeze on NTP sync failure #105

Closed LouPaloma closed 4 years ago

LouPaloma commented 4 years ago

Hooking up to a serial port monitor I see the boot messages:

Konnected firmware 2.3.0 NodeMCU 2.2.0.0 build 20190805 powered by Lua 5.1.4 on SDK 2.2.1(6ab97e9) 
Heap: 41744 Initializing Konnected (dc4f2218ef45) 
Heap: 40680 Application Version: 2.3.0 
Heap: 39528 Connecting to Wifi.. > 
Heap: 42248 Wifi connected with IP: 172.16.x.x Gateway: 172.16.x.x
Heap: 40984 Time sync failed! 

There are no further messages and the device does not respond to the status endpoint.

As you can see the WIFI connection is set and the information is verified correct via nmap.

NOTE: MY SECURITY SYSTEM IS ON A PRIVATE NETWORK AND DOES NOT, _BYDESIGN, HAVE INTERNET ACCESS. I do have an NTP server on the network as well, but the device doesn't have that information configured. Time sync failure should not prohibit firmware boot, yes?

Providing Internet access is not an option.

heythisisnate commented 4 years ago

I confirmed that this is an issue. Thanks for reporting this @LouPaloma

In 2.3.0 I added a step to the boot sequence to sync the current time via NTP. It will first ask the gateway's IP (typically your router) for the current time, and then fall back to time.google.com and pool.ntp.org. If all three of these fail, the device fails to boot.

This is actually a fairly critical bug because if there's a internet outage and the device reboots, it may get stuck in this failed state and never recover.

heythisisnate commented 4 years ago

This is fixed in release 2.3.1

LouPaloma commented 4 years ago

Confirmed fix is working.

K-MTG commented 4 years ago

Is it possible to preform an OTA update? Or will it be available soon?

eduardojacr commented 4 years ago

It's possible to do it OTA. I already did it. Make sure the Konnected app is updated. They updated today. Regards Jorge

On Sat, Sep 21, 2019, 11:56 AM K-MTG notifications@github.com wrote:

Is it possible to preform an OTA update? Or will it be available soon?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/konnected-io/konnected-security/issues/105?email_source=notifications&email_token=AJVLNNW7Q53WWK4XCHO4F4LQKZN6RA5CNFSM4IW4HCDKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7IWS5Y#issuecomment-533817719, or mute the thread https://github.com/notifications/unsubscribe-auth/AJVLNNVHSBTCTGYLTWSD6E3QKZN6RANCNFSM4IW4HCDA .

heythisisnate commented 4 years ago

Yes, if you've already manually flashed 2.3.0, you can OTA update to the 2.3.1 update containing this fix via the new Konnected mobile app.

It's available for Android here: https://play.google.com/store/apps/details?id=io.konnected.konnected

An iOS version should be hitting the App Store next week (pending approval by Apple).

KScottTerry commented 4 years ago

Hi Nate, the OTA update was flawless and easy, (I like easy.) I watched the Nodes blue light blink a few times and after the suggested minute I refreshed. I checked and noticed the software updated to 2.3.1 but no numbers changed in the firmware; 2.3.0 . Please pardon my confusion, but I thought I read [somewhere] this was a firmware update, am I right? Just confirming the update was a success. Screenshot_20190929-070107_Konnected (3)

heythisisnate commented 4 years ago

Yes, this is correct. Only the Konnected software (application code) can be updated OTA. The "firmware" refers to the underlying os built on NodeMCU-firmware and it hasn't changed.

On Sun, Sep 29, 2019, 8:12 AM Scott Terry notifications@github.com wrote:

Hi Nate, the OTA update was flawless and easy, (I like easy.) I watched the Nodes blue light blink a few times and after the suggested minute I refreshed. I checked and noticed the software updated to 2.3.1 but no numbers changed in the firmware; 2.3.0 . Please pardon my confusion, but I thought I read [somewhere] this was a firmware update, am I right? Just confirming the update was a success. [image: Screenshot_20190929-070107_Konnected (3)] https://user-images.githubusercontent.com/35048105/65832390-65a12500-e288-11e9-91d1-834b5925fe77.jpg

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/konnected-io/konnected-security/issues/105?email_source=notifications&email_token=AAAC54AM5SAHZYAQ2QJDPRTQMCLRDA5CNFSM4IW4HCDKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD73TAKI#issuecomment-536293417, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAC54CZSVOIANSCYZ2C5TTQMCLRDANCNFSM4IW4HCDA .

dsaul560 commented 4 years ago

I can't find the iOS version of the app. Is that out yet? When is the MQTT update coming? Can't wait! lol Thanks!

Bwiestenberg commented 4 years ago

After flashing to the latest firmware and file system, the nodemcu chip is unresponsive. Instead of a flashing blue LED and the wifi signal showing up when searched for, I now get a blue led that flashes once then is solid on the whole time. I've downloaded the firmware and filesystem over to eliminate errors, and have reflashed the chips multiple times, with the same results. I selected erase all data when re flashing as well.

heythisisnate commented 4 years ago

This is not a support forum. Issues unrelated to the topic of this bug will not be addressed here.