Connecting Photon 2 to 5Ghz Wifi

So i brought a Photon 2 board expecting to be able to connect to 5Ghz wifi, as its stated in the product desciption :

Dual-band Wi-Fi (2.4Ghz and 5Ghz)

I manage to set up the board and connect to a 2.4Ghz network pretty easily , but when i tried to connect to 5Ghz, it couldnt connect, i also tried with particle serial wifi command in the CLI , but the 5Ghz networks just dont appear.
As of now still cant manage to, i checked a lot of post on this forum but most post about 5Ghz wifi seem to be about differentiating 2.4 from 5Ghz.
Is i even possible to connect to 5Ghz ? or am missing something obvious ?

Yes, the Photon 2 should connect to 5 GHz Wi-Fi.

What version of the Particle CLI are you using (particle --version)? Older versions of the CLI behave differently when scanning for networks.

Are you using a network where both share the same SSID, or do you have different SSIDs? Both should work.

What encryption is your 5 GHz network using? If it's using Enterprise Wi-Fi (WPA2 Enterprise or WPA3 Enterprise), then the Photon 2 will not be able to connect.

Does the network have a hidden SSID? If so, you won't be able to see it, but you can connect with new Device OS versions and an updated CLI.

2 Likes

for the particle CLI i have : 3.24.0
The network is a single SSID with multiple wifi repeaters, as for the encription it is WPA3 ( i dont think it is a WPA3 Entreprise but not 100% sure ).
The network should be strictly 5Ghz as friend with older phones cant connect to it.

I think the problem may be WPA3. There is partial support for it in Device OS 5.5.0 and later, but the other tools like the Particle CLI and setup.particle.io may not be able to see the networks yet.

2 Likes

@Firened Photon2/P2 definitely can return WAP scan and connect to 5GHz networks. I have tried a test rig on sites where we have had issues with the Photon and it can connect in those environments.
I assume you are using OS 5.8.0?

2 Likes

i do use 5.8.0 since 6.1.0 doesn't seem to support photon 2

I first tried connecting trough code, but it wouldn't connect.

WiFi.on();
Serial.println("WiFi on");
WiFi.setCredentials(ssid, password); 
WiFi.connect();

this worked on a 2.4Ghz network, so unless there is another method for 5Ghz i may be stuck here

I believe you may need to do it like this for WPA3 with Device OS 5.5.0 and later:

WiFiCredentials credentials;
credentials.setSsid("My_Router")
           .setSecurity(WPA2_WPA3_PSK)
           .setPassword("myPassword");
WiFi.setCredentials(credentials);
1 Like

It still cant connect but do you have a link to this specific documentation ? i could find it in my earlier research.

It's a pre-release feature, described in this pull request.

1 Like

LETS GOO !

with the info from the pull request, and little help from chatgpt, i can now connect !

Thank you @rickkas7 for your precious help, i will mark this subject as close and leave the script that worked in case anyone has the same problem as me:

#include "Particle.h"

SYSTEM_THREAD(ENABLED); // Enable multi-threading for responsiveness

void setup() {
    // Initialize serial communication for debugging
    Serial.begin(9600);
    while (!Serial.isConnected()) {
        // Wait for serial connection
    }
    Serial.println("Device Started!");

    // Set the channel plan for 5 GHz networks
    WiFi.selectAntenna(ANT_AUTO); // Selects the best available antenna
    WiFi.useDynamicIP(); // Ensure using dynamic IP

    // Create a WiFiCredentials object and set the credentials
    WiFiCredentials cred;
    cred.setSsid("SSID")
        .setPassword("Password")
        .setCipher(WLAN_CIPHER_AES)
        .setSecurity(spark::SecurityType::WPA3)
        .setHidden(true);

    // Set Wi-Fi credentials
    WiFi.setCredentials(cred);
    Serial.println("Credentials set, attempting to connect to WiFi");

    // Start the Wi-Fi connection
    WiFi.on();
    WiFi.connect();
    Serial.println("WiFi connect called");

    // Wait until the device is connected to Wi-Fi or timeout after 30 seconds
    unsigned long startTime = millis();
    while (!WiFi.ready() && (millis() - startTime) < 30000) {
        Serial.print(".");
        delay(500);
    }

    // Check if connected to Wi-Fi
    if (WiFi.ready()) {
        Serial.println("\nConnected to Wi-Fi!");
        Serial.print("IP Address: ");
        Serial.println(WiFi.localIP());

        // Indicate successful connection using the onboard LED
        RGB.control(true);
        RGB.color(0, 255, 0); // Green color indicates successful connection
    } else {
        Serial.println("\nFailed to connect to Wi-Fi.");
        RGB.control(true);
        RGB.color(255, 0, 0); // Red color indicates failure to connect
    }
}

void loop() {
    // Main loop does nothing in this simplified test code
}

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.