4g mobile box connection

I managed to connect with my esp 32 card to my home VDSL WIFI and to my smart phone WIFI but it is impossible for me to connect to the wifi of this mobile box.

Welcome to the forum

Can you connect to it with your 'phone ?

1 Like

Yes I can connect to it with my phone and with my laptop.

Please post your ESP32 sketch that tries to connect to it and describe what happens

1 Like
#include <WiFi.h>

const char *ssid = "JKH";
const char *password = "123456789";

void setup() {
  Serial.begin(115200);
  delay(1000);

  Serial.println();
  Serial.println("Connexion au réseau WiFi...");

  WiFi.mode(WIFI_STA);

  // Ajustez cette valeur en fonction de vos besoins
  int txPowerLevel = 20; // Valeur en dBm

  // Convertissez la valeur numérique en wifi_power_t
  wifi_power_t powerLevel = static_cast<wifi_power_t>(txPowerLevel);

  WiFi.setTxPower(powerLevel);

  WiFi.begin(ssid, password);

  int attempts = 0;
  while (WiFi.status() != WL_CONNECTED && attempts < 20) {
    delay(500);
    Serial.print(".");
    attempts++;
  }

  if (WiFi.status() == WL_CONNECTED) {
    Serial.println("");
    Serial.println("Connexion établie avec succès!");
    Serial.print("Adresse IP attribuée: ");
    Serial.println(WiFi.localIP());
  } else {
    Serial.println("");
    Serial.println("Échec de la connexion au WiFi.");

    int status = WiFi.status();
    if (status == WL_NO_SSID_AVAIL) {
      Serial.println("Aucun réseau WiFi avec le SSID spécifié n'a été trouvé.");
    } else if (status == WL_CONNECT_FAILED) {
      Serial.println("Échec de l'authentification avec le réseau WiFi.");
    } else if (status == WL_CONNECTION_LOST) {
      Serial.println("La connexion WiFi a été perdue.");
    } else if (status == WL_DISCONNECTED) {
      Serial.println("Déconnexion du réseau WiFi.");
    } else {
      Serial.println("Statut de la connexion inconnu.");
    }
  }
}

void loop() {
  // Votre code ici
}

on the monitor I got this response :
Connexion au réseau WiFi...

....................

Échec de la connexion au WiFi.

Aucun réseau WiFi avec le SSID spécifié n'a été trouvé.

Solved : i used this rong ssid : "Ooredoo_M30_6193" the right one is "Ooredoo _M30_6193" ( ther are aspace between the "o" and the _" )
thank you.......

1 Like

Good to know that it's working. You can mark this question as 'solved' now.

1 Like