Avatar for billsalt

billsalt

Member since Jan 2017 • Last active Jul 2019
  • 19 conversations
  • 88 comments

Also known as "billsalt"
Bill Saltzstein
Code Blue Consulting/Code Blue Communications
Bluetooth and Medical Device Consultant
http://www.linkedin.com/in/billsaltzstei­n

Most recent activity

  • in Other Boards
    Avatar for billsalt

    Thank you @Gordon! REALLY appreciate your help. The code is part of a DMX lighting protocol over Bluetooth to on-stage lighting effects. The show has its final dress rehearsal tonight and I made the appropriate changes and everything is working, just in time! I'll send you some photos of the result when the show pics are posted. It will run about 80 performances over the summer. I was concerned about someone in the audience connecting and stopping the advertising which would be a show-stopper (literally).
    Thanks again! Bill

  • in Other Boards
    Avatar for billsalt

    Apologies @Gordon. It has been that kind of day for me. I was spending multitasking cycles with other projects and replicating it on a supported platform as was suggested. I wasn't aware of this specification limitation, so thank you. Interestingly, this has been eliminated for 5.0 since it is something that we actually want to do. Looks like a new softdevice to enable that capability :-{

  • in Other Boards
    Avatar for billsalt

    Hi @Gordon, I tested the following on a Pixl running released 2v01 code. It ceases to advertise. When set to true for connectable, it works fine. It is reproducible.

    Help? Bill

    //
    //  OSF Between Two Knees lighting effect translator
    //
    
    var count = 0;  // for testing
    var i = 0;
    
    // port definitions
    
    
    const DMX_length = 18;
    const DMX_channel = 0x05;
    
    
    
    var DMX_data = new Uint8Array(DMX_length);      // array to store DMX data received
    
    for (i = 0; i < DMX_data.length; i++)
    {
      DMX_data[i] = 0;
    }
    
    //
    // Initialize; set up
    //
    
    NRF.setTxPower(4);         // +4 dBM (maximum)
    NRF.setAdvertising({},{
      name: "PTG",
      interval: 30,
      connectable: false,      // change to false before deployment
      manufacturer: 0x0583,    // Code Blue Communications
      manufacturerData:[DMX_data]
    });
    
  • in Other Boards
    Avatar for billsalt

    I'm sorry that I have confused you. The first case you show does NOT work. I removed the 2nd call: I added for debugging when the simpler case did not work, but is confusing the issue.

    Anytime I turn off connectable (through either set of code) it stops advertising.

  • in Other Boards
    Avatar for billsalt

    Hi @Gordon, just to simplify; I eliminated the second setAdvertising (it was added for debugging) and went back to changing the initial setup. In the following code, when the parameter is set to true, everything works. When it is set to false, the board ceases to advertise. Please try it for yourself...

    The only other thing I'd add is that I'm uploading to flash (save on send = directly to flash).

    Thanks for checking this out.

    //
    //  OSF Between Two Knees lighting effect translator
    //
    
    var count = 0;  // for testing
    var i = 0;
    
    // port definitions
    
    const SCL = D26;
    const SDA = D25;
    const data_ready = D7;
    const DMX_length = 18;
    const DMX_channel = 0x05;
    
    // setup I2C
    I2C1.setup({ scl : SCL, sda: SDA });
    
    // change to "input" for direct CPU connection from "input_pulldown"
    pinMode(data_ready, "input");  // for switch for testing
    
    var DMX_data = new Uint8Array(DMX_length);      // array to store DMX data received
    
    for (i = 0; i < DMX_data.length; i++)
    {
      DMX_data[i] = 0;
    }
    
    //
    // Initialize; set up
    //
    
    NRF.setTxPower(4);         // +4 dBM (maximum)
    NRF.setAdvertising({},{
      name: "PTG",
      interval: 30,
      connectable: false,      // change to false before deployment
      manufacturer: 0x0583,    // Code Blue Communications
      manufacturerData:[DMX_data]
    });
    
  • in Other Boards
    Avatar for billsalt

    Hi @Gordon, I assure you I'm disconnected from the IDE. Here's a portion of the code (setup), since there's a bit more involved. If you know DMX lighting protocols, this is advertising code for DMX over Bluetooth. I've tested this with the last line commented out (turn off connectability), and there is no advertising. I've also tried changing the 'connectability' parameter in the initial setAdvertising with the same results: once I turn off conductibility, the device ceases to advertise.
    /

    /
    //  OSF Between Two Knees lighting effect translator
    //
    
    var count = 0;  // for testing
    var i = 0;
    
    // port definitions
    
    const SCL = D26;
    const SDA = D25;
    const data_ready = D7;
    const DMX_length = 18;
    const DMX_channel = 0x05;
    
    // setup I2C
    I2C1.setup({ scl : SCL, sda: SDA });
    
    // change to "input" for direct CPU connection from "input_pulldown"
    pinMode(data_ready, "input");  // for switch for testing
    
    var DMX_data = new Uint8Array(DMX_length);      // array to store DMX data received
    
    for (i = 0; i < DMX_data.length; i++)
    {
      DMX_data[i] = 0;
    }
    
    //
    // Initialize; set up
    //
    
    NRF.setTxPower(4);         // +4 dBM (maximum)
    NRF.setAdvertising({},{
      name: "PTG",
      interval: 30,
      connectable: true,      // change to false before deployment
      manufacturer: 0x0583,    // Code Blue Communications
      manufacturerData:[DMX_data]
    });
    
    NRF.setAdvertising({}, { connectable:false });
    
  • in Other Boards
    Avatar for billsalt

    Hi @Gordon,
    I'm using the espruino_2v01.10_nrf52832.hex load of firmware on a Nordic Dev board. I'm trying to turn off connectability, but keep advertising (this is a beacon application). Looking at https://www.espruino.com/BLE+Security and am using

    NRF.setAdvertising({}, { connectable:false });
    

    in my code. The device then stops advertising completely (I'm sniffing with nRFConnect to verify).

    Is there something I'm missing?

    Thanks,
    Bill

  • in Puck.js, Pixl.js and MDBT42
    Avatar for billsalt

    Thanks @gordon! I understand the aphorism is more truth than humor.

    Thanks for the pointers to the code; it does indeed look like I might be able to make a version to implement the security I want as default behavior. I'll give it a try and let you know if I'm successful. It is worth trying to use espruino to have flexibility.

    I'm using the NRF52832 dev board version and running it on an Adafruit board for a small project for a local theater. We don't want some smart patron to grab the peripheral with their phone.

    Thanks again -- Bill

Actions