No Answer to a Seemingly Simple Issue



  • I have discovered many others with the issue of not being able to upload a file/folder to flash the WiPy board. There seems to be no resolution to this. I am using a version 3.1 expansion board. I can "run" my code - in fact using an example from pymakr for VS Code (bluetooth) and followed everything as described in the "Pycom WiPy 3.0 user guide.pdf" to set up the folder. I'm using COM21.

    The messages:
    Uploading project (uload)...
    Safe booting device... (see settings for more info)
    Safe boot failed, uploading anyway.

    Failed to connect (Error: Port is not open). Click here to try again.
    Uploading to /flash...
    Upload failed.: timeout Please reboot your device manually.

    What gives. I cannot find one consistent answer anywhere for this problem. Really, really annoying. Maybe pycom should provide "paid support"? This is not good if one needs to get some development done.

    Thanks for any morsel or allotment of help anyone can provide.


  • Global Moderator

    @groger57 The antenna is not the problem. The sensitivity of the ESP32 WiFi is very good. It's the configuration, like @rskoniec said. For WiFi, you have two options:

    1. Keep the WiPy in AP mode, which is the default. In that mode, the WiPy is the access point, like your router now. In oder to connect to it, you have to re-configure our PC and connect the PC to it. Then, the PC looses the comnnection to the internet, unless it has two interfaces, e.g. wired and wireless.
    2. Configure the WiPy to Station mode and let it connect to your router. That is usually more convenient. A sample script is here: https://docs.pycom.io/tutorials/all/wlan/ The essential statements , to be entered manually are:
    import network
    wlan = network.WLAN(mode=network.WLAN.STA) # create station interface
    wlan.connect(ssid=WIFI_SSID, auth=(network.WLAN.WPA2, WIFI_PASSWD))
    print(wlan.ifconfig())
    

    After wlan.connect(), you have to wait a few seconds to allow the Wipy to connect. You would usually put that connect code above into main.py.

    Finally, you can still continue with attempts to use the serial interface. Options:

    Although as fallback tools I prefer the command line tools. They are robust, and especially rshell.py and pyboard.py need only Python with the serial and usb libs to work.



  • @groger57

    I checked my router and it does not show 192.168.1.4 on the network.

    192.168.1.4? Maybe 192.168.4.1 which is the default IP address of WiPy in the AP (access point) mode. You won't see this IP with WiPy MAC on any router, because your WiPy in that mode isn't connecting to any. It can connect in STA (station) mode. So in AP mode your PC is connecting directly to WiPy without any router.

    Also be aware that Filezilla connection:

    • needs to be normal type (w/o any encryption)
    • in passive mode
    • limit of simultaneous connections set to 1
    from network import WLAN
    from network import Server
    
    wlan = WLAN() # start the WiFi in AP mode with default password (PSK) www.pycom.io
    wlan.mode() # check the WiFi mode
    server = Server() # start FTP and Telnet services with default credentials - l: micro p: python
    server.isrunning() # check whether the server is running or not
    

    Sources: Server class and WLAN class



  • weird. my samsung phone show wipy, but my asus router does not. I have a 3.4dB gain antenna attached and I am about 6m away from the router.



  • sorry, dumb question it was.
    I checked my router and it does not show 192.168.1.4 on the network. Maybe that's why the ftp won't connect. should the device boot with wifi enabled, or do i need to enable it? also, I just updated the board firmware to the latest version.


  • Global Moderator

    @groger57 The com port and ftp port are completely independent. You can use them in parallel. FTP is connected directly to the LoPy module via WiFi. Obviously, your PC and the LoPy have to be connected to the same WiFi network to be able to communicate.



  • hi, thanks again, I have been reading that. but still the question - device manager is showing the board connected under COM PORTS, as "Expansion 3" COM21. Will Filezilla connect to it in filezilla at address 192.168.4.1, when windows has it set up as a com port?


  • Global Moderator

    @groger57 by the way: Windows only allows one application to use a com port. Please check, that no other software is using the com port.


  • Global Moderator

    @groger57 It's in the documentation: https://docs.pycom.io/gettingstarted/programming/ftp/
    If you changed the IP address of your device for a connection to you local network, you must use that address.



  • thanks robert-hh,

    my board is presently connected as a usb driven serial port that shows up as COM21 under com ports. to use ftp, is there a tutorial or steps on how to set up and accomplish this? I'm all for self-help, if there is info out there read. thanks!


  • Global Moderator

    @groger57 The only advice I can give is: do not use pymakr for that purpose. Use FileZilla (or plain ftp) to upload files to you device. If you do not want to use ftp, but USB, you can use simple and less comfortable tools like Adafruit ampy of Dave Hylands rshell.py or pyboard.py from the microypthon.org repository. But Filezilla is the most convenient one. It leaves no doubt which files are where.


Log in to reply
 

Pycom on Twitter