Theengs Gateway Rebooting Constantly

I am just getting around to re-deploying my gateway to handle some plant sensors. I found it rebooting or staying offline so just re-flashed it to 1.8.0.

Here are the relevant looking parts of the logs. I couldn’t really find anything in GitHub or here, thinking “Passive continuous scanning required” might be a clue.

Any ideas?

N: BT Device detected: 5B:9D:3E:20:91:DF
N: [ OMG->MQTT ] topic: home/omg_apartment/BTtoMQTT/494207002582 msg: {"id":"49:42:07:00:25:82","name":"tps","rssi":-84,"brand":"Inkbird","model":"T(H) Sensor","model_id":"IBS-TH1/TH2/P01B/ITH-12S","type":"THB","tempc":2.49,"tempf":36.482,"extprobe":false,"batt":53} 
N: BT Device detected: EF:62:DC:25:81:C2

W: Name too long, truncating
N: Passive continuous scanning required, paramaters adapted
Guru Meditation Error: Core  1 panic'ed (Double exception). 

Core  1 register dump:
PC      : 0x400957d2  PS      : 0x00040836  A0      : 0x800d8724  A1      : 0x3ffec250  
A2      : 0xffffffff  A3      : 0x00000020  A4      : 0x00000000  A5      : 0x3ffec3bc  
A6      : 0x00ff0000  A7      : 0xff000000  A8      : 0x40080080  A9      : 0x3ffec350  
A10     : 0x00060a36  A11     : 0x00040026  A12     : 0x00000000  A13     : 0xffffffff  
A14     : 0x50004f4d  A15     : 0x50004f4d  SAR     : 0x00000004  EXCCAUSE: 0x00000002  
EXCVADDR: 0xffffffe0  LBEG    : 0x400923d1  LEND    : 0x400923e1  LCOUNT  : 0xfffffff7  


Backtrace: 0x400957cf:0x3ffec250 0x400d8721:0x3ffec270 0x400957cf:0x3ffec290 0x400957cf:0x3ffec2d0 0x400957cf:0x3ffec2f0 0x400957cf:0x3ffec310 0x400957cf:0x3ffec330 0x400957cf:0x3ffec350 0x4008007d:0x3ffec250 0x4009b74d:0x3ffec270 0x400957cf:0x3ffec290 0x400957cf:0x3ffec2d0 0x400957cf:0x3ffec2f0 0x400957cf:0x3ffec310 0x400957cf:0x3ffec330 0x400957cf:0x3ffec350 0x4008007d:0x3ffec250 0x4009b74d:0x3ffec270 0x400957cf:0x3ffec290 0x400957cf:0x3ffec2d0 0x400957cf:0x3ffec2f0 0x400957cf:0x3ffec310 0x400957cf:0x3ffec330 0x400957cf:0x3ffec350 0x4008007d:0x3ffec250 0x4009b74d:0x3ffec270 0x400957cf:0x3ffec290 0x400957cf:0x3ffec2d0 0x400957cf:0x3ffec2f0 0x400957cf:0x3ffec310 0x400957cf:0x3ffec330 0x400957cf:0x3ffec350 0x4008007d:0x3ffec250 0x4009b74d:0x3ffec270 0x400957cf:0x3ffec290 0x400957cf:0x3ffec2d0 0x400957cf:0x3ffec2f0 0x400957cf:0x3ffec310 0x400957cf:0x3ffec330 0x400957cf:0x3ffec350 0x4008007d:0x3ffec250 0x4009b74d:0x3ffec270 0x400957cf:0x3ffec290 0x400957cf:0x3ffec2d0 0x400957cf:0x3ffec2f0 0x400957cf:0x3ffec310 0x400957cf:0x3ffec330 0x400957cf:0x3ffec350 0x4008007d:0x3ffec250 0x4009b74d:0x3ffec270 0x400957cf:0x3ffec290 0x400957cf:0x3ffec2d0 0x400957cf:0x3ffec2f0 0x400957cf:0x3ffec310 0x400957cf:0x3ffec330 0x400957cf:0x3ffec350 0x4008007d:0x3ffec250 0x4009b74d:0x3ffec270 0x400957cf:0x3ffec290 0x400957cf:0x3ffec2d0 0x400957cf:0x3ffec2f0 0x400957cf:0x3ffec310 0x400957cf:0x3ffec330 0x400957cf:0x3ffec350 0x4008007d:0x3ffec250 0x4009b74d:0x3ffec270 0x400957cf:0x3ffec290 0x400957cf:0x3ffec2d0 0x400957cf:0x3ffec2f0 0x400957cf:0x3ffec310 0x400957cf:0x3ffec330 0x400957cf:0x3ffec350 0x4008007d:0x3ffec250 0x4009b74d:0x3ffec270 0x400957cf:0x3ffec290 0x400957cf:0x3ffec2d0 0x400957cf:0x3ffec2f0 0x400957cf:0x3ffec310 0x400957cf:0x3ffec330 0x400957cf:0x3ffec350 0x4008007d:0x3ffec250 0x4009b74d:0x3ffec270 0x400957cf:0x3ffec290 0x400957cf:0x3ffec2d0 0x400957cf:0x3ffec2f0 0x400957cf:0x3ffec310 0x400957cf:0x3ffec330 0x400957cf:0x3ffec350 0x4008007d:0x3ffec250 0x4009b74d:0x3ffec270 0x400957cf:0x3ffec290 0x400957cf:0x3ffec2d0 0x400957cf:0x3ffec2f0 0x400957cf:0x3ffec310 0x400957cf:0x3ffec330 0x400957cf:0x3ffec350 0x4008007d:0x3ffec250 0x4009b74d:0x3ffec270 0x400957cf:0x3ffec290 0x400957cf:0x3ffec2d0 0x400957cf:0x3ffec2f0 |<-CONTINUES




