-
• #2
-
• #3
Hi @Robin
I had not in fact read that page and those referenced by that page. I have done so now - and will do so again in more detail, however, either I'm still misunderstanding something or I phrased my question poorly.
I understand that I can host a page or pages on a website on a public url - but I need to access that page from a BT enabled device while I am in range of the puck for this to work.
I'm trying to understand how I can get or send data to the puck from a url on the public web while I am not within BT range of the puck. i.e. it's truly remote (let's say the puck is at home, I am in the office and I want to know the temperature or light reading from the puck).
The puck itself cannot connect to my home WiFi for example - so how do I "bridge" the connection so that my puck has internet access?
Thanks a lot for your speedy response earlier - much appreciated.
Cheers
-
• #4
Sun 2021.10.17
Thank you @user135414 for clarifying:
https://www.espruino.com/Gadgetbridge
http://forum.espruino.com/conversations/341437/ -
• #5
Hi,
The puck itself cannot connect to my home WiFi for example - so how do I "bridge" the connection so that my puck has internet access?
Realistically right now there's EspruinoHub which you mentioned. With that you can either:
- use an MQTT server that is accessible outside
- Use the 'http proxy' service on it - which is extremely limited: http://www.espruino.com/BLE+HTTP+Proxy
There is however also https://blecon.net/ which does pretty much exactly what you want using an old phone as a bridge. I'm not 100% sure if it's freely available yet, but they do have a good Espruino implementation.
Finally Robin mentioned Gadgetbridge, and while right now that doesn't support sending data to the internet, as part of the Bangle.js 2 kickstarter I will be adding that functionality, so hopefully by the end of the year you'll just be able to use Gadgetbridge.
There are other options like using ESPHome or rolling your own, but maybe they're not quite as flexible
- use an MQTT server that is accessible outside
-
• #6
Hi Gordon
Thanks to you (and Robin) for the responses. I appreciate all the feedback and the speed of reply.
I'm looking forward to seeing the updated implementation of GadgetBridge to support sending the request(s) to the internet.
Will this be limited to only working on the Bangle.js 2 or will the original Bangle.Js also be able to make use of this feature?
Cheers
PS: Blecon looks like a great alternative in the meantime, thanks for pointing me in their direction!
-
• #7
Will this be limited to only working on the Bangle.js 2
No - the idea is actually to ensure it works with all bluetooth Espruino devices :)
-
• #8
I have the puck in a public room downstairs. Since I cannot access it from the 3rd floor (out of bluetooth range) I have placed an old iPhone in a locked room close to the puck. This phone has access to wifi and internet. When I open my website with the phone, it connects through WebBLE to the puck (just like the electricity meter example). I have added some Javascript (infinite loop) to the website which calls an URL (XMLHttpRequest) once a day passing data from the Puck-object. This works quite well. However, if the connections is lost (for whatever reason), I'll have to walk downstairs, refresh the website to reconnect to the puck. Still have to see how often this will be the case.
-
• #9
You might be able to make the website force a reconnect if the connection fails?
-
• #10
Yeah, well, but it needs a human input to reconnect. Since I am not near the phone below and there is no way to remotely control an iPhone ... I'll have to walk downstairs.
-
• #11
but it needs a human input to reconnec
You're using the
Puck.js
library I guess? Maybe that could be improved, because Web Bluetooth itself shouldn't need human input to reconnect (just to choose the device in the first place) -
• #12
Oh, really? Yes I am using this library. That would be quite an improvement! Unfortunately, I don't know how to do this ...
-
• #13
Hello :)
I'm watching this with interest - I'm hoping to be able to get the Bangle.js I got for my birthday this year to do everything I've been able to do on the (sadly now ailing) Pebble Time it's intending to replace... being able to control home automation from my wrist via my mobile is a must for me.
Cheers and happy 2022 :)
Hi Folks
I know that the puck and Bangle (and others) can be accessed and programmed via BLE on a BLE capable device and that they don't have a WiFi stack. However I'm confused as to how I can "bridge" a connection so that a puck (for example) could report something from a sensor (such as light or temperature) to a website sitting on the public internet.
Or being able to call a url on the public internet (such as IFTT or Zapier) to trigger other workflows based on the puck's sensor data?
I get that I can host an Espruino Hub on a raspberry Pi 3 which would give me control in the sense that I have a web server running on my local network - but would I be able to forward/proxy an HTTP request to another domain (again on the public internet) or is there an easier, simpler method to accomplish this?
Appreciate any help or directions...
Cheers