Returning a http request to bangle js #7041
Replies: 1 comment
-
Posted at 2024-06-10 by @gfwilliams Yes, I think the issue is just that I think all you actually need is the following:
If there's an error the promise will be rejected, which will be handled by the Posted at 2024-06-19 by Guptilious @gfwilliams ah that makes more sense. Still getting my head around the promises and returns. Clearly wasn't thinking about the http request as it's own function that can be returned in the same line. Thanks for the help :) Posted at 2024-10-18 by ccchan Hi, i still cant make my banglejs2 to successfuly use bangle.http i think (as there is no useable data received). it's annoying to repeated connect and disconnect the BT because not every time it success. the threshold to use banglejs2 to use bangle.http is quite high. would you mind to help make it easier? just illustrate the HW setup: am I correct? i wanna make my banglejs2 able to grab the mini bus ETA by "GET". i really would like some help on this. thank you. any further tutorials, documents wlll helpful. thank you. Posted at 2024-10-18 by ccchan i already followed others teaching and turned on BJ GB's "internet connection" function etc. btw i did searched that some weather app do use bangle.http, after that, cursor + api documents + AI will help. Posted at 2024-10-18 by @gfwilliams Maybe you can try using the Remote debugging to allow your Bangle to stay connected to Gadgetbridge while you run code: https://www.espruino.com/Gadgetbridge#remote-debugging Then you can see if there are any error messages when you run the command. There is an example at https://www.espruino.com/Gadgetbridge#http-requests
Note that you have to use HTTPS, not just HTTP because of Android. If you want to find other apps, literally just go to the GitHub Bangle.js repo and search for Posted at 2024-10-18 by ccchan thankyou, however for other learners, |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2024-06-09 by Guptilious
I'm currently working on getting my bangle js to send a post request to a webserver and then after a period of time, submit a get request to the webserver, to the retreive the result the first post would cause.
I've tried running a test script to confirm the watch is picking up the get data but I can't get it to display the output onto the screen.
Below is the test script I'm running which I believe should work. Also I've added the getabridge debud logs which (as I understand them) confirm I am at least getting the data from the 'get' request.
Is there an issue with my code approach to getting the output to return correctly, or is there something else I may have missed in the documentation that I need to be doing?
Apologies if it's something to do with the Promie resolution. Still trying to get my head around async functions.
Beta Was this translation helpful? Give feedback.
All reactions