-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion: Universal websockets API for bitcoinSwitch #8
Comments
Damn, I overlooked this. Its a good idea, we should add |
i like the concept |
I have tested the commit lnbits/paymentsocketjson once. Unfortunately, it did not recognize withdrawals, but deposits via an invoice were often, but not always recognized. Here is a deposit that was also reported to the ESP32 via websocket. You can see that quite well on the PaymentHash. And here a deposit which was not reported to ESP32. And this is what a payment to an external wallet looks like. But unfortunately the ESP32 does not get this. |
How big is you json file on the esp? |
Also try testing on an online websocket tester |
I tested and it seems to work fine for incoming, outgoiing is not working though |
Yes, I can confirm that. Only outgoing transactions are not signalled by the WebSocket. |
Then maybe I have a problem with my LNbits instance. Maybe the idea of using Python 3.10 wasn't that good, or something didn't go 100% correctly during the installation. I think I'll set it up again and then use Python 3.9. |
Ok, I did a fresh LNbits instance with pyhton 3.9 and I now alle deposits are reported. Then the problem with the invoice listener might be a problem ob my pyhton 3.10 instance. I now checkt alle three functions Only deposit triggers the ESP32 I also tested the Websocket for me there are deposit and LNURLp was working. @btchans Can you confirm my that?. Why does LNURLp not trigger the ESP32? |
I can confirm. |
Is it possible to monitor an entire LNbits wallet and whenever a change in wallet balance occurs, trigger an ESP32 via a websockets connection and pass at least the wallet balance?
This would make us independent of the type of payment. No matter if it was a LNURLp, LNURLw or even a payment initiated by another extension, the evaluation can then be done via the ESP32. This would give a much wider scope and simplify the LNbits side. You could write a separate program for each function. Or one writes a comprehensive program with many functions and lets the user select / parameterize the functions later via a web interface. The function of the bitcoinSwitch would be universally applicable.
One could write the program then also in MircoPython with e.g. Thonny. That would extend the Nuterbasis again enormously. It would increase the felxibilität, since one would not have to adapt for each function or change the mother ship LNbits / LNURLDevice. You get an incredible felxibility on the ESP32 side.
With polling, querying the wallet balance is already possible now, but this is not the right way for mass application. If thousands of bitcoinSwitch later poll the server every second, that's a big load. Therefore the way over a websocket API which transmits at least the balance when the wallet balance changes. If possible, even the information whether it is a LNURLp, LNURLw or whatever is possible. The more information, the more options and functions on the EPS32 side.
Is it possible to program such an API?
The text was updated successfully, but these errors were encountered: