Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/FablabLannion/Trender
Browse files Browse the repository at this point in the history
  • Loading branch information
cebernard22 committed May 8, 2017
2 parents 2664aa0 + a008d66 commit 550e8c6
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 53 deletions.
39 changes: 0 additions & 39 deletions variantes/jenkins/OPNFV/code/v2/credential.h

This file was deleted.

45 changes: 31 additions & 14 deletions variantes/jenkins/OPNFV/code/v2/opnfv.ino
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,33 @@ ESP8266WebServer server(80);
// ***********************************************************
void setup() {
EEPROM.begin(512);

// init LEDs
pixels.begin();

// Init
WiFi.persistent(false);
Serial.begin(115200);
Serial.println();
Serial.printf ("\n\n%s\n", VERSION);

int check_eprom = wicoReadWifiConfig (0, ssid, pwd, installer, opnfv_version);

// Wifi setup
if (wicoReadWifiConfig (0, ssid, pwd, installer, opnfv_version) ==1) {
if (check_eprom != 1 or ssid == "") {
Serial.println("Setup Wifi");
setupWifi();
delay(500);
ledCheck();
} else {
Serial.println("SSID retrieved:");
Serial.println(ssid);
Serial.println("PWD retrieved:****************");
Serial.println("Installer retrieved:");
Serial.println(installer);
Serial.println("OPNFV Version retrieved:");
Serial.println(opnfv_version);
} else {
Serial.println("Setup Wifi");
setupWifi();
Serial.println(opnfv_version);
delay(500);
}

IPAddress my_ip = wicoSetupWifi(ssid, pwd);
Expand All @@ -81,10 +89,9 @@ void setup() {
while ( my_ip == IPAddress(0,0,0,0) ){
Serial.println("IP address not valid");
Serial.println("Clean EEprom");
wicoResetWifiConfig(0);
Serial.println("Setup local AP to get SSID");
setupWifi();
delay(500);
delay(2000);
Serial.println("Read EEprom values");
wicoReadWifiConfig (0, ssid, pwd, installer, opnfv_version);
my_ip = wicoSetupWifi(ssid, pwd);
Expand All @@ -93,13 +100,11 @@ void setup() {

Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.print("IP address: ");
Serial.println(WiFi.localIP());

// init LEDs
pixels.begin();

}
Serial.println("");
delay(500);
}

// ***********************************************************
// ***********************************************************
Expand Down Expand Up @@ -172,7 +177,7 @@ void setupWifi (void) {
server.onNotFound ( handleNotFound );
server.begin();
Serial.println("HTTP server started");

Serial.println("");
}


Expand Down Expand Up @@ -344,6 +349,18 @@ void ledManagement(int res){
delay(10000);
}

void ledCheck(){
Serial.println("Run red led sequence");
clignotement(255,64,64,10);
Serial.println("Run green led sequence");
clignotement(0,100,0,10);
Serial.println("Run yellow led sequence");
clignotement(255,255,0,10);
Serial.println("Clignotement bleu");
clignotement(0,255,255,10);
extinction();
}

/*
* digital clock for the timestamp
*/
Expand Down

0 comments on commit 550e8c6

Please sign in to comment.