WiFi Rev2 stops communicating after time
I am working on an Arduino Uno WiFi Rev2 with the Nina-FW 1.4.1 loaded.
I am experiencing the following pattern every time i start the arduino and start the code (the example Peripheral -> ButtonLED with debug enabled):
- I start the Arduino (with Serial Monitor enabled)
- The connection with the central is established
- After some time (without furhter interaction) i only see
HCI COMMAND TX -> XXXXand no moreHCI EVENT RX <- XXXX - The connected() method still delivers
true, disconnect() does returnfalse - The Central gets disconnected and can no longer initiate a connection (Arduino is not visible anymore)
I did some digging and found out that the HCITransport appearently delivers a message that can not be understood (else block in HCI.ccp:153). There it prints some cryptic bytes to the console (every time the same), i attached it in the txt File. After that message the bluetooth no longer works (until i reset the arduino).
before disconnect (rssi()):
- HCI COMMAND TX -> 010514020000
- HCI EVENT RX <- 040E07050514000000BE
[byteCode]
after that (advertising):
- HCI COMMAND TX -> 010A200100
- HCI COMMAND TX -> 0106200FA000A0000000000000000000000700
- (and no return message)
Can anyone give an explanation on how to restore the bluetooth connection or catch the error somehow?
Edit: I managed to "restore Bluetooth Connectivity" by calling the reset-function. But i would prefer a cleaner solution.