VS Code extension

Posted on
Page
of 2
/ 2
Next
  • I've started working on a VS Code extension for espruino. The initial working version has been published, but it's a very early version. It supports BLE and serial port communication (tested on windows) and shows a terminal that can be used to communicate with the espruino device. It will also show you the files in storage on the device and let you run code on the device and send a file there. For now there is no config, so the file sent won't be saved to flash, that's the next thing to implement. Anyways, it would be great if people could test it and let me know if it works on various systems. You can find it here: https://marketplace.visualstudio.com/ite­ms?itemName=MariusGundersen.espruinovsco­de

  • Great! Will definitly support your work with testing. Are you planing to add TCP/IP connection for devices too?

  • This is just a wrapper around EspruinoTools, so it can do what the npm espruino cli tool can do. I don't think it supports tcp/ip connection, but I haven't tried yet either.

  • yes it can -p,--port tcp://192.168.1.50 : Connect to a network device (port 23 default)

  • Ok, I'll have a look at how it works and try to implement something. I don't have any network device to connect to for testing, so not sure I'll be able to verify if it works.

  • You can test with a build for LINUX

    bin/espruino --telnet
    espruino: Interactive mode.
    espruino: Size of JsVar is now 27 bytes
    espruino: Size of JsVarRef is now 4 bytes
    espruino: Added SIGINT hook
    espruino: Added SIGHUP hook
    espruino: Added SIGTERM hook
    
         ____                 _
    |  __|___ ___ ___ _ _|_|___ ___
    |  __|_ -| . |  _| | | |   | . |
    |____|___|  _|_| |___|_|_|_|___|
                 |_| espruino.com
     2v18.6 (c) 2021 G.Williams
    
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate
    
    >
    

    check with lsof

    lsof  -n -P -i :2323
    COMMAND    PID       USER   FD   TYPE            DEVICE SIZE/OFF NODE NAME
    espruino 35833 markbecker    3u  IPv4 0x849de14f55bcd49      0t0  TCP *:2323 (LISTEN)
    

    and then connect

  • Can you try v0.0.7? Click on connect and it will show tcp/ip as an option

  • Great! I love it~

  • I've published a few bug fixes and improvements. Let me know if there is anything not working or a feature you really want.

  • Great work, @MariusGundersen!

  • Can't run tests at the moment. The EspruinoTools are not running any more on my Mac, have to run some updates/downgrades. @MariusGundersen which setup are you using and especially which node version?

  • Just ran the first test - works ;-)


    1 Attachment

    • Bildschirmfoto 2023-12-18 um 20.56.58.JPG
  • @MariusGundersen Which version of Node and OS are you running?

  • When working with ble devices a scan-timeout as possible in cli would be helpfull. The default value of 3sec is in most cases way to short ;-) Was searching is settings but could not find a way to add this. Any recomdation or has this to be added?

    espruino --list --scan-timeout 5

  • I think I use node 18.

    It just constantly scans in a loop, it seems. Any reason not to have it like that? What's the advantage of a timeout?

  • I can't see any ble devices when connect via vs code extension but on cli.

  • Give it a few seconds, it might not be there right away, but it keeps scanning while you have the selectbox open (as indicated by the progress indicator moving).

    I have developed this on Windows, so that's the only place I've been able to test it. What system are you on? You could try to open the vscode developer tools (Toggle Developer Tools from the command palette) and see if there is anything there.

  • I am on Mac OS X and might missing some security settings that block ble calls.

  • @allObjects does your Mac detect ble devices in the connection list?

  • @MaBe, looks like it detects them... but I may miss some of the details you are looking for.... you mean Espruino IDE? / Chrome browser on OS X? ...or VS Code? Looks like you are talking VS Code... not expert there yet... use it occasionally for debugging and development of tests / test software... but in a totally different setup, context and environment.

  • @allObjects in vs code with extension espruino

  • @MaBe, do you see any output in the VSCode Developer Tools (Cmd + P > Developer: Toggle Developer Tools? You should see which serial devices it finds during initialization (use Cmd+P > Reload Window to restart). When it starts scanning it will show something like the second screenshot:


    2 Attachments

    • Screenshot 2023-12-28 131541.png
    • Screenshot 2023-12-28 131215.png
  • My node version is v16.20.2. Found the dev tools and attached the issue


    1 Attachment

    • Bildschirmfoto 2023-12-28 um 18.46.43.jpg
  • I get that too, I don't think it's anything to worry about https://github.com/sidequestlegend/node-­blob/issues/5

    What logs do you get when you try to connect?

  • I think vscode uses it's own version of node, built into electron. You can check process.version in devtools to verify.

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

VS Code extension

Posted by Avatar for MariusGundersen @MariusGundersen

Actions