Atom fails to connect to LoPy



  • I have been trying to upload my code to the LoPy via serial port using a micro-usb connecting to the expansion board. After I get the correct serial port and press connect, the command window just shows "Connecting on /dev/cu.usbserial-DQ00D9F9... ".

    0_1521476950148_Screen Shot 2018-03-19 at 12.28.50 PM.png

    However, it says that it is connected in the upper left corner with the green check. Nevertheless, when I click the Run button it just says "Running test.py" and does not actually run the code on the LoPy. I have tried using another LoPy with another expansion board as well as two other computers(a PC and Mac) but both show the same exact thing.

    The other strange part is that the first week I was using the LoPy (I have had it for about 2 weeks), I was able to connect and everything worked completely fine. Then, a few days ago I had to press connect and disconnect several times before it would actually connect and run the code. It also seemed that if I unplugged the LoPy from the expansion and plugged it back in when the command window showed "Running test.py" , it would connect and run the code. Now it does not seem to work at all. Not sure if there is something I am doing wrong or if this is a bug but any help would be much appreciated.



  • Make sure all the jumpers on the top left hand corner of the expansion board are properly seated, since you cannot type into the REPL this could be the issue.



  • @seb

    Okay so the code is actually still not uploading and running on the LoPy. It just runs my old code. I tried changing "safe_boot_on_upload": false, in pymakr.conf to "safe_boot_on_upload": true, and it does not do anything. Pressing ctrl+f in the pymkr terminal does not do anything either. The pymakr terminal does not even let me type in it. Right now I am just trying to run a program with one line that prints "test" to the terminal. This is what I get when I use the method with a jumper cable between P12 and 3V3 :

    Connecting on /dev/cu.usbserial-DQ00D9F9...
    Running test.py
    ets Jun 8 2016 00:22:57

    rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0xee
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    mode:DIO, clock div:2
    load:0x3fff9010,len:12
    ho 0 tail 12 room 4
    load:0x3fff9020,len:388
    load:0x40078000,len:11584
    load:0x4009fb00,len:848
    entry 0x4009fc9c
    hello
    MicroPython v1.8.6-798-gebbcca48-dirty on 2017-10-31; LoPy4 with ESP32
    Type "help()" for more information.

    As you can see its prints a "hello", instead of "test", which is what one of the files I uploaded a while back was programmed to do.

    Is there anything else I can do?



  • @johnallen24

    It depends on if something in your code is blocking or not. A few things you can try:

    • In the new version of pymakr there is a setting to automatically safe boot the module before uploading
    • you can also try pressing ctrl+f in the pymakr terminal to perform a safe boot

    How well the above works will depend on what code is running on the device and if it able to register the safe boot requests



  • @seb

    Thank you this worked! However, the next time I run the code it still has the same problem. I have to do this process every time I want to run the code. Is there anything I can do to fix this?



  • @johnallen24

    Have you tried safe-boot? Connect a jumper cable between P12 and 3.3v of the expansion board then press the reset button on the module. This will cause the on-board LED to blink orange. Once the blinking starts you can remove the jumper and the device will boot without running boot.py or main.py and should drop you straight into the interactive REPL.


Log in to reply
 

Pycom on Twitter