pycom / pycom-micropython-sigfox

A fork of MicroPython with the ESP32 port customized to run on Pycom's IoT multi-network modules.
MIT License
196 stars 167 forks source link

1.20.0.rc13 legacy firmware OSError WLAN #355

Open ahepp opened 4 years ago

ahepp commented 4 years ago

I am using a Pycom FiPy (firmware 1.20.0.rc13) and a Pytrack base.

After executing wlan = WLAN(mode=WLAN.STA), wlan.scan() results in:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: Scan operation Failed!

and wlan.connect('$ssid', auth=(WLAN.WPA2, '$pass'), timeout=5000) (where $ssid and $pass are my actual network credentials) results in:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: the requested operation failed
ahepp commented 4 years ago

These errors do not occur with legacy firmware 1.19.0.b5

renzoe commented 4 years ago

I confirm too. https://github.com/pycom/pycom-micropython-sigfox/issues/396

seems long issue with 1.2x legacy? I am running a LoPy4

salal-m commented 4 years ago

Please use the latest 1.20.2 release, I am not able to reproduce the issue on it. @ahepp can you check if it is working for you?

robert-hh commented 4 years ago

I have no issues with WiFi and the 1.20.2RC7 release. But I'm using my own firmware build in the basic Variant (without PyBytes code). Edit: I have to correct myself. While connect() works w/o problems, scan() fails with the error message: OSError: Scan operation timed out! Firmware Version: Pycom MicroPython 1.20.2.rc7 [v1.20.1.r2-151-g1ef1daf] on 2020-05-04; LoPy4 with ESP32 Edit 2: So I tested a few more device: 1.20.0.rc6: Three pass scan(), one fails scan() 1.20.0.rc7: Two fail scan() All devices connect properly to the AP.

robert-hh commented 4 years ago

The documentation here reveals some more parameters to scan: https://development.pycom.io/firmwareapi/pycom/network/wlan/ E.g. using wlan.scan(scantime=2000) works on devices which timed out before on a rc6 device on a rc7 device, the parameter set was: wlan.scan(type=wlan.SCAN_PASSIVE, scantime=5000)

bervoiv commented 4 years ago

This is still a problem, any update on a possible fix? It's rendering my lopy devices useless...

salal-m commented 4 years ago

Which firmware version are you using?

bervoiv commented 4 years ago

Hi @salal-m I'm using release='1.20.0.rc13', version='v1.9.4-94bb382 on 2019-08-22' on a LoPy

salal-m commented 4 years ago

Is there a reason you are not using the latest version? There are no connection issues in 1.20.2.rc7.

salal-m commented 4 years ago

@bervoiv Please try the latest version. If you don't want to use Pybytes, you can disable it in MicroPython using pycom.pybytes_on_boot(False) (though the additional code for it will still be compiled) Since we only maintain one version of the firmware now, we can only provide support on that.

bervoiv commented 4 years ago

@salal-m I thought the legacy was for when we don't need pybytes. And the PyBytes version was for that platform specifically. Thx for your input!

BetterAutomations commented 3 years ago

FYI I was forced to use 1.20.0.r13 due to this bug on all newer versions I had tested. The Pycom GoogleIOT plugin requires at least 1.20.0.r11 but that also exhibits this bug.

So I am completely and totally stuck on this one. Can't upgrade to newer versions, can't use this version. Surely I'm not the only person?