ble<=>ip #6245
Replies: 1 comment
-
Posted at 2020-04-14 by @gfwilliams At the moment there really isn't anything existing that can do IP over BLE in the way you want. However I did come up with something for MQTT which may help? https://github.com/gfwilliams/MQTToBLE Posted at 2020-04-14 by BobFrankston Thanks. I'll look at it. Posted at 2020-04-14 by @MaBecker Wow, cool stuff, have to try it. Posted at 2020-04-14 by Moray I'm working on an mqtt to bluetooth project. At the moment I'm using your espruinohub, Gordon, and nodered but I plan to switch to trying out nodered's contrib BLE module Posted at 2020-04-14 by BobFrankston Suggestions for an MQTT server (AKA broker?)? Ideally, one that is in readable JavaScript? (Oops -- seems to include a server -- will learn more so ignore this. (How do I delete an entry?) Posted at 2020-04-17 by BobFrankston I tried some of the examples at https://googlechrome.github.io/samples/web-bluetooth/index.html and while I could get some to work it was discouraging since, alas, Bluetooth wants to do me favors and builds in application knowledge. This is why I want more generic connectivity. I will look more into the MQTT approach but I still want to find a simple way to do an app that makes an IP connection, fetches data, and displays it. Posted at 2020-04-17 by Moray MQTT with message retention is a pretty easy way to do this. Messages sent from Espruino’s TinyMQTT module have retention set by default. This is a good choice if you can easily have IP at both ends and you can have a slightly beefier box as a server. A Pi2 is fine. Posted at 2020-04-17 by BobFrankston Thanks. At this point, my main interest is a simple broker/server. I looked and found https://www.npmjs.com/package/aedes and going to see how easy it is. NodeRed seems to be a tool for managing the message flows atop the brokers.
Posted at 2020-04-17 by BobFrankston What do I need to do to use it with the BangeJS? I have the server setup but get "no compatible device" so I presume there is a simple step beyond pairing with my PC. Posted at 2020-04-19 by Moray By “it “ what do you mean? There is a tutorial here which I started with. https://www.espruino.com/BLE+Node-RED Here’s a simple breakdown of the general steps you need, I won’t have time (sorry!) to spell them all out in detail
If you are a decent programmer you can skip NodeRed and build your own program on the server to subscribe to the MQTT messages and respond directly. It is more complicated to handle sending data to the Bangle, and advertising is by far the simplest mechanism. Posted at 2020-04-19 by BobFrankston I'm making progress. I took I'm also running the server from https://www.npmjs.com/package/aedes. I was getting
So I installed EspruinoHub on one of my pi's and it found a lot of Bluetooth devices but I'm still getting the error message. Is there good reference doc I can use to understand this from scratch since the examples have lots of additional complexity. Posted at 2020-04-20 by @gfwilliams "Can't update BLE services until restart" on the Espruino? All it means is you're connected via Bluetooth, and it can't change the services while you're connected. The second you disconnect it'll realise and will change them :) Posted at 2020-04-20 by BobFrankston I've made progress but not there. I installed to flash and disconnected. I eventually got the Espruin hub running on my pi to see the BangleJS but only if I placed it near the pi. No such problems with my pixl. But I'm not seeing the advertising message (Hello World). I do urge having a WiFi option in the future. It needn't use much power if it is off much of the time and used to send messages rather than listening all the time. And would have far fewer such issues. The limitations of BLE such as a single connection and the lack of preinstalled support is an issue. This is why I made sure Windows got TCP/IP preinstalled and with DHCP rather than forcing users to do it themselves. In the interim, it would be great to have a use case of a serial stream to an IP address (via TCP) and/or UDP. If I had that then the rest becomes very easy. As an FYI, I tried using the IDE on the pi it offered the BangleJS but never finished connecting. Posted at 2020-04-21 by @gfwilliams So you're not using MQTToBLE at all, just
Thanks. I guess it might be related to espruino/EspruinoHub#41 ?
I have the Espruino WiFi boards but the issue with something like Bangle.js is just the chipset used. It's a big undertaking to rewrite the WiFi/Bluetooth stack for a whole new device - and the kind of chipsets available are often capable of running Linux/Android - which is the sensible choice for internet stuff if your device is capable of it. BLE has always been on the edge of offering IPv6 over BLE and having support built into routers. Several routers ship with it and it would have just been a firmware update to turn it on - unfortunately that doesn't really seem to have happened :( Posted at 2020-04-21 by BobFrankston Yes, trying to use as little mechanism as I can to narrow things down. I did install gadgetbridge but, again, too much static friction so haven't connected to it. I understand why you chose BLE in this case. Indeed, my goal is for IP (4 or 6 don't matter for this purpose) over BLE. I wanted to get some hands-on experience before taking it up with the Bluetooth SIG. This is a full topic in its own right and I write about such issues in my column. Is the BLE radio in the Bangle very short range? I'm about 2 meters from the particular pi. Is that too far? To test I just replaced the battery in the puck and it shows up (-80 vs the pixel at -87) It is paired with my PC but I presume there is a difference between connected/disconnected and if I disconnect from the browser it should become available. IDE -- I sometimes get a connection hang on the PC too and futz (to use the technical term) till somehow it connects. This latest test I brought the BJS to the pi and it immediately adds itself to the list with the puck and pixel but failed to connect. And then, after a refresh, I get no ports found Not sure how much time I'll have to experiment with this (though, alas, I find myself trying one more thing). I might reach out to the BLE world for a better understanding. Posted at 2020-04-21 by @gfwilliams
It's not amazing I'm afraid - I think the case gets in the way, and the aerial isn't as good as the Puck/Pixl ones.
It depends - it's worth checking in the OS if you had something like HID enabled the OS will tend to keep the connection open. If you did have HID enabled in the Bangle settings that could explain a lot of the instability connecting though...
I'd be very interested in this. It actually struck me that you could use a similar method to MQTToBLE to do something like an AT-command interface to a bridge. It's a bit hacky but at least it's all 'off the shelf'. Posted at 2020-04-21 by BobFrankston Where do I find the HID settings for Windows 10? As to IP/BLE -- I'll continue to explore as a background project. Posted at 2020-04-22 by @gfwilliams
I meant in the Bangle.js settings on the Bangle itself. The default is off, but if it's turned on windows will stay connected because it thinks it's a keyboard. But the signal strength of the Bangle isn't great. Bangle->Bangle I'm seeing about 2 meters max :( Posted at 2020-04-22 by BobFrankston I'm going to try to avoid spending too much time on this today but I figured I'd give it a try on my pi4a running 64 bit Ubuntu so I could use Visual Studio but it failed on bleno -- bindRaw "No such device". I'm also pursuing my BLE (human) connections. Posted at 2020-04-22 by BobFrankston Before I forget, this is a copy of the watch app https://1drv.ms/u/s!AglBpbKyzKIQj-VErqGWfcFj_sjaKA?e=UGAOUY which is just the same date/time app plus the sample BT advertising code and some cleanup to use ES5 constructs. It's possible that the code itself has a problem though I tried to keep the Bluetooth portion intact. Posted at 2020-04-23 by @gfwilliams Nice! So that one is for MQTToBLE, rather than EspruinoHub? EspruinoHub expects normal advertising, so won't be compatible with MQTToBLE (yet) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-04-14 by BobFrankston
I see a lot of mechanisms in GadgetBridge and WebBLE.
I'm looking for the simplest way to do IP over the BLE connection that I can install on any platform and connect to when I'm in range. The apps can then view it through the lens of IP (albeit with limits on the amount of traffic).
If it exists (including via GB/WB) what is the simplest path to getting up to speed? If not, I may prototype it with a browser app but it would be limited to https or as a shim via WebSockets.
Beta Was this translation helpful? Give feedback.
All reactions