Avatar for MyBlueBoo

MyBlueBoo

Member since Dec 2016 • Last active Aug 2017
  • 3 conversations
  • 16 comments

Most recent activity

  • in Puck.js
    Avatar for MyBlueBoo

    Ok .. something definitely to do with the driver because this pops up in the logs:

    [Tue Aug 22 14:49:26 2017] Bluetooth: hci0 command 0x200c tx timeout
    [Tue Aug 22 14:49:28 2017] Bluetooth: hci0 command 0x200c tx timeout
    [Tue Aug 22 14:49:37 2017] Bluetooth: hci0 command 0x200c tx timeout
    [Tue Aug 22 14:49:39 2017] Bluetooth: hci0 command 0x200c tx timeout
    [Tue Aug 22 14:49:45 2017] Bluetooth: hci0 command 0x200c tx timeout
    [Tue Aug 22 14:49:47 2017] Bluetooth: hci0 command 0x200c tx timeout
    [Tue Aug 22 14:50:00 2017] Bluetooth: hci0 command 0x0c1a tx timeout
    [Tue Aug 22 15:01:30 2017] Bluetooth: hci0 command 0x200c tx timeout
    [Tue Aug 22 15:01:32 2017] Bluetooth: hci0 command 0x200c tx timeout
    [Tue Aug 22 15:01:34 2017] Bluetooth: hci0 command 0x200c tx timeout
    [Tue Aug 22 15:01:36 2017] Bluetooth: hci0 command 0x200c tx timeout
    [Tue Aug 22 15:01:51 2017] Bluetooth: hci0 command 0x0c1a tx timeout
    [Tue Aug 22 15:12:17 2017] Bluetooth: hci0 command 0x200c tx timeout
    [Tue Aug 22 15:12:19 2017] Bluetooth: hci0 command 0x200c tx timeout
    [Tue Aug 22 15:12:22 2017] Bluetooth: hci0 command 0x200c tx timeout
    [Tue Aug 22 15:12:24 2017] Bluetooth: hci0 command 0x200c tx timeout
    [Tue Aug 22 15:21:07 2017] Bluetooth: hci0 command 0x200c tx timeout
    [Tue Aug 22 15:21:09 2017] Bluetooth: hci0 command 0x200c tx timeout
    [Tue Aug 22 15:22:25 2017] usbcore: deregistering interface driver
    btusb [Tue Aug 22 15:22:25 2017] Bluetooth: hci0 urb ffff9b81a786e6c0
    failed to resubmit (2) [Tue Aug 22 15:22:49 2017] usbcore: registered
    new interface driver btusb [Tue Aug 22 15:22:49 2017] Bluetooth: hci0:
    Firmware revision 0.1 build 82 week 37 2016 [Tue Aug 22 15:25:24 2017]
    Bluetooth: hci0 command 0x200c tx timeout [Tue Aug 22 15:25:26 2017]
    Bluetooth: hci0 command 0x200c tx timeout [Tue Aug 22 15:25:43 2017]
    Bluetooth: hci0 command 0x0c1a tx timeout [Tue Aug 22 15:27:35 2017]
    Bluetooth: hci0 command 0x0c1a tx timeout [Tue Aug 22 15:29:45 2017]
    Bluetooth: hci0 command 0x200c tx timeout [Tue Aug 22 15:29:47 2017]
    Bluetooth: hci0 command 0x200c tx timeout

    I'll chat to the bluetooth subsystem guys see if I can get a definitive answer to what is going on.

  • in Puck.js
    Avatar for MyBlueBoo

    Yeah the phone stays connected ok it seems. At least enough to upload the sketches a few times changing the LED number.

    Well this is an Intel Bluetooth module. (8087:0a2b) so should be pretty well supported. Restarting the bluetooth will show the puck again and connect but then it will drop after a while. I was repeatedly sending Puck.getBatteryPercentage() and I did that for about 11 times every 2 or so seconds. Then I got to typing the the example sketch

    var on = false;
    =false
    setInterval(function() {on =!on; LED1.write(on); }, 500);
    Press Ctrl-C again to exit

    I literally got to the last char and then pressed return and nada. It became unresponsive so I had to Cntrl-C it.

    I shall investigate if there are some tweaks for my bluetooth connection. Because it does seem whatever happened it has become worse ;)

    Thanks for the help.

  • in Puck.js
    Avatar for MyBlueBoo

    Yeah, well that seems to have gotten us a little closer. Look what verbose revealed.

    espruino --list --verbose
    0.0.33 Espruino Command-line Tool 0.0.33
    -----------------------------------

    Acorn library not found - you'll need it for compiled code Found
    /usr/local/lib/node_modules/espruino/lib­s/targz.js Found
    /usr/local/lib/node_modules/espruino/lib­s/utf8.js Found
    /usr/local/lib/node_modules/espruino/esp­ruino.js Found
    /usr/local/lib/node_modules/espruino/cor­e/codeWriter.js Found
    /usr/local/lib/node_modules/espruino/cor­e/config.js Found
    /usr/local/lib/node_modules/espruino/cor­e/env.js Found
    /usr/local/lib/node_modules/espruino/cor­e/flasher.js Found
    /usr/local/lib/node_modules/espruino/cor­e/modules.js Found
    /usr/local/lib/node_modules/espruino/cor­e/notifications.js Found
    /usr/local/lib/node_modules/espruino/cor­e/serial.js Found
    /usr/local/lib/node_modules/espruino/cor­e/serial_audio.js Found
    /usr/local/lib/node_modules/espruino/cor­e/serial_chrome.js Found
    /usr/local/lib/node_modules/espruino/cor­e/serial_noble.js 'noble'
    module couldn't be loaded, no node.js Bluetooth Low Energy { [Error:
    Cannot find module 'bluetooth-hci-socket'] code: 'MODULE_NOT_FOUND' }
    Found /usr/local/lib/node_modules/espruino/cor­e/serial_nodeserial.js
    No 'serialport' module found Found
    /usr/local/lib/node_modules/espruino/cor­e/serial_socket.js No
    chrome.sockets - serial_socket disabled Found
    /usr/local/lib/node_modules/espruino/cor­e/serial_web_bluetooth.js No
    navigator.bluetooth - Web Bluetooth not enabled Found
    /usr/local/lib/node_modules/espruino/cor­e/serial_websocket.js Found
    /usr/local/lib/node_modules/espruino/cor­e/serial_winnus.js 'winnus'
    module not found, no Windows Bluetooth Low Energy { [Error: Cannot
    find module 'winnus'] code: 'MODULE_NOT_FOUND' } Found
    /usr/local/lib/node_modules/espruino/cor­e/settingsAbout.js Found
    /usr/local/lib/node_modules/espruino/cor­e/status.js Found
    /usr/local/lib/node_modules/espruino/cor­e/terminal.js Found
    /usr/local/lib/node_modules/espruino/cor­e/utils.js Found
    /usr/local/lib/node_modules/espruino/plu­gins/_examplePlugin.js Found
    /usr/local/lib/node_modules/espruino/plu­gins/assembler.js Found
    /usr/local/lib/node_modules/espruino/plu­gins/boardJSON.js Found
    /usr/local/lib/node_modules/espruino/plu­gins/compiler.js Found
    /usr/local/lib/node_modules/espruino/plu­gins/getGitHub.js Found
    /usr/local/lib/node_modules/espruino/plu­gins/localModules.js Found
    /usr/local/lib/node_modules/espruino/plu­gins/minify.js Found
    /usr/local/lib/node_modules/espruino/plu­gins/npmModules.js Found
    /usr/local/lib/node_modules/espruino/plu­gins/saveOnSend.js Found
    /usr/local/lib/node_modules/espruino/plu­gins/setTime.js Found
    /usr/local/lib/node_modules/espruino/plu­gins/uiMode.js Found
    /usr/local/lib/node_modules/espruino/plu­gins/unicode.js Found
    /usr/local/lib/node_modules/espruino/plu­gins/versionChecker.js
    Initialising CodeWriter Initialising Config Initialising Env
    Initialising Flasher Initialising Modules Initialising Notifications
    Initialising Serial Initialising SettingsAbout Initialising Status
    Initialising Utils Initialising ExamplePlugin Initialising Assembler
    Initialising BoardJSON Initialising Compiler Initialising GetGitHub
    Initialising LocalModules Initialising Minify Initialising NPMModules
    Initialising SaveOnSend Initialising SetTime Initialising UiMode
    Initialising Unicode Initialising VersionChecker Searching for serial
    ports... PORTS:

    Turns out that both noble and bluetooth-hci-socket both need to be installed globally as well:

    npm -g install noble bluetooth-hci-socket

    espruino --list Espruino Command-line Tool 0.0.33
    -----------------------------------

    PORTS: f8:37:bb:11:74:a7 (Puck.js 74a7)

    Woo Hoo! Now finally it connects. At least long enough to get Battery status.

    espruino --verbose -p f8:37:bb:11:74:a7
    0.0.33 Espruino Command-line Tool 0.0.33
    -----------------------------------

    Acorn library not found - you'll need it for compiled code Found
    /usr/local/lib/node_modules/espruino/lib­s/targz.js Found
    /usr/local/lib/node_modules/espruino/lib­s/utf8.js Found
    /usr/local/lib/node_modules/espruino/esp­ruino.js Found
    /usr/local/lib/node_modules/espruino/cor­e/codeWriter.js Found
    /usr/local/lib/node_modules/espruino/cor­e/config.js Found
    /usr/local/lib/node_modules/espruino/cor­e/env.js Found
    /usr/local/lib/node_modules/espruino/cor­e/flasher.js Found
    /usr/local/lib/node_modules/espruino/cor­e/modules.js Found
    /usr/local/lib/node_modules/espruino/cor­e/notifications.js Found
    /usr/local/lib/node_modules/espruino/cor­e/serial.js Found
    /usr/local/lib/node_modules/espruino/cor­e/serial_audio.js Found
    /usr/local/lib/node_modules/espruino/cor­e/serial_chrome.js Found
    /usr/local/lib/node_modules/espruino/cor­e/serial_noble.js Found
    /usr/local/lib/node_modules/espruino/cor­e/serial_nodeserial.js No
    'serialport' module found Found
    /usr/local/lib/node_modules/espruino/cor­e/serial_socket.js No
    chrome.sockets - serial_socket disabled Found
    /usr/local/lib/node_modules/espruino/cor­e/serial_web_bluetooth.js No
    navigator.bluetooth - Web Bluetooth not enabled Found
    /usr/local/lib/node_modules/espruino/cor­e/serial_websocket.js Found
    /usr/local/lib/node_modules/espruino/cor­e/serial_winnus.js 'winnus'
    module not found, no Windows Bluetooth Low Energy { [Error: Cannot
    find module 'winnus'] code: 'MODULE_NOT_FOUND' } Found
    /usr/local/lib/node_modules/espruino/cor­e/settingsAbout.js Found
    /usr/local/lib/node_modules/espruino/cor­e/status.js Found
    /usr/local/lib/node_modules/espruino/cor­e/terminal.js Found
    /usr/local/lib/node_modules/espruino/cor­e/utils.js Found
    /usr/local/lib/node_modules/espruino/plu­gins/_examplePlugin.js Found
    /usr/local/lib/node_modules/espruino/plu­gins/assembler.js Found
    /usr/local/lib/node_modules/espruino/plu­gins/boardJSON.js Found
    /usr/local/lib/node_modules/espruino/plu­gins/compiler.js Found
    /usr/local/lib/node_modules/espruino/plu­gins/getGitHub.js Found
    /usr/local/lib/node_modules/espruino/plu­gins/localModules.js Found
    /usr/local/lib/node_modules/espruino/plu­gins/minify.js Found
    /usr/local/lib/node_modules/espruino/plu­gins/npmModules.js Found
    /usr/local/lib/node_modules/espruino/plu­gins/saveOnSend.js Found
    /usr/local/lib/node_modules/espruino/plu­gins/setTime.js Found
    /usr/local/lib/node_modules/espruino/plu­gins/uiMode.js Found
    /usr/local/lib/node_modules/espruino/plu­gins/unicode.js Found
    /usr/local/lib/node_modules/espruino/plu­gins/versionChecker.js
    Initialising CodeWriter Initialising Config Initialising Env
    Initialising Flasher Initialising Modules Initialising Notifications
    Initialising Serial

    • Initialising Serial Noble Initialising SettingsAbout Initialising Status Initialising Utils Initialising ExamplePlugin Initialising
      Assembler Initialising BoardJSON Initialising Compiler Initialising
      GetGitHub Initialising LocalModules Initialising Minify Initialising
      NPMModules Initialising SaveOnSend Initialising SetTime Initialising
      UiMode Initialising Unicode Initialising VersionChecker Connecting to
      'f8:37:bb:11:74:a7' noble starting scan Port "f8:37:bb:11:74:a7" not
      found - checking ports again (2 attempts left) noble starting scan
      Found UART device: Puck.js 74a7 f8:37:bb:11:74:a7 noble stopping scan
      BT> Connecting BT> Connected Connected {} BT> Sending "\n" Received a
      prompt after sending newline... good!
      >>> Sending...
      ---> "\u0010console.log(\"<\",\"<<\",JSON.str­ingify(process.env),\">>\",\">\")\n"
      BT> Sending "\u0010console.log(\"<" BT> Sending "\",\"<<\",JSON.str"
      BT> Sending "ingify(process." BT> Sending "env),\">>\",\">\")\n"
      >>> Sent Got "< << {\"VERSION\":\"1v93\",\"BUILD_DATE\":\"A­ug 21 2017\",\"BUILD_TIME\":\"15:32:25\",\"GIT­_COMMIT\":\"7237347960825c8a36d706e3bc1d­cfa60e3caedc\",\"BOARD\":\"PUCKJS\",\"CH­IP\":\"NRF52832\",\"CHIP_FAMILY\":\"NRF5­2\",\"FLASH\":524288,\"RAM\":65536,\"SER­IAL\":\"852140da-3f75e857\",\"CONSOLE\":­\"Bluetooth\"}
      >> >\r\n>" Loading http://www.espruino.com/json/PUCKJS.json­ Board JSON loaded Firmware >1.43 supports faster writes over USB Set Slow Write =
      false FIRMWARE: Current 1v93, Available 1v93 Connected BT> Sending
      "\r"

    =undefined

    BT> Sending "Puck.getBatteryPerce" BT> Sending "ntage()" Puck.getBatteryPercentage()BT> Sending "\r"

    =100

    But wait a few seconds and it becomes unresponsive again :(

    =100

    BT> Sending "\r"

    It does not even say timed out or anything. Just becomes unresponsive when I type anything.

    Weird.

  • in Puck.js
    Avatar for MyBlueBoo

    Yes I did use Google Chrome on my phone. However after a restart of my phone it seemed to work. That is I was able to connect to it using Chrome WebIDE and upload the sample sketch. Which I have not been able to do for a while now. Trouble is it is VERY fiddly trying to type anything via the phone.

    I have rebooted my laptop 'just in case'. No joy.

    Ironically enough I did just install npm install espruino there are a few slight modifications you need to use for Debian though. The package is called nodejs as is the resultant binary. Still I did run sudo setcap cap_net_raw+eip $(eval readlink -fwhich nodejs) and that seemed fine. You then need to link node to nodejs ln -s /usr/bin/nodejs /usr/bin/node However espruino --list just gives me

    espruino --list
    Espruino Command-line Tool 0.0.33

    -----------------------------------

    PORTS:

    Which does not bode well. Oddly enough it still sees the puck when scanning for it in the browser. So not sure what is going on here.

  • in Puck.js
    Avatar for MyBlueBoo

    Please could you install the cutting edge Puck.js build from here: http://www.espruino.com/binaries/travis/­master/

    So I flashed the espruino_1v93_puckjs.zip 2017-08-21 16:32 263K

    md5sum: bbec17e5f851057ffb2214bf5c5ec145 espruino_1v93_puckjs.zip

    Reset it like you suggested till all 3 LEDs lit but now I seem unable to connect to it via the IDE from both the laptop and the phone now!? I can connect to it via nRFTool box and this is what I get back from the limited log.

    nRF Connect, 2017-08-22 Puck.js 74a7 (F8:37:BB:11:74:A7)
    V 10:03:34.757 Connecting to F8:37:BB:11:74:A7... D 10:03:34.758 gatt
    = device.connectGatt(autoConnect = false, TRANSPORT_LE) D 10:03:35.342 [Callback] Connection state changed with status: 0 and
    new state: CONNECTED (2) I 10:03:35.343 Connected to F8:37:BB:11:74:A7
    D 10:03:35.343 [Broadcast] Action received:
    android.bluetooth.device.action.ACL_CONN­ECTED
    V 10:03:35.361 Discovering services...
    D 10:03:35.361 gatt.discoverServices() D 10:03:35.746 [Callback]
    Services discovered with status: 0 I 10:03:35.749 Services discovered
    V 10:03:35.790 Generic Access (0x1800)

    • Device Name R W
    • Appearance R
    • Peripheral Preferred Connection Parameters R
    • Central Address Resolution R Generic Attribute (0x1801) Nordic UART Service (6e400001-b5a3-f393-e0a9-e50e24dcca9e)
    • TX Characteristic N    Client Characteristic Configuration (0x2902)
    • RX Characteristic W WNR V 10:03:42.473 Reading all characteristics... V 10:03:42.473 Reading
      characteristic 00002a00-0000-1000-8000-00805f9b34fb
      D 10:03:42.473 gatt.readCharacteristic(00002a00-0000-10­00-8000-00805f9b34fb)
      V 10:03:42.503 Reading characteristic
      00002a01-0000-1000-8000-00805f9b34fb
      D 10:03:42.503 gatt.readCharacteristic(00002a01-0000-10­00-8000-00805f9b34fb)
      I 10:03:42.504 Read Response received from
      00002a00-0000-1000-8000-00805f9b34fb, value: (0x)
      50-75-63-6B-2E-6A-73-20-37-34-61-37, "Puck.js 74a7"
      A 10:03:42.504 "Puck.js 74a7" received V 10:03:42.539 Reading
      characteristic 00002a04-0000-1000-8000-00805f9b34fb
      D 10:03:42.539 gatt.readCharacteristic(00002a04-0000-10­00-8000-00805f9b34fb)
      I 10:03:42.539 Read Response received from
      00002a01-0000-1000-8000-00805f9b34fb, value: (0x) 00-00
      A 10:03:42.539 "[0] Unknown" received I 10:03:42.578 Read Response
      received from 00002a04-0000-1000-8000-00805f9b34fb, value: (0x)
      06-00-10-00-00-00-90-01 A 10:03:42.578 "Connection Interval: 7.50ms -
      20.00ms, Slave Latency: 0, Supervision Timeout Multiplier: 400" received V 10:03:42.579 Reading characteristic
      00002aa6-0000-1000-8000-00805f9b34fb
      D 10:03:42.579 gatt.readCharacteristic(00002aa6-0000-10­00-8000-00805f9b34fb)
      V 10:03:42.633 4 characteristics read I 10:03:42.633 Read Response
      received from 00002aa6-0000-1000-8000-00805f9b34fb, value: (0x) 01
      A 10:03:42.633 "Address resolution supported" received
      D 10:03:55.244 wait(400) D 10:03:55.645 wait(1200)
      V 10:04:26.147 Enabling services... V 10:04:26.147 Enabling
      notifications for 6e400003-b5a3-f393-e0a9-e50e24dcca9e
      D 10:04:26.148 gatt.setCharacteristicNotification(6e400­003-b5a3-f393-e0a9-e50e24dcca9e,
      true)
      D 10:04:26.151 gatt.writeDescriptor(00002902-0000-1000-­8000-00805f9b34fb,
      value=0x0100) I 10:04:26.190 Data written to descr.
      00002902-0000-1000-8000-00805f9b34fb, value: (0x) 01-00
      A 10:04:26.190 "Notifications enabled" sent
      V 10:04:26.200 Notifications enabled for
      6e400003-b5a3-f393-e0a9-e50e24dcca9e V 10:04:26.200 All services
      enabled V 10:04:35.524 Reading remote RSSI...
      D 10:04:35.524 gatt.readRemoteRssi() I 10:04:35.539 Remote RSSI
      received: -56 dBm

    Does that help at all?

  • in Puck.js
    Avatar for MyBlueBoo

    No joy alas. Even with Chrome it does the same

    .

    For the record I am using Debian 9.0 (testing) Kernel 4.12.0-1 and bluetoothd is 5.45

    Like I say though, it is not just my laptop that seems to have problems keeping a connection my phone does too. A Samsung S7.

    Now the odd thing is that before on an older firmware I did not seem to have such problems but of course that was a few months back so hard to say what has changed.

    Anyway to debug BLE connections? I would be curious to know if it is the Puck dropping the connection or the computer.

    Thanks.

  • in Puck.js
    Avatar for MyBlueBoo

    Did the reset and seemed ok for a minute but then just disconnected again and went back to being erratic. What I find different is the fact I keep on having to hit pair with the device when it disconnects even though it is a saved connection. (you can see in the video is show it as (paired) but asks to pair again.

    Not sure what is going on here. But seems the my phone is also dropping the connection to the puck not just my laptop.

    Odd.

  • in Puck.js
    Avatar for MyBlueBoo

    Yeah.. so changed battery managed to upgrade firmware to 1.93 now though I seem unable to connect to it.

    Hmmm.

    Unable to Connect

  • in Puck.js
    Avatar for MyBlueBoo

    You may be right.. Not sure. But I see the green LED looks very weak. (see video) Would be nice if there was some way to determine the battery voltage externally. Hey ho.

    Edit: won't let me upload the video. Here is a link to it instead.

    Puck-JS bootloader problem

Actions