• I cant send a write command to the puck:

    <Config> Config loaded
    <MQTT> Connecting...
    <HTTP> Server is listening on 1888
    <MQTT> Connected
    <HTTPProxy> Bleno State poweredOn
    <HTTPProxy> Bleno.startAdvertising Success
    <HTTPProxy> Bleno.setServices Success
    <Discover> Starting scan...
    <Discover> Scanning started.
    <MQTT> /ble/write/e9:05:8c:a7:64:ab/nus/nus_tx => "digitalPulse(LED3, 1, 200);\n"
    <Discover> Scanning stopped.
    <Connect> e9:05:8c:a7:64:ab: Connecting...
    <Connect> e9:05:8c:a7:64:ab: Error Connecting: Error: Command Disallowed (0xc)
    <Discover> Scanning started.
    

    I only found this information:
    https://github.com/sandeepmistry/noble/i­ssues/658

    I had a look into the EspruinoHub code and i saw that the scanning is interruptet if a write message needs to be sent.

    /* Write to the given device */
    exports.write = function(device, service, characteristic, data) {
      if (isBusy) {
        queue.push(function() { exports.write(device,service,characteris­tic,data); });
        return;
      }
      isBusy = true;
      getConnectedDevice(device, function(err, connection) {
        if (err) return setNotBusy();
    
        connection.getCharacteristic(util.uuid2n­oble(service), 
                                     util.uuid2noble(characteristic),
         function(err,char) {
           if (err) return setNotBusy();;
           writeToCharacteristic(char, util.obj2buf(data), function() {
               log(connection.name+": Written.");
               setNotBusy();
             });
         });
      });
    };
    

    and

    function serviceQueue() {
      if (!queue.length) {
        if (connections.length==0) // no open connections
          discovery.restartScan();
        return;
      }
      if (connections.length < MAX_CONNECTIONS) {
        var job = queue.shift();
        discovery.stopScan();
        setTimeout(job, 1000);  
      }
    }
    
    function setNotBusy() {
      isBusy = false;
      serviceQueue();
    }
    

    Can it still be related to the dongle i use?

About

Avatar for werty1st @werty1st started