Pymakr unable to connect to LoPy in STA mode



  • Getting my feet wet with Pymakr (1.0.0.b5). Connecting the LoPy (0.9.1.b1) only succeeds in AP mode at 192.168.4.1
    In STA mode at DHCP aquired address Pymakr doesn't connect.
    FTP, Telnet connect fine though. No other active sessions when trying to connect Pymakr.
    Any clues?



  • @abilio Succes!! Adding machine.reset_cause() != machine.SOFT_RESET: did the trick.
    Pymakr is now able to connect to the LoPy on its STA address.
    Thanks for the great support!



  • Indeed @abilio and i use the script on the wiki : https://docs.pycom.io/lopy/lopy/tutorial/wlan.html (in boot.py) to connect to my wifi router.



  • @Keptenkurk Yeah, you're totally right, the original LoPy firmware (0.9.0.b1) didn't implement it.



  • @abilio I use a script like you just posted here but indeed without the check for reboot cause with "machine.reset_cause() != machine.SOFT_RESET:" To my understanding and experience that was not implemented yet in LoPy firmware.
    However i didn't check if the "partial implementation" of machine.reset_cause in 0.9.1.b1 (whatever that is) fixes enough of it to become usable in the boot.py script.
    Will try again tonight. The explanation sure makes sense!



  • Hi @arnaudw, can you confirm you're having this problem with the STA mode? can you confirm if you set it to STA every time it boots, or you skip doing it if the boot cause was a soft-reboot?



  • Hello,

    Same problem here :
    It works with FTP but not with PyMakr : it connects sometimes to PyMakr but can't stay connected and sometimes it doesn't connect at all.
    I use W10 pro, Python from PyMakr package (no installed before) and the same versions used by @Keptenkurk (PyMakr 1.0.0.b5 & Firmware 0.9.1b1).
    Hopes it can help.
    Great product moreover :)



  • Dear @Keptenkurk,

    After looking very hard to reproduce the error, we came up with a "most probable reason", but we need confirmation from your side.

    Does the code that switches the board to STA skips the process if it's a soft reboot, or it reprograms the WiFi it every time it runs?. If the latter is the case, the LoPy/WiPy will drop the connection for a brief moment while configuring the radio, but long enough to be noticeable.

    As Pymakr does a soft-reboot when trying to connect, it detects that short drop as a communication problem, hence the failure message.

    If you want more details on how to detect and skip the setup on soft reboots, please look at the following post:
    https://forum.pycom.io/topic/104/boot-py-wifi-script

    Looking forward for your feedback, hoping this post helped,
    Abilio



  • @Keptenkurk Thank you for the report. This has been seen in another cases, and we're working on a solution for it. Stay tuned for the upcoming Pymakr release.


Log in to reply
 

Looks like your connection to Pycom Forum was lost, please wait while we try to reconnect.