You are reading a single comment by @werty1st and its replies. Click here to read the full conversation.
  • Hi,

    i try to send some IR Codes via nodered + mqtt + puck to turn on my soundbar on chromecast activity.

    msg.payload =  [ 8.9111328125, 4.5166015625, 0.48828125, 0.6103515625, 0.48828125, 1.77001953125, 0.48828125, 0.6103515625, 0.48828125, 1.77001953125, 0.48828125, 1.77001953125, 0.45776367187, 1.77001953125, 0.48828125, 0.6103515625, 0.48828125, 1.77001953125, 0.45776367187, 0.64086914062, 0.48828125, 0.64086914062, 0.48828125, 0.6103515625, 0.48828125, 0.64086914062, 0.48828125, 0.64086914062, 0.48828125, 1.73950195312, 0.48828125, 0.64086914062, 0.48828125, 1.73950195312, 0.48828125, 0.64086914062, 0.48828125, 0.6103515625, 0.48828125, 1.77001953125, 0.48828125, 1.77001953125, 0.45776367187, 0.64086914062, 0.48828125, 0.6103515625, 0.48828125, 1.77001953125, 0.48828125, 0.6103515625, 0.54931640625, 1.708984375, 0.48828125, 1.77001953125, 0.45776367187, 0.64086914062, 0.48828125, 0.6103515625, 0.48828125 ];
    

    Topic:

    /ble/write/e9:05:8c:a7:64:ab/BCDE/ABCE
    

    The Problem is that the EspruinoHub crashes after it receives the message:

    <MQTT> /ble/write/e9:05:8c:a7:64:ab/BCDE/ABCE => "[8.9111328125,4.5166015625,0.48828125,0­.6103515625,0.48828125,1.77001953125,0.4­8828125,0.6103515625,0.48828125,1.770019­53125,0.48828125,1.77001953125,0.4577636­7187,1.77001953125,0.48828125,0.61035156­25,0.48828125,1.77001953125,0.4577636718­7,0.64086914062,0.48828125,0.64086914062­,0.48828125,0.6103515625,0.48828125,0.64­086914062,0.48828125,0.64086914062,0.488­28125,1.73950195312,0.48828125,0.6408691­4062,0.48828125,1.73950195312,0.48828125­,0.64086914062,0.48828125,0.6103515625,0­.48828125,1.77001953125,0.48828125,1.770­01953125,0.45776367187,0.64086914062,0.4­8828125,0.6103515625,0.48828125,1.770019­53125,0.48828125,0.6103515625,0.54931640­625,1.708984375,0.48828125,1.77001953125­,0.45776367187,0.64086914062,0.48828125,­0.6103515625,0.48828125]"
    <Discover> Scanning stopped.
    <Connect> e9:05:8c:a7:64:ab: Connecting...
    <Connect> Connected.
    <Connect> e9:05:8c:a7:64:ab: Getting Service...
    <Connect> e9:05:8c:a7:64:ab: found service: bcde
    <Connect> e9:05:8c:a7:64:ab: found characteristic: abce
    /home/pi/EspruinoHub/lib/util.js:36
        buf.writeUInt8(o.charCodeAt(i), i);
                         ^
    
    TypeError: o.charCodeAt is not a function
        at Object.exports.obj2buf (/home/pi/EspruinoHub/lib/util.js:36:22)­
        at /home/pi/EspruinoHub/lib/connect.js:193:­41
        at /home/pi/EspruinoHub/lib/connect.js:63:9­
        at Service.<anonymous> (/home/pi/EspruinoHub/node_modules/noble­/lib/service.js:53:7)
        at Object.onceWrapper (events.js:315:30)
        at emitOne (events.js:116:13)
        at Service.emit (events.js:211:7)
        at Noble.onCharacteristicsDiscover (/home/pi/EspruinoHub/node_modules/noble­/lib/noble.js:261:13)
        at emitThree (events.js:136:13)
        at NobleBindings.emit (events.js:217:7)
    

    If i send the hole command as a string to /ble/write/e9:05:8c:a7:64:ab/nus/nus_tx it works.

    So i'm questioning what are the limitations for self defined Services?
    Can i send the IR Codes that way?

    How "looks" the evt.data Object of the onWrite function?
    How can one read that console.log as long as the puck is connected to the IDE?

    onWrite : function(evt) { // optional
            console.log("Got ", evt.data);
          }
    

    Thank you very much.

About

Avatar for werty1st @werty1st started