Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPTA / Mbed crash on wifi.begin() #1011

Open
denisastro opened this issue Jan 4, 2025 · 3 comments
Open

OPTA / Mbed crash on wifi.begin() #1011

denisastro opened this issue Jan 4, 2025 · 3 comments

Comments

@denisastro
Copy link

Hi,

I have an issue with my OPTA Wifi board, described here :

When i call wifi.begin(), the mbed OS crashes (red led blinking 4 times slowly and then fastly).

Strangely, I have found that writing to the serial port just before invoking wifi.begin() seems to avoid the issue, and so this is making the opta examples with WiFi working.

For example, the stock Arduino IDE "Wifi/WiFiSSLClient" example from the IDE is working correctly, but if I add a :

delay (1000);

just before wifi.begin(), mbed OS is crashing.

I though that there was a powering issue, but the same is occuring when I plug the OPTA in a strong USB power supply or 24V industrial supply.

This basic code is crashing the OPTA if place on the setup function, unless I remove the delay (1000); line :

 while (status != WL_CONNECTED)
  {
    Serial.println(ssid); //if not immediately before wifi.begin, mbed will crash
    delay(1000);
    status = WiFi.begin(ssid, pass); 
  }

Test conditions :

  • I'm using Arduino IDE 2.3.4. Reported Wifi Firmware is 1.94.0
  • I double checked for power supplies issues, same issue is present when powering from the USB port of my computer, an independant USB power supply or a 24V industrial power supply.
  • nothing else is connected to OPTA
  • if an intentionnaly wrong SSID is used, the OPTA is NOTcrashing. If an intentionnaly wrong PSK is used with a good SSID, the OPTA IS crashing. So I guess it is crashing only when it tries to transmit something

Thanks for reading :-)

@denisastro
Copy link
Author

denisastro commented Jan 5, 2025 via email

@Johnson48858
Copy link

Try this instead inside your While statement:

while (status != WL_CONNECTED) {
Serial.print("Attempting to connect to SSID: ");
Serial.println(ssid);
status = WiFi.begin(ssid, pass);
// wait 3 seconds for connection:
delay(3000);
}

this part in setup should work for you as well. It works here on mine. This is from the examples for Opta, Under the wifi tag in the ide from the Wifi SSL Client example. I hope this helps you.

@denisastro
Copy link
Author

Thanks @Johnson48858

this is working as a workaround.

My intention is to help improving the opta product and libraries, so I think It is worth a debug session from the library maintainers (maybe I can help for that).

I have opened a service request to Arduino support, maybe they are able to relay that.

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants