EspruinoHub not disconnecting from device? #6516
Replies: 1 comment
-
Posted at 2021-04-14 by @gfwilliams Ahh - that's interesting. Is the device you're connecting to printing data to the console all the time? So what usually happens is the Web IDE connects and sends I wonder if having the device you're connected to sending data back to EspruinoHub causes it not to time out? Could you try stopping the device from sending anything, and see if it then auto-disconnects? Posted at 2021-04-14 by JohanWinas Yes it is always printing data to the console :-) The module polls a device over a serial port, but I need to modify the code to not print any errors when I lift the TX pin on the device. Normally it would print an error every time it timeouts. I have previously tried using the tx function in EspruinoHub to write data to a device via mqtt, I'm guessing that function will be effected by this to?? Never got it to work... Posted at 2021-04-14 by @gfwilliams Ahh, right. Well, you could just remove this single line: And it should work? Honestly I'm not sure I see much of a reason why it should be kept in, so if you find that fixes it for you let me know and I'll remove it from the main build. TX should definitely work (after all the Web IDE uses it) - maybe you could snoop MQTT (which you're doing it seems?), see what the Web IDE does, and copy that yourself and see if it works? Posted at 2021-04-14 by JohanWinas I tried with the "connection.setUsed()" commented out, but that made no difference. Will rewire my lab setup later tonight and se what happens if I make it silent. Posted at 2021-04-14 by JohanWinas So a bit more testing done.
Posted at 2021-04-15 by @gfwilliams Ok, thanks - that's interesting then. Looks like after Posted at 2021-04-15 by @gfwilliams Ok, try now - should be fixed. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2021-04-13 by JohanWinas
I just installed EspruinoHub on a Raspberry Pi 4 with node-red and an external BLE dongle with an external antenna. hciconfig shows the dongle ok.
The config for EspruinoHub points mqtt to a separate machine that only runs a mosquitto.
The web pages works fine, I can see advertisement etc etc. Ok.
Using an mqtt sub app I can see the /ble/# messages. Ok.
I start the webIDE, and it shows me the Espruino devices. Ok.
Click on a device and it connects and I can interact with the device. Ok.
Looking at the /ble/# topic on the mqtt server I get all devices messages before starting the webIDE, when the webIDE starts I only get the connected device messages. Ok.
I then click the disconnect icon, and the webIDE says disconnected :mac:. Ok.
But, looking att the /ble/# subscription I'm still getting the console messages from that device.
To get espruinoHub back to it's original state I need to stop and start it.
To me it looks like the disconnect is missed when the webIDE closes.
Beta Was this translation helpful? Give feedback.
All reactions