Serial debugging through Pyscan micro USB port?



  • Hey y'all, I'm able to successfully screen into my LoPy4 using an FTDI cable, and I land right in a Python terminal (awesome).

    Now I've plugged my LoPy into a Pyscan and am trying to do the same thing just over the micro USB port and the device never shows up in my /dev folder.

    It does power up, and the blue light starts flashing on the LoPy but I can't figure out how to get into it through the Pyscan.

    Any advice?

    Thanks



  • @Gijs I ran those commands and they didn't "stick". I ran pycom.wifi_on_boot(True) and then immediately checked the status with pycom.wifi_on_boot() and it remains False. And no new networks showed up.

    I booted into safe mode and got some version numbers. Is there another way to check firmware versions? Looks like I'm on some old stuff.

    Pycom MicroPython 1.20.0.r3 [v1.9.4-398a290] on 2019-09-19; LoPy4 with ESP32
    Pybytes Version: 1.0.2
    

    Update: Okay I updated firmware! Seeing a lot more methods now and seeing the Access Point!

    Pycom MicroPython 1.20.2.r1 [v1.11-a5aa0b8] on 2020-09-09; LoPy4 with ESP32
    


  • Great to hear it is solved!
    Sorry for the confusion. Sometimes the issue is with the Lopy module instead of the expansion board. Then, first making sure the expansion board is operational can help in troubleshooting, as the Pyscan should show up in lsusb even without a Lopy inserted. In the end, you indeed need to have two working modules :-)

    Im not sure of the firmware version you are running, but the pycom.pybytes_on_boot(False) was introduced some time ago. Next to that, you might need to do the following as well:

    import pycom
    from network import WLAN
    pycom.wifi_on_boot(True)
    pycom.wifi_mode_on_boot(WLAN.AP)
    

    To activate the AP.

    Best,
    Gijs



  • @jcaron Thanks, I think I misunderstood something in @Gijs's reply which led me to believe that I could connect directly with the Pyscan. Looks like my only problem was just not using a microUSB cable that was data capable. All is working great now. Thanks for all your help.

    @rcolistete I tried as you said and got the following error

    AttributeError: 'module' object has no attribute 'pybytes_on_boot'

    Perhaps I have an old firmware? I haven't updated anything since ordering.



  • @meshnerd I’m not sure what you mean by connecting to the Pyscan itself. The Pyscan is not running micropython, it does not have an interactive prompt, it only has a small PIC which acts as a USB-to-serial gateway between the module and the USB port.

    The only interaction you can have with the Pyscan over USB is DFU mode to upgrade its firmware (not sure if there have been multiple versions released of the Pyscan firmware though).

    The Pyscan can’t do anything by itself (at least with current firmware), it’s just an accessory for whatever module you insert into it.

    Note that I’ve never used a Pyscan so I’m basing all this on the way the Pytrack and Pysense work, but I would be surprised if it was very different.



  • On Linux :

    $ screen /dev/ttyACM0 115200
    

    works (show interactive terminal running MicroPyhon) only if LoPy4 is placed on Pyscan/Pytrack/Expansion Board v3.x.

    To have WiFi AP (Access Point) working, first disable Pybytes :

    import pycom
    pycom.pybytes_on_boot(False) 
    

    then reboot. The default behaviour is LoPy4 working as AP.



  • @Gijs Thanks for the reply! You were right, all 4 microUSB cables I tried were power only. 😞. PS4 controller charging cable to the rescue, though. πŸŽ‰

    Interestingly, I'm now able to screen to the LoPy via microUSB when it's plugged into the Pyscan, but I can't screen into the Pyscan by itself. Both times it shows up as the same /dev entry, tty.usbmodemPy32bfe81.

    When I try to screen into just the Pyscan, pressing enter never reveals a python prompt. Is it also 115200?

    I also still don't see any wifi access points showing up. Is there something special I have to do to enable that?



  • Hi, make sure the USB cable is a data cable. Also without the Lopy4, the Pyscan should show up with lsusb. If that does not work, you can measure the 3.3V on the expansion header of the Pyscan and let us know of the result!

    Gijs



  • I should mention that I'm not seeing the device show up when running lsusb either.

    I also plugged it in and tried looking for the WIFI Access Point it creates (per these instructions) and I didn't see it showing up so I couldn't connect over FTP either.


Log in to reply
 

Pycom on Twitter