Sketch won't work when usb cable disconnected.

Hi blynk! I have a problem.
I am using Intel Edison and Blynk Wifi. I have created a local server on my edison and connects it to my router then of course my smartphone too, so they’re now in the same network. I am able to control on/off the relays connected to edison but only if I have not disconnected the usb cable to my laptop.
If I disconnected the usb after uploading the code, the sketch won’t work, and my smartphone blynk app always tells me that “Intel Edison is not connected” something like that, but if I connect again the usb cable to my laptop then upload the code back, it will work again.
Do you have any idea to solve this? well I tried also connecting rx and tx and other options but still not solve.

thank you :slight_smile:

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <WiFi.h>
#include <BlynkSimpleIntelEdisonWiFi.h>
 
 
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "459777816b034c278f6adccc243d6398";
 
// Your WiFi credentials
char ssid[] = "Arduino_Server";
char pass[] = "happylol56";        // Set to "" for open networks
 
 
const int relaypin1 =  4;   //the Relay1 is attached to D4
const int relaypin2 =  5;   //the Relay1 is attached to D5
const int relaypin3 =  6;   //the Relay1 is attached to D6
const int relaypin4 =  7;   //the Relay1 is attached to D7
//const int ledpin   =  3;    //The LED module is attached to D3
 
 
 
void setup()
{
  Serial.begin(115200);
  //Blynk.begin(auth, ssid, pass);
  Blynk.begin(auth, ssid, pass, IPAddress(192,168,146,102));
 
    pinMode(13, OUTPUT); //for led test
    pinMode(relaypin1, OUTPUT); //sets relay to output
    pinMode(relaypin2, OUTPUT); //sets relay to output
    pinMode(relaypin3, OUTPUT); //sets relay to output
    pinMode(relaypin4, OUTPUT); //sets relay to output
   
 
   
}
 
 
 
void loop()
{
  Blynk.run();
 
 
}

Try to comment out "serial.begin" and all other serial related stuff.

I guess you also have a suitable power source other than the usb plug?