Skip to content

Commit

Permalink
fix hostname = "emonesp" http://emonesp now works, fix MQTT rapi, fix…
Browse files Browse the repository at this point in the history
… firmwarware update by slowing down RAPI updates to 5s
  • Loading branch information
glynhudson committed Feb 27, 2017
1 parent c691243 commit 7cf4a90
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/src.ino
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@
#include "wifi.h"
#include "web_server.h"
#include "ohm.h"
//#include "ota.h"
#include "input.h"
#include "emoncms.h"
#include "mqtt.h"

unsigned long Timer1; // Timer for events once every 30 seconds
unsigned long Timer2; // Timer for events once every 1 Minute
unsigned long Timer3; // Timer for events once every 5 seconds

// -------------------------------------------------------------------
// SETUP
Expand Down Expand Up @@ -86,13 +86,19 @@ void setup() {
void loop(){
//ota_loop();
web_server_loop();
update_rapi_values();
wifi_loop();
if (mqtt_server !=0) mqtt_loop();


if (wifi_mode==WIFI_MODE_STA || wifi_mode==WIFI_MODE_AP_AND_STA){
// -------------------------------------------------------------------
// Do these things once every 5s
// -------------------------------------------------------------------
if ((millis() - Timer3) >= 5000){
update_rapi_values();
Timer3 = millis();
}
// -------------------------------------------------------------------
// Do these things once every Minute
// -------------------------------------------------------------------
if ((millis() - Timer2) >= 60000){
Expand Down
1 change: 1 addition & 0 deletions src/wifi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ void startClient() {
DEBUG.println(esid.c_str());
// DEBUG.print(" epass:");
// DEBUG.println(epass.c_str());
WiFi.hostname("openevse");
WiFi.begin(esid.c_str(), epass.c_str());

delay(50);
Expand Down

0 comments on commit 7cf4a90

Please sign in to comment.