How to develop

BLE can be controlled from obniz.js.

You can scan, connect, manipulate characteristics, and send out advertisements.

// Javascript Full Example
// Example of a scan
var obniz = new Obniz("OBNIZ_ID_HERE");
obniz.onconnect = async function () {
  await obniz.ble.initWait();
 
  obniz.ble.scan.onfind = async function(peripheral){
    console.log(peripheral.localName)
  };
 
  obniz.ble.scan.onfinish = async function(peripherals, error){
    console.log("scan timeout!")
  };
 
  await obniz.ble.scan.startWait();
}

obniz.js runs in the browser or Nodejs, so you can choose the development method that best suits your needs You can change it.

  • Graph and remotely control the current BLE sensor values => HTML
  • I want the system to run all the time => Nodejs + Hosting