Skip to content

Commit

Permalink
transmitting RSSI Wifi strength
Browse files Browse the repository at this point in the history
fix #137
  • Loading branch information
universam1 committed Feb 11, 2018
1 parent 8606730 commit 1d027d6
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 24 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Check out *IOT DEVICE PULLS ITS WEIGHT IN HOME BREWING* at http://hackaday.com/2

## News

> 09.02.2018 Firmware 5.8.0: Transmitting the Wifi strength RSSI to insight of the reception
> 07.02.2018 Firmware 5.7.1: Allow longer sleep intervals longer up to 99999s == 27 days
> 03.02.2018 Firmware 5.7.0: Introduce Factory Reset feature
> 02.02.2018 Firmware 5.6.2: Support for Wifi credentials with special characters
Expand Down
2 changes: 1 addition & 1 deletion pio/lib/Globals/Globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
extern Ticker flasher;

// defines go here
#define FIRMWAREVERSION "5.7.0"
#define FIRMWAREVERSION "5.8.0"


#define API_FHEM true
Expand Down
4 changes: 4 additions & 0 deletions pio/lib/Sender/Sender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ void SenderClass::add(String id, uint32_t value)
{
_jsonVariant[id] = value;
}
void SenderClass::add(String id, int32_t value)
{
_jsonVariant[id] = value;
}

bool SenderClass::sendTCP(String server, uint16_t port)
{
Expand Down
1 change: 1 addition & 0 deletions pio/lib/Sender/Sender.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class SenderClass
bool sendTCONTROL(String server, uint16_t port);
void add(String id, float value);
void add(String id, String value);
void add(String id, int32_t value);
void add(String id, uint32_t value);
// ~SenderClass();

Expand Down
8 changes: 1 addition & 7 deletions pio/lib/WiFiManagerKT/WiFiManagerKT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ boolean WiFiManager::startConfigPortal(char const *apName, char const *apPasswor
DEBUG_WM("Timed out connection result: ");
DEBUG_WM(getStatus(connRes));
}
server.reset();
// server.reset(); Apparently broken!
dnsServer.reset();
return WiFi.status() == WL_CONNECTED;
}
Expand Down Expand Up @@ -438,12 +438,6 @@ int WiFiManager::connectWifi(String ssid, String pass)
DEBUG_WM("Connection result: ");
DEBUG_WM(getStatus(connRes));
//not connected, WPS enabled, no pass - first attempt
if (_tryWPS && connRes != WL_CONNECTED && pass == "")
{
startWPS();
//should be connected at the end of WPS
connRes = waitForConnectResult();
}
return connRes;
}

Expand Down
19 changes: 11 additions & 8 deletions pio/src/iSpindel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ void SerialOut() { SerialOut(""); }
// callback notifying us of the need to save config
void saveConfigCallback()
{
// SerialOut(F("Should save config"));
// WiFi.setAutoReconnect(true);
shouldSaveConfig = true;
}
Expand Down Expand Up @@ -396,11 +395,12 @@ bool startConfiguration()
return false;
}

void formatSpiffs() {
SerialOut(F("\nneed to format SPIFFS: "), false);
SPIFFS.end();
SPIFFS.begin();
SerialOut(SPIFFS.format());
void formatSpiffs()
{
SerialOut(F("\nneed to format SPIFFS: "), false);
SPIFFS.end();
SPIFFS.begin();
SerialOut(SPIFFS.format());
}

bool saveConfig()
Expand All @@ -410,7 +410,7 @@ bool saveConfig()
// if SPIFFS is not usable
if (!SPIFFS.begin() || !SPIFFS.exists(CFGFILE) ||
!SPIFFS.open(CFGFILE, "w"))
formatSpiffs();
formatSpiffs();

DynamicJsonBuffer jsonBuffer;
JsonObject &json = jsonBuffer.createObject();
Expand Down Expand Up @@ -465,7 +465,9 @@ bool uploadData(uint8_t service)
sender.add("temperature", Temperatur);
sender.add("battery", Volt);
sender.add("gravity", Gravity);
SerialOut(F("\ncalling Ubidots"));
sender.add("interval", my_sleeptime);
sender.add("RSSI", WiFi.RSSI());
SerialOut(F("\ncalling Ubidots"), true);
return sender.sendUbidots(my_token, my_name);
}
#endif
Expand All @@ -483,6 +485,7 @@ bool uploadData(uint8_t service)
sender.add("battery", Volt);
sender.add("gravity", Gravity);
sender.add("interval", my_sleeptime);
sender.add("RSSI", WiFi.RSSI());

if (service == DTHTTP)
{
Expand Down
19 changes: 11 additions & 8 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,20 @@
; http://docs.platformio.org/page/projectconf.html

[platformio]
env_default = d1_mini_stage
lib_dir = pio/lib
src_dir = pio/src

; [env:d1_mini]
; platform = espressif8266
; board = d1_mini
; framework = arduino
; lib_deps =
; ArduinoJson
; ESPAsyncWebServer
; ESPAsyncTCP
[env:d1_mini]
platform = espressif8266
board = d1_mini
framework = arduino
monitor_baud = 115200
upload_speed = 921600
lib_deps =
ArduinoJson
ESPAsyncWebServer
ESPAsyncTCP

[env:d1_mini_stage]
platform = https://github.com/platformio/platform-espressif8266.git#feature/stage
Expand Down

0 comments on commit 1d027d6

Please sign in to comment.