• Hi there,

    So tried building EspruinoWebIDE from git and it fails because of a newer version of nodejs.

    See attached file.

    Also the Chrome app does not see my 2nd BLE adapter which is hci1. The adapter can see the PuckJS but the webide does not because it using hci0 be default.

    hcitool -i hci1 lescan
    LE Scan ...
    F8:37:BB:11:74:A7 Puck.js 74a7
    F8:37:BB:11:74:A7 (unknown)

    Any idea how to solve these problems?

    Thanks.


    1 Attachment

  • Hi - looks like like npm install worked? The winnus bit failed, but that's optional and for windows only (if anyone knows how to make it install only on windows and not fail on other platforms I'd love to know!).

    I don't think you can change chrome to use a different BLE device. You could ask @François but my guess is dealing with multiple BLE adaptors in Chrome comes quite far down their priority list :(

    If hci0 doesn't work with BLE then I'd consider trying to disable it? Chrome should then pick up the second one.

    Also - moving this to the Puck.js section of the forum.

  • The winnus bit failed, but that's optional and for windows only

    Hmm I was under the impression nodejs was cross platform. I mean what is winnus used for and is there a Linux equivalent to it I can add to the build options?

    I will see if I can convince Chrome to play nice but seems non-trivial alas.

    Thanks anyway, I put this question in Espruino because it was an IDE problem not an puck one per se. I can communicate to the puck from my phone, that is not so convienient though.

    Thanks again.

  • Re: handling multiple BT adapters,

    We've started to think about how to proceed at https://bugs.chromium.org/p/chromium/issues/detail?id=635111

    In the mean time, as suggested by @Gordon, I would simply make hci1 default for now with the select command from bluetoothctl and restart Chrome. Hopefully this will help:

    $ bluetoothctl 
    [NEW] Controller 12:34:56:12:34:56 Foo [default]
    [NEW] Controller 12:34:56:12:34:57 Bar
    [bluetooth]# list
    Controller 12:34:56:12:34:56 Foo [default]
    Controller 12:34:56:12:34:57 Bar
    [bluetooth]# select 12:34:56:12:34:57 
    [bluetooth]# list
    Controller 12:34:56:12:34:56 Foo
    Controller 12:34:56:12:34:57 Bar [default]
    
  • Yeah.. I did that.. I even managed to connect to the PuckJS using bluetoothctl.

    [bluetooth]# devices
    Device F8:37:BB:11:74:A7 Puck.js 74a7
    [bluetooth]# connect F8:37:BB:11:74:A7
    Attempting to connect to F8:37:BB:11:74:A7
    [CHG] Device F8:37:BB:11:74:A7 Connected: yes
    Connection successful

    Sadly, Chrome like the braindead piece of software it is does not see that there is a device already connected to the default device and continues to try and probe hci0 and seeing nothing.

    I have tried building the IDE from git and got a little further by just removing the requirement of winnus from the package.json file.

    it 'installed' fine. But when I do npm start

    npm start
    
    espruino-web-ide@0.65.11 start /home/user/devel/git/EspruinoWebIDE
     nw .
    
    
      Usage: nw-gyp <command> [options]
    
      where <command> is one of:
        - build - Invokes `make` and builds the module
        - clean - Removes any generated build files and the "out" dir
        - configure - Generates a Makefile for the current module
        - rebuild - Runs "clean", "configure" and "build" all at once
        - install - Install node development files for the specified node version.
        - list - Prints a listing of the currently installed node development files
        - remove - Removes the node development files for the specified version
    
    nw-gyp@3.4.0  /usr/local/lib/node_modules/nw-gyp
    node@4.6.1
    

    However, now I have some sort of weird incompatibility with node-gyp and whatever build file it uses.

    nw configure .
    gyp info it worked if it ends with ok
    gyp info using nw-gyp@3.4.0
    gyp info using node@4.6.1 | linux | x64
    gyp ERR! configure error 
    gyp ERR! stack Error: Invalid version number: undefined
    gyp ERR! stack     at getNodeDir (/usr/local/lib/node_modules/nw-gyp/lib/configure.js:71:25)
    gyp ERR! stack     at /usr/local/lib/node_modules/nw-gyp/lib/configure.js:43:7
    gyp ERR! stack     at /usr/local/lib/node_modules/nw-gyp/lib/configure.js:460:9
    gyp ERR! stack     at ChildProcess.exithandler (child_process.js:204:7)
    gyp ERR! stack     at emitTwo (events.js:87:13)
    gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
    gyp ERR! stack     at maybeClose (internal/child_process.js:829:16)
    gyp ERR! stack     at Socket.<anonymous> (internal/child_process.js:319:11)
    gyp ERR! stack     at emitOne (events.js:77:13)
    gyp ERR! stack     at Socket.emit (events.js:169:7)
    gyp ERR! System Linux 4.8.0-2-amd64
    gyp ERR! command "/usr/bin/nodejs" "/usr/local/bin/nw" "configure" "."
    gyp ERR! cwd /home/user/devel/git/EspruinoWebIDE
    gyp ERR! node -v v4.6.1
    gyp ERR! nw-gyp -v v3.4.0
    gyp ERR! not ok 
    

    To be honest I would feel happier if I was trying to debug a C++ program because nodejs gives me a headache.

    sighs

  • Hmm. strange error - I've not had that before.

    The winnus error isn't an issue as the package is optional. While the error is confusing everything will still install fine. (If anyone knows how to fix the error, I'd love to know how!).

    What about running node server.js? That will run the IDE without nw.js - then you can connect to it with your web browser

  • What about running node server.js?

    Woo hoo! Now why is that not in the faq? What is cool is it even tells you your device is not compatible and asks you to set the correct one.

    node server.js
    Thu Jan 05 2017 10:46:30 GMT+0000 (GMT) Server is listening on port 8080
    noble warning: adapter does not support Bluetooth Low Energy (BLE, Bluetooth Smart).
                   Try to run with environment variable:
                   [sudo] NOBLE_HCI_DEVICE_ID=x node ...
    

    So NOBLE_HCI_DEVICE_ID=1 node server.js

    works!!

    Thank you so much. It was getting quite frustrating and I really think this sort of thing needs to be put into the documentation for the IDE.

    Excellent now I can start with earnest tinking with my Pucks I have a few specific idea I need to test.

    Thanks once again!!

  • Great! That's interesting - I think you're probably relatively unique in running linux with two different bluetooth adaptors at once. First time I've come across it anyway :)

    There's a lot of info in that getting started guide - there are far too many ways of running the IDE :) Where would you have expected to find information on it? I'll see if I can add a comment.

  • @MyBlueBoo I'll be trying to improve multiple adapters situation. See comment at https://bugs.chromium.org/p/chromium/issues/detail?id=635111#c22 and following feature request at https://bugs.chromium.org/p/chromium/issues/detail?id=679287

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

Linux build issues from git and ability to use a second adapter.

Posted by Avatar for MyBlueBoo @MyBlueBoo

Actions