ELF file SHA256: f4911d60e6c69306

Rebooting...
ets Jul 29 2019 12:21:46

Hi @alfista2600

While I’m not too sure and knowledgable about the actual error output, and someone else might need to look into stateBTMeasures(bool), the logged

N: Passive continuous scanning required, paramaters adapted

(I think we should also fix the typo in that log message :wink: )

in dictates that a device has been received which would require passive continuous scanning - like a BLE motion, contact or button sensor. If you only want to receive and decode your plant sensors, this would not be required at all and would actually be overkill to do continuous scanning.

So if this is the case you might want to use the white-list functionality to only receive the plant sensors, and the device which caused the continuous passive scanning setting should not be picked up any longer and hopefully not cause any reboots.

Let us know how you get on.

Thanks for the reply. I did have whitelisting going before starting from scratch, and intend to have some contact/motion sensors as well. I’ll white list the plant sensors for now and start small. I hope I can get the MQTT command to it before the reboot!

I wonder which already existing device, either of yourself or possibly some neighbour, Mit cause this passive continuous scanning request.

because the white-list command needs to be sent as a retained MQTT command it should be retained on the MQTT broker and sent to the gateway again every time it starts up again, so it should definitely be sticking with every startup of the gateway and be registered :slight_smile:

Remembered this right after I hit submit!

Once you have the white-list hopefully preventing the reboots, you might also want to change the interval settings to a more appropriate 1 minute or so, and the scan duration to something like 10 seconds again.

Just make sure that any further commands will need to have the retain flag turned off.

I just had a few minutes to try, and no luck. I can get a whitelist with a single whitelisted device I know is online and I can see that it detected it, but it panics after a variety of different addresses.

N: BT Device detected: CF:EX:XB:XX:XB:XE
N: BT Device detected: XX:FX:XE:XC:XX:FC
N: BT Device detected: XX:XD:XX:XX:XE:DX
N: [ OMG->MQTT ] topic: home/omg_apartment/BTtoMQTT/XXXDXXXXXEDX msg: {“id”:“XX:XD:XX:XX:XE:DX”,“name”:“Qingping Motion & Light”,“rssi”:-XX}
N: BT Device detected: XX:CB:CX:EX:XX:XB
N: BT Device detected: XX:XX:XX:XE:XX:CX
N: BT Device detected: EX:FX:XX:XX:XE:XX
N: Active and continuous scanning required, paramaters adapted
Guru Meditation Error: Core 1 panic’ed (Double exception).

does a fresh install via usb and the web installer return all settings to default, other than those persisted via MQTT?

Can you also make sure that adaptivescan is false, but this shouldn’t really have happened if you only have one plant sensor in the white-list, as this was caused by the Qingping Motion & Light, which shouldn’t have been published if it’s not in the white-list.

Are you sure you published the white-list correctly to the correct topic and with the proper payload? E. g. did you swap the example default OpenMQTTGateway with the gateway name of your particular gateway?

Yes, if you make sure that erase flash is ticked, but adaptivescan will be true as a default,

The whitelist was correct and applied correctly, but I forgot to make sure it was just a plant sensor. Sorry - quick lunch test. That device had been in my whitelist previously, is currently online and in range, and used to be working. I just saw that it was broadcasting so made it the only whitelisted item.

I changed to only whitelist a plant sensor that is not currently in range, but am still having the error. I also re-flashed and erased/reset all settings from the captive portal.

