pymakr/vscode on raspberry pi



  • Dear All,

    This might seem stupid at first but I am trying to do pycom developpment from a raspberry.
    Reason is simple. The whole system lopy4 + raspberry (openplotter) are meant to be installed on my boat for security monitoring (intrusion and water level), navigation logging (that's the raspberry's job), and occasionally retrieve raspberry data remotely
    Both will be connected together through the usb port. The lopy4 will be able to turn on the pi remotely record some nmea data (wind, etc... ) and turn it back off
    Anyway since the 2 devices will be connected for life I thought why not do the development on the pi and so if I need to make changes later on while on the boat I'll be able to do so.

    Anyway I just installed the arm version of VScode and installed pymakr on top of it both successfully !!! I can see the lopy serial(usb) connection but apparently vs nor pymakr seem to keen on detecting it. the bottom menu doesn't appear and on the top right when I click on "pymakr run current file" it says pymakr.run not found...

    Any hints or dependencies missing I should have installed or is it not possible at this time?

    Thank you in advance


  • Global Moderator

    Good to hear you sorted that out @theshade! If I have time I might fix Pymakr to look in that folder on a raspi, although I think there are not many people running this setup. (ps Pymakr is open source, so if you want to do that yourself with a pull request, feel free)



  • Hi @ralph,

    Just reporting that It works actually the folder is oddly named : Code - OSS (headmelted)/
    (yes with the sort of "spaces")

    so to make it work I just did a symlink in: .config
    ln -s Code - OSS (headmelted) Code
    and added the json file and I can now code/upload/download my lopy4 from my raspberry 3B+ ;)

    Thank you for your help


  • Global Moderator

    Hi @theshade, sorry for not responding on this. Good to hear you made the REPL work. What I understand is that the global settings don't work. I think is might also be causing the format error in pymakr.conf that you see, because in your screenshot the format is indeed correct.

    (By the way, you can leave the 'sync_folder' set to an empty string if you want to sync the root folder of the opened project.)

    On linux, the config file should be here: /Users/<username>/.config/Code/User/pymakr.json. Could you check if that is there, and if not, try to create it? Contents with defaults should be this:

        "address": "192.168.4.1",
        "username": "micro",
        "password": "python",
        "sync_folder": "",
        "open_on_start": true,
        "safe_boot_on_upload": false,
        "sync_file_types": "py,txt,log,json,xml,html,js,css,mpy",
        "ctrl_c_on_connect": false,
        "sync_all_file_types": false,
        "auto_connect": false
    
    }
    

    Pymakr should create this by default. I'll check if there is a mistake there that occurs on linux when installing for the first time.



  • Hi @Ralph,
    I am still stuck with no solution in case you missunderstood my last entry to this topic... Can you help? And did you succeed somehow in making it work?

    Thank you



  • Hello @ralph,

    I just did as you said and changed the install.js because I don't really know how to get 1.28.2 for armhf:
    using
    curl -s https://packagecloud.io/install/repositories/headmelted/codebuilds/script.deb.sh | sudo bash
    sudo apt-cache showpkg code-oss
    only shows 1.29 versions....
    Apparently it seems there is only 1.29 versions for debian/stretch and 1.28 is Ubuntu/xenial.
    Why does it have to do with the windows manager????

    Anyway I had some progress by modifying the electron_version to 2.0.11 and it seems the connection works and the REPL is now working in the consol !!!!!
    So serial works and most commands work. (wifi, firmware version, etc)

    Except the Global settings, which doesn't do anything (I am expecting to see some file being opened) and looking everywhere I can't find find the json file on drive... although config.js seems to be have a default version of it.
    "upload or download project" are also not responding nor throwing any errors.
    I am not clear about how to indicate to the vscode that the current folder is supposed to be a project (except by setting the "sync_folder" to the pymakr.conf)
    "Run current file" seems to work though...

    Also It says that pymakr.conf file format is wrong but I put it in a json validator and it seems to be fine..

    here is a screen shot(not sure how it would help)..
    0_1541621944426_b3287395-6830-4869-9867-98db2450f926-image.png

    Thank you for your support...


  • Global Moderator

    HI @theshade, I see you're using vscode version 1.29.0, which is not the latest stable release (1.28.2). I'm guessing that the serialport library is crashing in your setup, because it has been build against electron 2.0.7 instead of 2.0.11. I'll prepare the code for that and release it when 1.29 is officially out.

    So you can solve it by downgrading to 1.28.2, or if you don't want to, by rebuilding the serialport.
    Easiest way for the latter is changing one line: var electron_version = '2.0.7' to '2.0.11' in ~/.vscode/extensions/pycom.pymakr-1.0.4/scripts/install.js and then run npm install again from the pycom.pymakr-1.0.4 folder.



  • Hello @dan ,

    I got vscode for armhf here:
    https://code.headmelted.com/
    Version: 1.29.0 (user setup)
    Commit: c6990d2ed650612cfffcebedad439e61a34c7779
    Date: 2018-10-16T15:00:47.231Z
    Electron: 2.0.11
    Chrome: 61.0.3163.100
    Node.js: 8.9.3
    V8: 6.1.534.41
    Architecture: arm

    installed on:
    PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
    NAME="Raspbian GNU/Linux"
    VERSION_ID="9"
    VERSION="9 (stretch)"
    ID=raspbian
    ID_LIKE=debian

    Pymakr is 1.0.4 as far as I can see from the extensions tab.

    and it also says command pymakr.upload not found

    Thank you for your help.

    p.s.: am I the first doing this or have you already heard of people doing it from a raspberry?



  • @theshade Which version of VSCode and Pymakr are you running? Can you upload the project or does that give you an error as well?



Pycom on Twitter