UIFlow places WiFi connection code in the wrong place



  • I'm trying to make a robust wifi connection flow for unattended use. To do this I need to put the wifi connect commands inside a conditional so that I can test/handle/etc.

    Here's a simple example to demonstrate the issue

    A simple flow with the wifi connect widget in the correct place (inside a conditional):
    grab1

    ...and here is the resulting python code. Note WiFi.doConnect has moved to the top of the python code block instead of inside the else statement:
    grab2

    If I move the doConnect to the correct place the code works as I expect and there are no errors.

    I have tried this with doConnect and AutoConnect with the same result.



  • Hi @Slartibartfast

    I am seeing the same. I guess it's a bug.

    Interestingly, when I replace the Connect to Wi-Fi ... block with an Execute code: wifiCfg.doConnect('myAP', 'myPW') block the block stays within the else statement.

    Thanks
    Felix



  • @felmue Interesting. I had not tried that. Good workaround until this gets fixed for realz.

    Thanks!



  • Hi
    it seems wifi block handling not completely finished at UIFlow .
    also i need wifi.RSSI level
    0_1608525709701_m5 wifi1.JPG
    0_1608525767154_m5 wifi2.JPG