Community

ConnectionStatus from WiFiAdapter.Connect is Success although username and/or password is wrong

Hi

(I am new to this so I hope this is the right place to report a “bug”?)

I took the WifiWeather sample because I wanted to try out both the display and out the WiFi functionality, but if i am not misktaken I found a bug in Connect method.

When I run the following code:

        Device.InitWiFiAdapter().Wait();

        onboardLed.StartPulse(Color.Blue);

        var result = await Device.WiFiAdapter.Connect(Secrets.WIFI_NAME, Secrets.WIFI_PASSWORD);
        if (result.ConnectionStatus != ConnectionStatus.Success)
        {
            throw new Exception($"Cannot connect to network: {result.ConnectionStatus}");
        }
        else
        {
            Console.WriteLine("INFO: Connected to WiFi " + Secrets.WIFI_NAME);
        }

I get a “INFO: Connected to WiFi xxxx” (Success) even if SSID name and/or password is wrong.

I discovered this because I couldn’t get any data back from the weather service and then I found out that I had written the SSID with a starting lowercase letter, which was not correct. When I changed the SSID in Secrets.cs to start with a uppercase letter I got data back from the weather service.

Regards
Lars B.

Which version of the system are you using? If memory serves this was an issue in older versions of the firmware.

The current version is 0.5.1.0.

Regards,
Mark

Yes I am quite sure it’s 0.5.1.0. It’s the lastest which I downloaded to my two meadow boards two-three days ago.

Regards
Lars

Did you rebuild the application with the latest Meadow packages?

That issue was resolved in beta 4.6.

You can verify the OS versions on the board using the command meadow device info.

Regards,
Mark

I used the guides from the Development site this weekend to update my meadow boards and it seems to be ok:

Reagards
Lars

So the OS version looks OK.

Did you rebuild and redeploy the application?

The specific issue fixed in beta 4.6 was actually an issue inside Meadow.Core.

Regards,
Mark

Yes I did that from VS, but I am going to give it another shot. Maybe something went wrong in build/deploy. I’ll return with my findings.

Regards
Lars

I have now tried again to rebuild and deploy with same results. I get Success from Connect even when password for SSID is wrong.
Are there some logs that I can provide or things that i can check to see if there is something wrong with the downloaded modules/packages?

As a side note, I find it strange the way WifiWeather calls the Initialize () and Start () methods. If I am not mistaken, then you can easily risk that the call to the weather service is carried out before connecting to Wifi.
I’ve fixed this in my own version, but I’m wondering why it’s coded this way in the sample and Visual Studio also complains about the way the Initialize () and Start () methods are called because they are async methods.

Found the problem.

Next up, fixing it.

Thank you for reporting this.

Regards,
Mark