Arduino MKR Wifi 1010 won't connect to hotspot when it's unplugged

I'm trying to connect MKR Wifi 1010 to my mobile phone,
When I've plug the MKR Wifi 1010 with my laptop, it connect immediatly with my hotspot. But when I unplug the MKR Wifi 1010 it not connect to my hotspot.
How can I resolve this problem?
Thanking in advance,
Regards

plug a power supply ? :innocent:

show us the source code ? (do you block until the Serial line is activated for example?)

Obviously it's connected to a power supply, but with a battery in Vin and GND pin.
The code is:

/*
 * Codice Arduino MKR WiFi per far funzionare le comunicazioni WiFi tra il programma in Java e il programma in Arduino  
 * @version 1.0
 */

#include <ArduinoHttpClient.h>
#include <WiFiNINA.h>

/////// WiFi Settings ///////
char ssid[] = "ssid-hotspot";
char pass[] = "psw-hotspot";

char serverAddress[] = "ip-laptop";  // server address
int port = 8025;

WiFiClient wifi;
WebSocketClient client = WebSocketClient(wifi, serverAddress, port);
int status = WL_IDLE_STATUS;
int count = 0;

/*
 * Funzione setup per l'inizializzazione delle variabili, il settaggio dei pin e il settaggio del WiFi
 */
void setup() {
  Serial.begin(9600);
  //pinMode(TX,OUTPUT);
  //pinMode(RX,INPUT);
  while ( status != WL_CONNECTED) {
    Serial.print("Attempting to connect to Network named: ");
    Serial.println(ssid);                   // print the network name (SSID);

    // Connect to WPA/WPA2 network:
    status = WiFi.begin(ssid, pass);
  }

  // print the SSID of the network you're attached to:
  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());

  // print your WiFi shield's IP address:
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  Serial.println(ip);
}


/*
 * Funzione che fa funzionare l'intero programma fintantochè il dispositivo è connesso al WiFi
 */
void loop() {
  Serial.println("starting WebSocket client");
  client.begin();

  while (client.connected()) {
     Serial.print("Sending hello ");
    Serial.println(count);

    // send a hello #
    client.beginMessage(TYPE_TEXT);
    client.print("hello ");
    client.print(count);
    client.endMessage();

    // increment count for next message
    count++;


    // check if a message is available to be received
    int messageSize = client.parseMessage();

    if (messageSize > 0) {
      Serial.println("Received a message:");
      String a = client.readString();
      Serial.write(a.c_str());
    }
    // wait 5 seconds
    delay(5000);
  }

  Serial.println("disconnected");
}

How much current can you draw from that battery?

about 3,6V. I use rechargable battery from 1,2V.
But I don't think this it's the problem because the led for the battery on MKR Wifi 1010 are turned on

Current, not voltage
Wifi requires significant current (more than a led)

uhm at the moment I don't know that, my friend have the project...
But you know how is? Tomorrow when I'm going to see they I'll check.

Do you know the exact type of batteries ?

I use the "Energizer Recharge" battery, I see they are 2000mAh, so for 3 of them are 6000mAh

Now, I have tried with 4 batteries and now work.
Thanks so much

Glad to hear

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