Bangle.http() when in WebIDE #5528
Replies: 1 comment
-
Posted at 2022-12-29 by user140377 Did you consider using this relay? https://forum.espruino.com/conversations/381841/ Posted at 2022-12-30 by drmercer That works, thanks! The relay is a little slow, but I am able to make http requests from the IDE now. I had to connect in this specific order, in case that helps anyone else:
(I couldn't connect the relay to the watch without first disconnecting the watch from Gadgetbridge, presumably because the watch isn't in "pairing" mode when it is connected to Gadgetbridge.) Some downsides: There is a lot of console noise in the desktop IDE, presumably from Gadgetbridge doing too much for the watch to handle (I see Also, if the relay disconnects (such as if my phone goes to sleep), then I have to start all over. 🙁 Another solution I found that I might try (at least while developing) is checking the connected Bluetooth address using Posted at 2023-01-06 by @gfwilliams Glad you got something working! I've been considering adding the Relay capability into the App Loader itself, which could then be run from within Gadgetbridge and would avoid a lot of this messing around I think?
End of last year I got flow control into Gadgetbridge, so while it's not in the play store version, nightlies, or the next Play Store release should have the FIFO_FULL fixed.
You could also fork the Web IDE yourself: https://github.com/espruino/EspruinoWebIDE Then I think it might be possible to modify the emulator code quite easily look at the data that is sent from the emulated Bangle (https://github.com/espruino/EspruinoWebIDE/blob/master/emu/common.js#L187) and implement the HTTP request yourself? However when running in a browser you're limited by CORS |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2022-12-29 by drmercer
Hi,
I just got a Bangle.js 2 for Christmas. I'm excitedly tinkering with it and enjoying it so far! One pain point I've run into is that
Bangle.http()
doesn't work (always times out) when connected to the WebIDE, since that function uses Gadgetbridge to make the actual request. This makes it a rather clunky process to develop code that uses that function - I have to make the changes in WebIDE, upload it to Bangle, disconnect the IDE, connect to Gadgetbridge, wait for GB to be ready for http requests, and then hope it works correctly because debugging will be difficult if it doesn't. 😅 Would it be possible to make the WebIDE recognize and answer (some subset of) GB commands from Bangle?Beta Was this translation helpful? Give feedback.
All reactions