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):
...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:
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.
-
I am seeing the same. I guess it's a bug.
Interestingly, when I replace the
Connect to Wi-Fi ...
block with anExecute 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
-
@slartibartfast Hate to bump an old topic but this is a problem for me still. The "Original Network Function" blocks place the calls to the wlan class correctly but they don't actually work. This is UIFlow 1.9.6 now. It makes it impossible to use the program except in the coverage area of the SSID hard coded into the program.
For a workaround, you can manually relocate the call to doConnect inside the loop or function where you want it. You can save that, and when you upload the program to the device it seems to send the modified python.