The BLE standard provides an HTTP Proxy service. If a device implements this service, it allows other BLE devices to connect to it and request Web Pages through it.
Currently the Espruino Hub software provides this service, and will run on a Raspberry Pi.
To use it:
config.json
and:http_proxy
to true
http_whitelist
section - this helps to stop unverified devices from accessing your internet connection (although it is still possible for devices to spoof your MAC address)NRF.requestDevice({ filters: [{ services: ['1823'] }] }).then(function(device) {
require("ble_http").httpRequest(device, "pur3.co.uk/hello.txt", function(d) {
print("GET:",JSON.stringify(d));
});
});
Note:
NRF.connect
to connect to a device by its address.This page is auto-generated from GitHub. If you see any mistakes or have suggestions, please let us know.