EspruinoHub Throws Error on Connect from Android

Posted on
  • This happens if I try and connect to it via Bluetooth from my Android phone. Maybe I'm not supposed to do that :)

    noble: unknown peripheral 746c793faf24 connected!
    
    buffer.js:491
          length += buf.length;
                       ^
    TypeError: Cannot read property 'length' of undefined
        at Function.Buffer.concat (buffer.js:491:20)
        at Smp.handlePairingConfirm (/home/pi/EspruinoHub/node_modules/noble­/lib/hci-socket/smp.js:93:21)
        at Smp.onAclStreamData (/home/pi/EspruinoHub/node_modules/noble­/lib/hci-socket/smp.js:59:10)
        at emit (events.js:117:20)
        at AclStream.push (/home/pi/EspruinoHub/node_modules/noble­/lib/hci-socket/acl-stream.js:35:10)
        at NobleBindings.onAclDataPkt (/home/pi/EspruinoHub/node_modules/noble­/lib/hci-socket/bindings.js:272:15)
        at emit (events.js:106:17)
        at Hci.onSocketData (/home/pi/EspruinoHub/node_modules/noble­/lib/hci-socket/hci.js:473:14)
        at BluetoothHciSocket.emit (events.js:95:17)
    
    

    EspruinoHub on RPi 2
    Raspbian GNU/Linux 8 (jessie)
    node --version v0.10.29

  • Could you share the code that belongs to this error?

  • @ChristianW, there's no code. It's simply the EspruinoHub running from the start script in the foreground and outputting to standard out.

    The hub properly detects my pucks (and my fitbit) and refreshes rssi every second. The hub is advertising itself also so I just tried to connect from my Galaxy S6 and boom, the errors.

    As I mentioned, maybe I wasn't supposed to do that :)

    Interestingly the EspruinoHub that I set up on my Odroid XU4 doesn't crash when I do the same thing. The connection still fails but no crash.

  • Hmm - had you followed the steps for setting up Bluetooth so that bluetoothd isn't running?

    Normally the hub can advertise, but it can't make any services public while bluetoothd is active. It might be that that's causing problems.

    I've connected to it via my phone with nRF connect here and it's worked fine - it's one of the ways I debugged it.

    It's a strange one though - looks like a crash in noble itself rather than EspruinoHub? That in itself is strange because all the stuff that handles connections via BLE should be handled in bleno.

    Maybe it's worth posting this up on the noble or bleno github pages?

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

EspruinoHub Throws Error on Connect from Android

Posted by Avatar for dklinkman @dklinkman

Actions