Atom / Pymakr not connecting to Lopy



  • I have a LoPy that I have uploaded some python code to and have been working on/correcting for a week. At this stage, it is useful to mention that I have both Windows 10 and Ubuntu installed on my Laptop bc of work and personal use.
    As soon as I have started working with Linux and installed atom, I have had problems connecting to my LoPy with the following message :

    Connecting on COM14...
    Disconnected. Click here to reconnect.
    Connecting on COM14...
    Connecting on COM14...

    and nothing happens. ctrl +c doesn't help, and uploading files to my LoPy is therefore impossible. I have looked for solutions online but haven't found anything that suits my case.
    Luckily, this issue was specific to Linux, which is why I contended with the clumsy alternative of restarting the PC to log into Windows everytime I needed to upload code to the LoPys. Unfortunately, I now have the same problem in Windows and have no clue how to slove it. Updating the firmware of the Lopy hasn't helped either...

    would be very appreciative of any input or suggestion about how I could either solve this issue or dodge it. Thank you in advance!



  • Have you tried using something other than pymakr? maybe screen or minicom. Also its worth checking if your user has permissions for the serial port. The procedure to do this varies by linux distro but on most you can add your user to the dialout group and when you reboot that user will have permissions to use serial ports

    sudo usermod -a -G dialout $USER
    


  • @seb thanks for the advice. I just safe booted it but it's still giving me the connection error timeout. Could it be bc of Linux OS?



  • @crumble Oh sorry for the confusion : those were just the last 2 devices of the /dev/ list. ttyUSB0 is in fact among them and I have configured it in the config file.



  • If you think your device is stuck, try safe booting it, connect P12 to 3.3V, and press the reset button, you should see the onboard led flash orange. the device will then boot without running main.py or boot.py and should give you access to the repl



  • @kchehade

    /dev/ttyS8
    /dev/ttyS9

    Connecting on /dev/ttyUSB0...

    Sorry i am not using the latest Atom plugin, so your way may be easier:
    Looks like you have to edit pymakr.conf in your project, which defines the address (device) it connects to. Change /dev/ttyUSB0 to one of the /dev/ttyS? ports, depending on which is assgigned to your LoPy



  • @crumble Thank you so much for your quick reaction!
    I have already listed the available ports and instructed atom to connect with the right one through the global settings. The device manager also has no problems detecting my the usb port of the LoPy.
    Furthermore, I don't have Linux installed on a VM but on a separate partition that I boot from by restarting my computer (hence the clumsiness in having to restart my PC everytime I want to upload code - as most of my work is on linux).
    @seb I also made sure there was one single window open whenever I connected.

    What's interesting is that on the top left corner of the REPL, it says "connected", which makes me believe that the program is stuck in a loop or something. As I said, though, ctrl + c doesn't provoke any reaction.

    This is my most recent REPL output :

    /dev/ttyS8
    /dev/ttyS9
    ">>>" Disconnected. Click here to reconnect.
    ">" Failed to connect (Error: Port is not open). Click here to try again.
    Connecting on /dev/ttyUSB0...
    Connection error: Error: timeout
    Disconnected. Click here to reconnect.
    ">" Failed to connect (Error: Port is not open). Click here to try again.
    Connecting on /dev/ttyUSB0...
    Connection error: Error: timeout



  • Another thing worth checking is that you dont have any other atom windows/tabs open that have the pymakr terminal open, these will try to autoconnect and will prevent other windows opening the connection



  • @kchehade said in Atom / Pymakr not connecting to Lopy:

    COM14

    Your device may not be detected as a com device or it is assigned to another serial than COM14. You can list the available ports in Atom. If this does not help: Plug out your LoPy, open the device manager, plug in your LoPy and check as which device it is deteced.

    Your VM may grabed the device. So if you are running the VM at the same time, check if your LoPy is listed there.



Pycom on Twitter