Get boardmanager package version and SDK version into sketch
Posted:
Wed Nov 18, 2015 3:28 pm
by mvdbro
I'm looking for a way to get the arduino IDE ESP package version and option SDK version into the sketch so it can be shown on the main info page on the ESP. With so many ESP's laying around and more and more users to support, it could be handy to quickly get info about the used compiler package version.
Demo output should be something like this in the webpage:
Compiler used: Arduino 1.6.5
ESP core package used: 1.6.5-1084-ga39ce29
Expressif SDK version: 1.3
Does anyone know if this can be done and which system calls or defines to use?
Re: Get boardmanager package version and SDK version into sk
Posted:
Wed Nov 18, 2015 5:20 pm
by GengusKahn
Hi there,
the following page uses most of the specific SDK commands for feedback........
Code: Select all else if(sPath=="/diag")
{
float servolt1 = ESP.getVcc();
long int spdcount = ESP.getCycleCount();
delay(1);
long int spdcount1 = ESP.getCycleCount();
long int speedcnt = spdcount1-spdcount;
FlashMode_t ideMode = ESP.getFlashChipMode();
ulReqcount++;
String duration1 = " ";
int hr,mn,st;
st = millis() / 1000;
mn = st / 60;
hr = st / 3600;
st = st - mn * 60;
mn = mn - hr * 60;
if (hr<10) {duration1 += ("0");}
duration1 += (hr);
duration1 += (":");
if (mn<10) {duration1 += ("0");}
duration1 += (mn);
duration1 += (":");
if (st<10) {duration1 += ("0");}
duration1 += (st);
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println("Connection: close");
client.println();
client.println("<!DOCTYPE HTML>");
client.print("<html><head><title>Webpage NeoPixel Controller</title></head><body>");
client.print("<font color=\"#000000\"><body bgcolor=\"#a0dFfe\">");
client.print("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=yes\">");
client.print("<h1>Neopixel Control<BR>SDK Diagnostic Information</h1>");
client.print("<BR><a href=\"/\">Pixel Control Page</a><BR>");
String diagdat="";
// diagdat+=ulReconncount;
diagdat+="<BR> Web Page Requests = ";
diagdat+=ulReqcount;
diagdat+="<BR> WiFi AP Hostname = ";
diagdat+=host;
diagdat+="<BR> Free RAM = ";
client.print(diagdat);
client.print((uint32_t)system_get_free_heap_size()/1024);
// diagdat=" KBytes<BR> Logged Sample Count = ";
// diagdat+=ulMeasCount;
diagdat=" KBytes<BR> SDK Version = ";
diagdat+=ESP.getSdkVersion();
diagdat+="<BR> Boot Version = ";
diagdat+=ESP.getBootVersion();
diagdat+="<BR> Free Sketch Space = ";
diagdat+=ESP.getFreeSketchSpace()/1024;
diagdat+=" KBytes<BR> Sketch Size = ";
diagdat+=ESP.getSketchSize()/1024;
diagdat+=" KBytes<BR>";
client.print(diagdat);
client.printf(" Flash Chip id = %08X\n", ESP.getFlashChipId());
client.print("<BR>");
client.printf(" Flash Chip Mode = %s\n", (ideMode == FM_QIO ? "QIO" : ideMode == FM_QOUT ? "QOUT" : ideMode == FM_DIO ? "DIO" : ideMode == FM_DOUT ? "DOUT" : "UNKNOWN"));
diagdat="<BR> Flash Size By ID = ";
diagdat+=ESP.getFlashChipRealSize()/1024;
diagdat+=" KBytes<BR> Flash Size (IDE) = ";
diagdat+=ESP.getFlashChipSize()/1024;
diagdat+=" KBytes<BR> Flash Speed = ";
diagdat+=ESP.getFlashChipSpeed()/1000000;
diagdat+=" MHz<BR> ESP8266 CPU Speed = ";
diagdat+=ESP.getCpuFreqMHz();
diagdat+=" MHz<BR>";
client.print(diagdat);
client.printf(" ESP8266 Chip id = %08X\n", ESP.getChipId());
diagdat="<BR> System Instruction Cycles Per Second = ";
diagdat+=speedcnt*1000;
diagdat+="<BR> Last System Restart Reason = ";
diagdat+=ESP.getResetInfo();
diagdat+="<BR> System VCC = ";
diagdat+=servolt1/1000, 3;
diagdat+=" V <BR> Datalog File Size in Bytes = N/A";
//diagdat+=Dfsize;
diagdat+="<BR> System Uptime =";
diagdat+=duration1;
client.print(diagdat);
client.print("<BR><FONT SIZE=-2>environmental.monitor.log@gmail.com<BR><FONT SIZE=-2>ESP8266 With 40 WS2812B 5050 LED's<BR><FONT SIZE=-2>Compiled Using ver. 1.6.5-1160-gef26c5f, built on Sep 30, 2015<BR>");
client.println("<IMG SRC=\"https://raw.githubusercontent.com/genguskahn/ESP8266-For-DUMMIES/master/SoC/DimmerDocs/organicw.gif\" WIDTH=\"250\" HEIGHT=\"151\" BORDER=\"1\"></body></html>");
diagdat = "";
duration1 = "";
}
Re: Get boardmanager package version and SDK version into sk
Posted:
Thu Nov 19, 2015 6:19 am
by eduperez
GengusKahn wrote:Hi there,
the following page uses most of the specific SDK commands for feedback........
[...]
Thanks, much appreciated.