N: Scan begin
N: BT Device detected: XF:XX:XX:EX:BX:XX
N: BT Device detected: FX:XX:XX:BX:XX:XD
N: BT Device detected: FX:XX:XD:XB:XX:XX
N: BT Device detected: XF:EX:XX:CC:FX:XX
N: BT Device detected: XA:BE:BX:XC:XD:BX
N: BT Device detected: XX:XC:CA:FB:XX:AX
N: BT Device detected: XX:XX:AX:XF:XX:XX
N: BT Device detected: EX:FX:XX:XX:XE:XX
N: Active and continuous scanning required, paramaters adapted
Guru Meditation Error: Core  1 panic'ed (Double exception). 

FWIW - I did another fresh install, erasing flash, and set it to a new mqtt name so it wouldn’t pick up any retained data, and it crashes immediately.

The only last thing I can currently think of is

• Which binary did you install, and on which kind of board?

Theengs-bridge on a bridge manufactured 8/23 - so I assume it is not a v11.

Hello,

If it is a Theengs Bridge TBRIDGE01 you should take theengs-bridge environment.
For TBRIDGE02 you should take theengs-bridge-v11.

Once you have the good binary installed configure it with WiFi (without Ethernet first) and let me know if it still crashes at start.
If not you can connect it after to ethernet.

1 Like

Brought it to my office this morning, which has site-to-site VPN back to my house. Just re-flashed and erased, used a new MQTT topic and it works just fine. No whitelisted items. I’ll bring it home in an hour and see if something crashes it there. It is a TBRIDGE01 which is the firmware I’ve used all along, and I have only connected via wifi.

Without changing anything after having it working at home, plugging it in and watching the serial logging, the device panics at home within 30 seconds.

Could it be wifi? Any ideas?

Any debugging firmware I can install that might help? Seems a bit nuts that a BT device can crash the gateway. @1technophile @DigiH

not that it is a huge test, but I installed 1.8.0 on a M5Stick and it also crashes…

Do you know which BLE device generate the issue ?

Unless I am reading the logs incorrectly, it appears to be a different device most times. Of five, two devices appears to cause it twice. Maybe the truncating has something to do with it? The model of the three devices that appear to cause the reboot are down below - two motion sensors and an ibeacon.

I can test in two locations in my house - each about 60 feet away from each other and it crashes in both locations.

N: BT Device detected: DA:3F:3X:2X:CF:55

N: BT Device detected: 4X:4X:0X:0X:2X:DF
N: BT Device detected: 6X:BB:7X:2X:5C:75

N: BT Device detected: FX:CB:8X:2X:2C:A6
N: Active and continuous scanning required, paramaters adapted
Guru Meditation Error: Core  1 panic'ed (Unhandled debug exception). 

...

N: BT Device detected: FX:3X:6D:6B:6X:06
N: BT Device detected: 6A:DA:2X:DX:8X:FA
N: BT Device detected: 7X:0E:6X:3C:6C:4C
N: BT Device detected: 4X:CB:CX:AD:5E:63
N: BT Device detected: 5X:2D:3X:6X:5X:6C
W: Name too long, truncating
N: Passive continuous scanning required, paramaters adapted
Guru Meditation Error: Core  1 panic'ed (Double exception). 

...

N: BT Device detected: EC:CX:CB:2C:EX:15

N: BT Device detected: 5X:2D:3X:6X:5X:6C
W: Name too long, truncating
N: Passive continuous scanning required, paramaters adapted
Guru Meditation Error: Core  1 panic'ed (Unhandled debug exception). 
Debug exception reason: Stack canary watchpoint triggered (procBLETask) 
Core  1 register dump:

...

N: BT Device detected: 5X:EX:1B:FX:3X:CB
N: BT Device detected: 7D:2C:6X:5X:4X:0B
N: BT Device detected: 5B:AX:7A:6X:1D:00
N: BT Device detected: 7X:0E:6X:3C:6C:4C
N: BT Device detected: 2X:3C:9X:1X:2X:B4

N: BT Device detected: EX:FX:5X:0X:9E:38
N: Active and continuous scanning required, paramaters adapted
Guru Meditation Error: Core  1 panic'ed (Double exception). 

...

N: BT Device detected: 4X:9D:9X:BD:EX:C6
N: BT Device detected: 4A:3C:3E:AX:FA:DF
N: BT Device detected: 5X:EX:1B:FX:3X:CB
N: BT Device detected: EB:1F:AX:3X:CX:8E
N: BT Device detected: 6X:4C:DX:0X:FX:5A
N: BT Device detected: FX:CB:8X:2X:2C:A6
N: Active and continuous scanning required, paramaters adapted
Guru Meditation Error: Core  1 panic'ed (Double exception). 

A6: “W110150X-led”
6C: “uniq_id”: “5X2D3X6X5X6C-motion”
B4: “iBeacon”

Not too sure if you meant to post the B4: “iBeacon”, but what kind of device is the :38?

As the other two are both motion sensors, and you possibly don’t have any of these at the office, and if the third :38 might also be a motion/contact sensor, this could be a pointer as to where the problem might be.