Avatar for netmonk

netmonk

Member since Apr 2019 • Last active Oct 2020
  • 1 conversations
  • 11 comments

Most recent activity

  • in General
    Avatar for netmonk

    I added -E to bluetoothd command to enable experimental mode:

    Loaded code from storage.
    serviceworker> active
    Handling URL "https://www.espruino.com/ide/"
    Couldn't connect to wss://localhost:31234 - disabling websockets for this session
    ERROR: getURL("/serial/ports") error : Not Found
    /serial/ports doesn't exist - disabling WebSocket support
    ERROR: serial_frame: getPorts timeout, disabling
    >>> Connecting...
    Set Slow Write = true
    >>> Connecting to Pixl.js c734
    BT>  Device Name:       Pixl.js c734
    BT>  Device ID:         MckzoCJ/zg3Wdi0vtHM5mg==
    >>> Connected to BLE
    BT> Connected
    BT> Disconnected (gattserverdisconnected)
    ERROR: [notify_error] Connection Failed.
    >>> Connection Failed.
    BT> ERROR: NetworkError: GATT Server is disconnected. Cannot retrieve services. (Re)connect first with `device.gatt.connect`.
    
    • 16 comments
    • 5,542 views
  • in General
    Avatar for netmonk

    Well, i try using my little laptop, still on ubuntu 19.04, and while i didnt face same issue, i still encounter new one :

    Loaded code from storage.
    Handling URL "https://www.espruino.com/ide/"
    Couldn't connect to wss://localhost:31234 - disabling websockets for this session
    ERROR: getURL("/serial/ports") error : Not Found
    /serial/ports doesn't exist - disabling WebSocket support
    ERROR: serial_frame: getPorts timeout, disabling
    >>> Connecting...
    Set Slow Write = true
    serviceworker> active
    BT> ERROR: NotFoundError: User cancelled the requestDevice() chooser.
    ERROR: [notify_error] Connection Failed.
    >>> Connection Failed.
    >>> Connecting...
    Set Slow Write = true
    >>> Connecting to Pixl.js c734
    BT>  Device Name:       Pixl.js c734
    BT>  Device ID:         MckzoCJ/zg3Wdi0vtHM5mg==
    BT> ERROR: NetworkError: Connection failed for unknown reason.
    ERROR: [notify_error] Connection Failed.
    >>> Connection Failed.
    
  • in General
    Avatar for netmonk

    thank you @Gordon :)

  • in General
    Avatar for netmonk

    And there we go :

    plonky@macronetmonk:~/node_modules/espruino/bin$ ./espruino-cli.js -d Pixl --ide 8080
    Espruino Command-line Tool 0.1.27
    -----------------------------------
    
    Searching for device named "Pixl"
    Found "Pixl.js c734" ("fa:ee:05:a7:c7:34")
    Connecting to 'fa:ee:05:a7:c7:34'
    Connected
    Web IDE is now available on http://localhost:8080
    Web IDE Connection accepted.
    
    >< << {"VERSION":"2v01","GIT_COMMIT":"748a4d3","BOARD":"PIXLJS","FLASH":524288,"RAM":65536,"SERIAL":"1e21d7bf-3480018d","CONSOLE":"Bluetooth","MODULES":"Flash,Storage,heatshrink,fs,net,dgram,http,NetworkJS,WIZnet,crypto,neopixel,graphical_menu","EXPTR":536882356} >> >
    >
    
  • in General
    Avatar for netmonk
    plonky@macronetmonk:~/node_modules/espruino/bin$ sudo setcap cap_net_raw+eip $(eval readlink -f `which node`)
    [sudo] password for plonky: 
    plonky@macronetmonk:~/node_modules/espruino/bin$ ./espruino-cli.js --list
    Espruino Command-line Tool 0.1.27
    -----------------------------------
    
    PORTS:
      fa:ee:05:a7:c7:34 (Pixl.js c734)
    plonky@macronetmonk:~/node_modules/espruino/bin$ ./espruino-cli.js --list --verbose
    0.1.27
    Espruino Command-line Tool 0.1.27
    -----------------------------------
    
    Acorn library not found - you'll need it for compiled code
    Found /home/plonky/node_modules/espruino/libs/targz.js
    Found /home/plonky/node_modules/espruino/libs/utf8.js
    Found /home/plonky/node_modules/espruino/espruino.js
    Found /home/plonky/node_modules/espruino/core/codeWriter.js
    Found /home/plonky/node_modules/espruino/core/config.js
    Found /home/plonky/node_modules/espruino/core/env.js
    Found /home/plonky/node_modules/espruino/core/flasher.js
    Found /home/plonky/node_modules/espruino/core/modules.js
    Found /home/plonky/node_modules/espruino/core/notifications.js
    Found /home/plonky/node_modules/espruino/core/serial.js
    Found /home/plonky/node_modules/espruino/core/serial_chrome_serial.js
    No chrome.serial - Chrome Serial disabled
    Found /home/plonky/node_modules/espruino/core/serial_chrome_socket.js
    No chrome.sockets - Chrome Socket disabled
    Found /home/plonky/node_modules/espruino/core/serial_frame.js
    Found /home/plonky/node_modules/espruino/core/serial_noble.js
    Found /home/plonky/node_modules/espruino/core/serial_node_serial.js
    Found /home/plonky/node_modules/espruino/core/serial_node_socket.js
    Found /home/plonky/node_modules/espruino/core/serial_web_audio.js
    Found /home/plonky/node_modules/espruino/core/serial_web_bluetooth.js
    Found /home/plonky/node_modules/espruino/core/serial_websocket_local.js
    Found /home/plonky/node_modules/espruino/core/serial_websocket_relay.js
    Found /home/plonky/node_modules/espruino/core/serial_winnus.js
    Not on Windows, Winnus not needed
    Found /home/plonky/node_modules/espruino/core/terminal.js
    Found /home/plonky/node_modules/espruino/core/utils.js
    Found /home/plonky/node_modules/espruino/plugins/assembler.js
    Found /home/plonky/node_modules/espruino/plugins/boardJSON.js
    Found /home/plonky/node_modules/espruino/plugins/compiler.js
    Found /home/plonky/node_modules/espruino/plugins/getGitHub.js
    Found /home/plonky/node_modules/espruino/plugins/localModules.js
    Found /home/plonky/node_modules/espruino/plugins/minify.js
    Found /home/plonky/node_modules/espruino/plugins/saveOnSend.js
    Found /home/plonky/node_modules/espruino/plugins/setTime.js
    Found /home/plonky/node_modules/espruino/plugins/unicode.js
    Loading UTF8 with require
    Found /home/plonky/node_modules/espruino/plugins/versionChecker.js
    Initialising CodeWriter
    Initialising Config
    Initialising Env
    Initialising Flasher
    Initialising Modules
    Initialising Notifications
    Initialising Serial
      - Initialising Serial Noble Bluetooth LE
      - Initialising Serial Node Serial
      - Initialising Serial Node Socket
      - Initialising Serial Web Bluetooth
    Initialising Utils
    Initialising Status
    Initialising Assembler
    Initialising BoardJSON
    Initialising Compiler
    Initialising GetGitHub
    Initialising LocalModules
    Initialising Minify
    Initialising SaveOnSend
    Initialising SetTime
    Initialising Unicode
    Initialising VersionChecker
    Initialising CoreModules
    Searching for serial ports...
    Noble: getPorts - not initialised
    No navigator.bluetooth - Web Bluetooth not enabled
    Noble: stateChange -> poweredOn
    Noble: Disable Web Bluetooth as we have Noble instead
    Noble: Starting scan
    Noble: Found UART device: Pixl.js c734 fa:ee:05:a7:c7:34
    Noble: Found device: TNT_BW   f0:ab:54:4b:3f:8c
    Noble: Found device: TNT_BW   f0:ab:54:4b:3f:8c
    PORTS:
      fa:ee:05:a7:c7:34 (Pixl.js c734)
    

    looks better ! :)

  • in General
    Avatar for netmonk

    Well well well,
    Not good.
    As far as i can see:

    plonky@macronetmonk:~/node_modules/espruino/bin$ ./espruino-cli.js --list
    Espruino Command-line Tool 0.1.27
    -----------------------------------
    
    PORTS:
    

    No port listed.
    I can still connect using gatttool, but using a random address on computer side.
    If i use a public address, it doesn't work at all:

    plonky@macronetmonk:~/node_modules/espruino/bin$ gatttool -t random -b FA:EE:05:A7:C7:34 -I
    [FA:EE:05:A7:C7:34][LE]> connect
    Attempting to connect to FA:EE:05:A7:C7:34
    Connection successful
    Notification handle = 0x000d value: 3c 2d 20 54 65 72 6d 69 6e 61 6c 0d 0a 3e 
    [FA:EE:05:A7:C7:34][LE]> 
    
    (gatttool:18294): GLib-WARNING **: 17:06:47.993: Invalid file descriptor.
    plonky@macronetmonk:~/node_modules/espruino/bin$ man gatttool
    plonky@macronetmonk:~/node_modules/espruino/bin$ gatttool -t public -b FA:EE:05:A7:C7:34 -I
    [FA:EE:05:A7:C7:34][LE]> connect
    Attempting to connect to FA:EE:05:A7:C7:34
    [FA:EE:05:A7:C7:34][LE]> 
    plonky@macronetmonk:~/node_modules/espruino/bin$
    
  • in General
    Avatar for netmonk

    Good monring Gordon,

    I will receive an external dongle by end of week to make more test.
    I will also try the NPM way you suggest and keep you informed. :)

    Thank you so much for your answers.

  • in General
    Avatar for netmonk
    plonky@macronetmonk:~$ sudo hcitool lescan
    [sudo] password for plonky: 
    LE Scan ...
    FA:EE:05:A7:C7:34 Pixl.js c734
    FA:EE:05:A7:C7:34 (unknown)
    F0:AB:54:4B:3F:8C TNT_BW  
    F0:AB:54:4B:3F:8C (unknown)
    
  • in General
    Avatar for netmonk
    plonky@macronetmonk:~$ bluetoothd --version
    5.50
    plonky@macronetmonk:~$ sudo /etc/init.d/bluetooth restart
    [sudo] password for plonky: 
    [ ok ] Restarting bluetooth (via systemctl): bluetooth.service.
    plonky@macronetmonk:~$ chromium --version
    Chromium 74.0.3729.108 snap
    

    Still getting the error :

    serviceworker> active
    Handling URL "https://www.espruino.com/ide/"
    Couldn't connect to wss://localhost:31234 - disabling websockets for this session
    ERROR: serial_frame: getPorts timeout, disabling
    ERROR: getURL("/serial/ports") error : Not Found
    /serial/ports doesn't exist - disabling WebSocket support
    >>> Connecting...
    Set Slow Write = true
    BT> ERROR: NotFoundError: Bluetooth adapter not available.
    ERROR: [notify_error] Connection Failed.
    >>> Connection Failed.
    >>> Connecting...
    Set Slow Write = true
    BT> ERROR: NotFoundError: Bluetooth adapter not available.
    ERROR: [notify_error] Connection Failed.
    >>> Connection Failed.
    
Actions