Lopy4 on a Pycom3.1 expansion board not connecting

  • I have a new Lopy4 on a new Pycom 3.1 expansion board. When I connect via USB I can communicate with the board via the pymaker app in atom.

    I was trying to utilise the example code for connecting a DHT22 sensor however the DHT22.py module is not found when it is in the lib directory.

    I thought I would try pybytes. I upgraded the firmware in the lopy4 (using windows) however the device is not connecting. I also cannot connect via the app on my iphone. I have spent several hours on this. Not sure what I am missing.

    Any help appreciated



  • Thank you Gijs I missed the significance of the script


  • Hi,
    Listed on the ftp & telnet page in the docs (https://docs.pycom.io/gettingstarted/programming/ftp/) there is a script listed at the top of the page to disable the smart-config and enable the access point. You will need to reboot after that (as the AP is activated on boot) but that should give your computer the option to connect to a network created by your device (called whatever you input for ssid). After connecting, you should be able to access the device over FTP through FileZilla or the like, and the REPL wirelessly.

    You can also change the settings such that it connects to your router instead (then, you'll have to find its IP address in your router, or over usb using wlan.ifconfig(), making it a little harder). This will not be a great solution for low-power applications, as the device will keep the WiFi radio active, but you can probably figure something out there.

    Let me know if I missed anything!

  • @Gijs said in Lopy4 on a Pycom3.1 expansion board not connecting:



    Thank you for your response. I was getting pretty frustrated, nice to have input. I managed to upload the dht22.py file and the program ran successfully. Very happy to have some data. As I mentioned connecting is one of the issues I have had. In Atom it connects fine via Com4. The other connection option is this does not work. I was unsure what files had already uploaded to the device so I wanted to take a look. I downloaded FileZilla and set up as described https://docs.pycom.io/gettingstarted/programming/ftp/. I have not been able to connect with FTP. Not been able to see what was on the device made it difficult. I found a reference to upysh.py in the micro python library. This enabled me to see what files were on the device. I then found the revised code to clear the files from the device (import os, then run os.fsformat('/flash') I had been trying to use os.mkfs as described in the getting started guide but I found reference to the revised command associated with the latest flash upgrade. Once I got the device cleared I was able to upload the files. I found that I had to turn the power off and restart before I was able to upload (could not find project if I did not). I had not appreciated that you could not test the code in atom prior to uploading on the device (library module not found). Once loaded the program read sensor input and uploaded to the things network using Lora. Only problem I have now is that it has stopped uploading although the sensor is continuing to be read (data shows up in Atom but not on the things network) and the send should be sending. Looks like I need to do more research into the lora communication and things that will cause it to stop. If you have any advice regarding why I cannot access the Lopy4 via ftp that would be useful. At the moment the Lopy is connected to computer by USB. I plan to disconnect for application and power by battery so it would be useful if I could connect via FTP remotely to troubleshoot in the future.
    Again thank you for your help

  • Hi, for the DHT22.py issue, make sure you click the upload button in Pymakr to upload the lib folder to the device, that should resolve the issue. When using the Pybytes app, please check pybytes.smart_config(True), to configure the device through the app. Though, for the first time, I would recommend going through the Pybytes getting started guide: http://docs.pycom.io/pybytes/gettingstarted/


Log in to reply

Pycom on Twitter