Can't upload code to LoPy



  • Hi all,

    The problem

    • I am struggling to upload my project to the LoPy board.

    Considerations

    • I have access to the REPL interface of the board over the pymark plugin in atom and do the basics operations with the REPL
    • I can run the programs I write using the button "Run" on the pymark plugin successfully
    • Firmware Version: '1.13.0.b1'

    My scenario
    Project structure:

    [javier@archy ] ~/wkspc/podsystem/repos/pycom-lora $ tree
    pycom-lora
    ├── boot.py
    ├── cert
    ├── lib
    ├── main.py
    ├── pymakr.conf
    └── sys
    

    Where all the folders are empty (just replicated an example I saw in your official documentation).

    boot.py

    print("Entering into boot.py")
    

    main.py

    from machine import Pin
    import time
    
    led = Pin('G16', mode=Pin.OUT, value=1)
    
    for i in range(20):
        led.toggle()
        time.sleep(1)
        print("Iteration: " + str(i))
    
    print("Done!")
    

    pymakr.conf

    {
        "address": "/dev/ttyUSB0",
        "username": "micro",
        "password": "python",
        "sync_folder": "",
        "open_on_start": true,
        "sync_file_types": "py,txt,log,json,xml",
        "ctrl_c_on_connect": false
    }
    

    Synthoms
    When I press the Upload button it shows an error:

    Uncaught Error: ENOENT: no such file or directory, open 'null/lib/python/minified/monitor.py'
    

    The exact problem has already been raised as an issue of the plugin in here

    But I still think that I still lack of other information. That leads to the next questions.

    Questions

    • What is the mandatory project structure for uploading a project? There is very few information on this. I have only been able to find this, that is exactly what I am trying to replicate.
    • What is this Sync feature and how can I enable it?
    • Is there any other way to upload files to the board? Where can I find information on this? I haven't found any documentation on this in the oficial docs of pycom.

    Hope you can help me. If you can provide a link with more info about this I could probably get by myself but right now I am stuck and it is a bit frustrating since I can run code on the REPL but I can not do anything else.

    Regards,

    Javier


  • Global Moderator

    Hi @JVGD, thanks for reporting this. Looking at the error message, I'm wondering if you can check if the folder '~/.atom/packages/pymakr' is in lower case, not uppercase as 'Pymakr'? There was a change from uppercase to lowercase a couple of versions ago, but in some cases the uppercase version stayed in some atom cache or config file, causing issues like this...

    If it's in uppercase, please try to un-install and install the latest version of Pymakr (1.2.7). Some more suggestions to solve the issue were discussed here: https://github.com/pycom/pymakr-atom/issues/53



  • Hi

    I have passed on your pymakr error onto the team responsible and they should get in touch with you soon. In regards to your questions:

    1. Your pymakr projects should be structured like so:
    MyProject
     |-boot.py (optional)
     |-main.py (put your main code here)
     |-lib
     |--libA.py
     |--libB.py (It is important that all the library files are in this one directory not nested into more directories)
    
    1. The sync feature is now called "Upload" this will upload to code from your local director to your device, there is also a "download" that does the reverse. I will make sure the docs get updated to reflect this

    2. You can upload files to the board either via serial/telnet using Pymakr, or you can use a third party tool like rshell or mpfshell. There is also a FTP server running on the device which you can access as described here: https://docs.pycom.io/chapter/toolsandfeatures/FTP.html
      You will need to connect to the wifi ap your device creates by default, the ssid will look like so lopy-wlan-XXX, and the password is www.pycom.io


 

Pycom on Twitter