Browse Source

Option to change WiFi gain from web interface

fastled
Xose Pérez 7 years ago
parent
commit
7d56c6f07b
6 changed files with 2887 additions and 2863 deletions
  1. +3
    -0
      code/espurna/config/general.h
  2. BIN
      code/espurna/data/index.html.gz
  3. +2868
    -2863
      code/espurna/static/index.html.gz.h
  4. +1
    -0
      code/espurna/web.ino
  5. +2
    -0
      code/espurna/wifi.ino
  6. +13
    -0
      code/html/index.html

+ 3
- 0
code/espurna/config/general.h View File

@ -229,6 +229,9 @@ PROGMEM const char* const custom_reset_string[] = {
#define WIFI_RECONNECT_INTERVAL 120000 // If could not connect to WIFI, retry after this time in ms
#define WIFI_MAX_NETWORKS 5 // Max number of WIFI connection configurations
#define WIFI_AP_MODE AP_MODE_ALONE
#ifndef WIFI_GAIN
#define WIFI_GAIN 0 // WiFi gain in dBm from 0 (normal) to 20.5 (max power and consumption)
#endif
// Optional hardcoded configuration (up to 2 different networks)
//#define WIFI1_SSID "..."


BIN
code/espurna/data/index.html.gz View File


+ 2868
- 2863
code/espurna/static/index.html.gz.h
File diff suppressed because it is too large
View File


+ 1
- 0
code/espurna/web.ino View File

@ -594,6 +594,7 @@ void _wsStart(uint32_t client_id) {
}
#endif
root["wifiGain"] = getSetting("wifiGain", WIFI_GAIN).toFloat();
root["maxNetworks"] = WIFI_MAX_NETWORKS;
JsonArray& wifi = root.createNestedArray("wifi");
for (byte i=0; i<WIFI_MAX_NETWORKS; i++) {


+ 2
- 0
code/espurna/wifi.ino View File

@ -50,6 +50,8 @@ bool createAP() {
void wifiConfigure() {
WiFi.setOutputPower(getSetting("wifiGain", WIFI_GAIN).toFloat());
jw.setHostname(getSetting("hostname").c_str());
jw.setSoftAP(getSetting("hostname").c_str(), getSetting("adminPass", ADMIN_PASS).c_str());
jw.setConnectTimeout(WIFI_CONNECT_TIMEOUT);


+ 13
- 0
code/html/index.html View File

@ -392,6 +392,19 @@
<div class="pure-u-1 pure-u-sm-1-4"><input type="checkbox" name="alexaEnabled" tabindex="11" /></div>
</div>
<div class="pure-g">
<label class="pure-u-1 pure-u-md-1-4" for="wifiGain">WiFi gain</label>
<div class="pure-u-1 pure-u-md-3-4">
<select name="wifiGain" class="pure-u-3-4" tabindex="3">
<option value="0">Normal</a>
<option value="10">High</a>
<option value="20.5">Highest</a>
</select>
</div>
<div class="pure-u-0 pure-u-md-1-4">&nbsp;</div>
<div class="pure-u-1 pure-u-md-3-4 hint">More gain means better range but also more power consumption. Might not work equally on all devices.</div>
</div>
<div class="pure-g module module-ds module-dht">
<label class="pure-u-1 pure-u-sm-1-4" for="tmpUnits">Temperature units</label>
<div class="pure-u-1 pure-u-sm-1-4"><input type="radio" name="tmpUnits" tabindex="12" value="0"> Celsius (ºC)</input></div>


Loading…
Cancel
Save