The QR code pop up window for the bitcoinSwitch shows the status of the websocket connection between the LNbits server and the web browser. Unfortunately you can't see directly if the connection to the device is working. But you could indirectly see if the connection to the ESP32 is established. This is done by counting and displaying the number of active websocket connections of the LNURLdevice instance. If there is only one, then that is probably the active connection of the web page to the LNbits server. But if two are shown, then there is a high probability that the second connection is the one to the bitcoinSwitch. This would indirectly give you the possibility to check the connection.
Example - QR Code pop up windows:
In the following screnshot of a LNbits server log you can see the first connection of the ESP32 that was connected. The second is the QR code pop up window. Both times there is a "connection open". If I disconnect the ESP32 or leave the page with the pop up window, then both times there is also a "connection closed".
Is it possible to sum up the number of active websocket connections of a LNURLdevice instance and display them in the pop up window?
The QR code pop up window for the bitcoinSwitch shows the status of the websocket connection between the LNbits server and the web browser. Unfortunately you can't see directly if the connection to the device is working. But you could indirectly see if the connection to the ESP32 is established. This is done by counting and displaying the number of active websocket connections of the LNURLdevice instance. If there is only one, then that is probably the active connection of the web page to the LNbits server. But if two are shown, then there is a high probability that the second connection is the one to the bitcoinSwitch. This would indirectly give you the possibility to check the connection.
Example - QR Code pop up windows:
In the following screnshot of a LNbits server log you can see the first connection of the ESP32 that was connected. The second is the QR code pop up window. Both times there is a "connection open". If I disconnect the ESP32 or leave the page with the pop up window, then both times there is also a "connection closed".
Is it possible to sum up the number of active websocket connections of a LNURLdevice instance and display them in the pop up window?