'HTTP Proxy' over Bluetooth Low Energy

Posted on
  • I just came across an interesting part of the Bluetooth Low Energy spec: https://www.bluetooth.com/specifications­/gatt/viewer?attributeXmlFile=org.blueto­oth.service.http_proxy.xml

    It's pretty simplistic, but rather than allowing full IPv6 over Bluetooth Low Energy, it allows a BLE device to simply request a webpage. It actually works in the opposite way to most BLE devices: The HTTP Proxy advertises itself as an HTTP proxy, and then the device itself connects to that proxy and requests a webpage.

    It's the kind of thing that could be implemented quite easily with Puck.js. Not only that, but a Puck.js could even be used for the Proxy itself!

    To me, this seems like a pretty neat idea - it's extremely simple, but would be perfect for the kind of HTTP/HTTPS POST requests that most IoT things need. Unlike IPv6 support, it's not using any battery power at all until you need to communicate.

    I've got enough stuff to keep me occupied before the Pucks ship, including adding MQTT and the proper IPv6 support I promised, but I thought I'd post this up - as it could be a pretty easy addition as a Puck.js module and some hub software (although you'd want a whitelist with it or anyone could access your network :) ).

  • I am not familiar with bt (le), but messing with puck.js (and reading a lot of resources and asking -noob- questions) could change this.

    The main interface with the puck is sending commands to the js interpreter on the puck and receive ouput back. This is done in a chrome brower on a device with bt (le).

    Can this be done simultainious with the puck requesting webpages and posting sensordata via a bluetooth internet gateway (bt theter) on the same phone I use to send commands the puck?

    And can it be done the same time when the puck has open sockets listening to the internet (with IPv6 stack)?

    Also curious if a library will be available to send a file / data from the puck over bluetooth (le) to an android phone without any custom apps.

    So for my orchard application (other post) I could send the data to my android phone automaticly as an file when my phone is near, or could use the http proxy to send it through my phone to a custom Internetserver collecting the data, or use MQTT on IPv6 to send it to a general MQTT webservice?

    And is it possible to use the battery friendly http proxy way to post it to a MQTT dashboard service?

  • Can this be done simultainious with the puck requesting webpages and posting sensordata

    Yes - however you don't specifically need HTTP for this - the Puck can act in BLE 'central' mode alongside other things, so you could post data some other way if needs be.

    can it be done the same time when the puck has open sockets listening to the internet (with IPv6 stack)?

    I'm not 100% sure about this yet because I haven't got that far along with IPv6, but from what I can tell, it seems like that will be possible.

    if a library will be available to send a file / data from the puck over bluetooth (le) to an android phone without any custom apps.

    I'm afraid it's unlikely - not because of Puck.js, but because of Android. About the closest thing might be FatBeacon, which might make it into core Android at some point. Otherwise Web Bluetooth would work if you're happy running a webpage. I'll have a Web Bluetooth library that allows you to use the UART/Console connection easily.

    So you can do all those things you suggest, apart from the BLE file transfer. I think because of the security risks, no phone maker will ever let a beacon download files to your phone unless you have an app.

  • Nice to read the possibilities are almost endless :-)

    About the file transfer, I can share a file/picture from one stock Android phone to another via Bluetooth. You have to manually accept the file on the receiving phone. Maybe the puck can mimic this (acting as a phone sharing a file via BT).

  • I think that's 'normal' Bluetooth, not Bluetooth Low Energy. It might be a feature that gets added at some point, but as you say you'll have to accept it (and on normal Android phones you also have to be in the Bluetooth menu for your phone to advertise its presence).

    I think it's unlikely it'll get added any time soon as BLE has a relatively low data rate, so file transfers take a long time (If you've ever tried to download photos from one of those Parrot mini drones you'll know what I mean).

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

'HTTP Proxy' over Bluetooth Low Energy

Posted by Avatar for Gordon @Gordon

Actions