diff --git a/platformio.ini b/platformio.ini
index a4a4e87..9a01854 100644
--- a/platformio.ini
+++ b/platformio.ini
@@ -31,6 +31,7 @@ platform = espressif8266@1.8.0
framework = arduino
build_flags = !echo "-DPIO_SRC_REV="$(git rev-parse HEAD) "-DPIO_BUILD_DATE="$(date +%%Y-%%m-%%d) "-DPIO_BUILD_TIME="$(date +%%H:%%M:%%S) ${version_env.version_flags}
extra_scripts = pre:platformio_prebuild.py
+upload_speed = 921600
# Platform specific settings
@@ -41,5 +42,5 @@ build_flags = ${env.build_flags} -Wl,-Tesp8266.flash.4m.ld
[env:esp01_1m]
board = esp01_1m
-[env:esp01]
-board = esp01
+[env:esp8285]
+board = esp8285
diff --git a/src/mavesp8266_httpd.cpp b/src/mavesp8266_httpd.cpp
index efcb286..e9beb1a 100644
--- a/src/mavesp8266_httpd.cpp
+++ b/src/mavesp8266_httpd.cpp
@@ -47,7 +47,7 @@ const char PROGMEM kTEXTPLAIN[] = "text/plain";
const char PROGMEM kTEXTHTML[] = "text/html";
const char PROGMEM kACCESSCTL[] = "Access-Control-Allow-Origin";
const char PROGMEM kUPLOADFORM[] = "
Name | Value |
";
for(int i = 0; i < MavESP8266Parameters::ID_COUNT; i++) {
- message += "";
- message += getWorld()->getParameters()->getAt(i)->id;
- message += " | ";
- unsigned long val = 0;
- if(getWorld()->getParameters()->getAt(i)->type == MAV_PARAM_TYPE_UINT32)
- val = (unsigned long)*((uint32_t*)getWorld()->getParameters()->getAt(i)->value);
- else if(getWorld()->getParameters()->getAt(i)->type == MAV_PARAM_TYPE_UINT16)
- val = (unsigned long)*((uint16_t*)getWorld()->getParameters()->getAt(i)->value);
- else
- val = (unsigned long)*((int8_t*)getWorld()->getParameters()->getAt(i)->value);
- message += "";
- message += val;
- message += " |
";
+ if(i == getWorld()->getParameters()->ID_FWVER)
+ {
+ message += "";
+ message += getWorld()->getParameters()->getAt(i)->id;
+ message += " | ";
+ message += "";
+ message += MAVESP8266_VERSION_MAJOR;
+ message += ".";
+ message += MAVESP8266_VERSION_MINOR;
+ message += ".";
+ message += MAVESP8266_VERSION_BUILD;
+ message += " |
";
+ }
+ else if(i == getWorld()->getParameters()->ID_MODE)
+ {
+ message += "";
+ message += getWorld()->getParameters()->getAt(i)->id;
+ message += " | ";
+ message += "";
+ if(getWorld()->getParameters()->getWifiMode() == WIFI_MODE_AP)
+ {
+ message += "AP";
+ }
+ else
+ {
+ message += "STA";
+ }
+ message += " |
";
+ }
+ else if(i == getWorld()->getParameters()->ID_IPADDRESS)
+ {
+ message += "";
+ message += getWorld()->getParameters()->getAt(i)->id;
+ message += " | ";
+ message += "";
+ message += getWorld()->getParameters()->getLocalIPAddressInString();
+ message += " |
";
+ }
+ else if(i == getWorld()->getParameters()->ID_SSID1)
+ {
+ message += "";
+ message += getWorld()->getParameters()->getAt(i)->id;
+ message += " | ";
+ message += "";
+ message += getWorld()->getParameters()->getWifiSsid();
+ message += " |
";
+ }
+ else if(i > getWorld()->getParameters()->ID_SSID1 && i <= getWorld()->getParameters()->ID_SSID4) {}
+ else if(i == getWorld()->getParameters()->ID_PASS1)
+ {
+ message += "";
+ message += getWorld()->getParameters()->getAt(i)->id;
+ message += " | ";
+ message += "";
+ message += getWorld()->getParameters()->getWifiPassword();
+ message += " |
";
+ }
+ else if(i > getWorld()->getParameters()->ID_PASS1 && i <= getWorld()->getParameters()->ID_PASS4) {}
+ else if(i == getWorld()->getParameters()->ID_SSIDSTA1)
+ {
+ message += "";
+ message += getWorld()->getParameters()->getAt(i)->id;
+ message += " | ";
+ message += "";
+ message += getWorld()->getParameters()->getWifiStaSsid();
+ message += " |
";
+ }
+ else if(i > getWorld()->getParameters()->ID_SSIDSTA1 && i <= getWorld()->getParameters()->ID_SSIDSTA4) {}
+ else if(i == getWorld()->getParameters()->ID_PASSSTA1)
+ {
+ message += "";
+ message += getWorld()->getParameters()->getAt(i)->id;
+ message += " | ";
+ message += "";
+ message += getWorld()->getParameters()->getWifiStaPassword();
+ message += " |
";
+ }
+ else if(i > getWorld()->getParameters()->ID_PASSSTA1 && i <= getWorld()->getParameters()->ID_PASSSTA4) {}
+ else // integer values
+ {
+ message += "";
+ message += getWorld()->getParameters()->getAt(i)->id;
+ message += " | ";
+ unsigned long val = 0;
+ if(getWorld()->getParameters()->getAt(i)->type == MAV_PARAM_TYPE_UINT32)
+ val = (unsigned long)*((uint32_t*)getWorld()->getParameters()->getAt(i)->value);
+ else if(getWorld()->getParameters()->getAt(i)->type == MAV_PARAM_TYPE_UINT16)
+ val = (unsigned long)*((uint16_t*)getWorld()->getParameters()->getAt(i)->value);
+ else
+ val = (unsigned long)*((int8_t*)getWorld()->getParameters()->getAt(i)->value);
+
+ message += "";
+ message += val;
+ message += " |
";
+ }
}
message += "
";
message += "";
diff --git a/src/mavesp8266_parameters.cpp b/src/mavesp8266_parameters.cpp
index 3062198..bec0404 100644
--- a/src/mavesp8266_parameters.cpp
+++ b/src/mavesp8266_parameters.cpp
@@ -58,13 +58,15 @@ uint32_t _wifi_ip_address;
char _wifi_ssid[16];
char _wifi_password[16];
char _wifi_ssidsta[16];
-char _wifi_passwordsta[16];
+char _wifi_passwordsta[32];
uint32_t _wifi_ipsta;
uint32_t _wifi_gatewaysta;
uint32_t _wifi_subnetsta;
uint32_t _uart_baud_rate;
uint32_t _flash_left;
+String _wifi_ip_addr_string;
+
//-- Parameters
// No string support in parameters so we stash a char[16] into 4 uint32_t
struct stMavEspParameters mavParameters[] = {
@@ -91,6 +93,10 @@ uint32_t _flash_left;
{"WIFI_PWDSTA2", &_wifi_passwordsta[4], MavESP8266Parameters::ID_PASSSTA2, sizeof(uint32_t), MAV_PARAM_TYPE_UINT32, false},
{"WIFI_PWDSTA3", &_wifi_passwordsta[8], MavESP8266Parameters::ID_PASSSTA3, sizeof(uint32_t), MAV_PARAM_TYPE_UINT32, false},
{"WIFI_PWDSTA4", &_wifi_passwordsta[12], MavESP8266Parameters::ID_PASSSTA4, sizeof(uint32_t), MAV_PARAM_TYPE_UINT32, false},
+ {"WIFI_PWDSTA5", &_wifi_passwordsta[16], MavESP8266Parameters::ID_PASSSTA5, sizeof(uint32_t), MAV_PARAM_TYPE_UINT32, false},
+ {"WIFI_PWDSTA6", &_wifi_passwordsta[20], MavESP8266Parameters::ID_PASSSTA6, sizeof(uint32_t), MAV_PARAM_TYPE_UINT32, false},
+ {"WIFI_PWDSTA7", &_wifi_passwordsta[24], MavESP8266Parameters::ID_PASSSTA7, sizeof(uint32_t), MAV_PARAM_TYPE_UINT32, false},
+ {"WIFI_PWDSTA8", &_wifi_passwordsta[28], MavESP8266Parameters::ID_PASSSTA8, sizeof(uint32_t), MAV_PARAM_TYPE_UINT32, false},
{"WIFI_IPSTA", &_wifi_ipsta, MavESP8266Parameters::ID_IPSTA, sizeof(uint32_t), MAV_PARAM_TYPE_UINT32, false},
{"WIFI_GATEWAYSTA", &_wifi_gatewaysta, MavESP8266Parameters::ID_GATEWAYSTA,sizeof(uint32_t), MAV_PARAM_TYPE_UINT32, false},
{"WIFI_SUBNET_STA", &_wifi_subnetsta, MavESP8266Parameters::ID_SUBNETSTA, sizeof(uint32_t), MAV_PARAM_TYPE_UINT32, false},
@@ -152,6 +158,10 @@ uint32_t MavESP8266Parameters::getWifiStaGateway () { return _wifi_gatewaysta
uint32_t MavESP8266Parameters::getWifiStaSubnet () { return _wifi_subnetsta; }
uint32_t MavESP8266Parameters::getUartBaudRate () { return _uart_baud_rate; }
+String MavESP8266Parameters::getLocalIPAddressInString()
+{
+ return(_wifi_ip_addr_string);
+}
//---------------------------------------------------------------------------------
//-- Reset all to defaults
void
diff --git a/src/mavesp8266_parameters.h b/src/mavesp8266_parameters.h
index e613552..cfb1602 100644
--- a/src/mavesp8266_parameters.h
+++ b/src/mavesp8266_parameters.h
@@ -85,6 +85,10 @@ class MavESP8266Parameters {
ID_PASSSTA2,
ID_PASSSTA3,
ID_PASSSTA4,
+ ID_PASSSTA5,
+ ID_PASSSTA6,
+ ID_PASSSTA7,
+ ID_PASSSTA8,
ID_IPSTA,
ID_GATEWAYSTA,
ID_SUBNETSTA,
@@ -113,6 +117,8 @@ class MavESP8266Parameters {
uint32_t getWifiStaSubnet ();
uint32_t getUartBaudRate ();
+ String getLocalIPAddressInString ();
+
void setDebugEnabled (int8_t enabled);
void setWifiMode (int8_t mode);
void setWifiChannel (uint32_t channel);