• Hello,
    I want to connect to the mdb42q from my pi and be able to send him 2 types of messages to light up 2 ciruict (let's make it simple - want to control 2 gpio "1"\"0" from the pi)

    is there a guide \ example I can follow ?

    also can I make a secure connection, meaning allow to connect only from known MAC address only?
    so only my Pi will be able to connect to the device ?

    Thanks,


    I have try this example

    var gatt;
    NRF.requestDevice({ filters: [{ name: 'PI4' }] }).then(function(device) {
      console.log("found device");
      return device.gatt.connect();
    }).then(function(g) {
      gatt = g;
      console.log("connected");
      return gatt.startBonding();
    }).then(function() {
      console.log("bonded", gatt.getSecurityStatus());
      gatt.disconnect();
    }).catch(function(e) {
      console.log("ERROR",e);
    });
    

    My pi name is PI4 - I can see it in bluetooth and ble scan from my phone
    so what is wrong? missing?

    have try namePrefix: 'PI4'
    have also try to use th service I used which is '1322' - get the same resualt

    NRF.requestDevice({ filters: [{services: ['1322'] }] }).then(function(device) {
    

    ERROR No device found matching filters

  • I want to connect to the mdb42q from my pi

    your code example is doing it the other way - from Espruino to the Pi, so which one you want and which device has GPIO connected to something?

    On Espruino side you can hook into incoming connection event and refuse any connection so you can filter by mac address even without secure connection if you wish.

    I can see it in bluetooth and ble scan from my phone
    so what is wrong?

    Try also connection over BLE from the phone (e.g. via nrfConnect), does it work? What are you next steps if connection works? How do you plan to receive GPIO toggle command on Pi side (if this is the right direction)?

About

Avatar for fanoush @fanoush started