Skip to content

Commit

Permalink
MQTT bug fix, UI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
omersiar committed Oct 7, 2018
1 parent bb8d197 commit 43584f9
Show file tree
Hide file tree
Showing 13 changed files with 82 additions and 61 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ All notable changes to this project will be documented in this file.
- [firmware] Support for RDM6300 RFID readers (125kHz, UART) #163 @arduino12
- [firmware] debug firmware for debugging purposes

#### Fixed
- [firmware] not able to connect MQTT server #157
- [firmware] a MQTT message typo #157
- [webui] some breaks on web pages
- [webui] usage of !important CSS rule

#### Changed
- [webui] scrollbar on desktop screens (now hidden)
- [webui] sidebar colors

## [0.8.2] 2018-09-05
#### Added
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,4 +213,4 @@ If this project helps you in a way, you can buy us a beer. You can make a donati
Nothing says better thank you than a donation.

## License
The code parts written by ESP-RFID project authors are licensed under [MIT License](https://github.com/esprfid/esp-rfid/blob/stable/LICENSE), 3rd party libraries that are used by this project are licensed under different license schemes, please check them out as well.
The code parts written by ESP-RFID project's authors are licensed under [MIT License](https://github.com/esprfid/esp-rfid/blob/stable/LICENSE), 3rd party libraries that are used by this project are licensed under different license schemes, please check them out as well.
4 changes: 3 additions & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[platformio]
env_default = generic
src_build_flags = !echo "-DBUILD_TAG="$TRAVIS_TAG

[common]
platform = https://github.com/platformio/platform-espressif8266.git
Expand All @@ -25,6 +24,7 @@ upload_resetmethod = nodemcu
lib_deps = ${common.lib_deps}
extra_scripts = scripts/GENdeploy.py
build_flags = -Wl,-Teagle.flash.4m.ld
src_build_flags = !echo "-DBUILD_TAG="$TRAVIS_TAG
upload_speed = 921600
monitor_speed = 115200

Expand All @@ -37,6 +37,7 @@ board = esp12e
lib_deps = ${common.lib_deps}
build_flags = -Wl,-Teagle.flash.4m.ld
-DOFFICIALBOARD
src_build_flags = !echo "-DBUILD_TAG="$TRAVIS_TAG
extra_scripts = scripts/OBdeploy.py
upload_speed = 921600
monitor_speed = 115200
Expand All @@ -50,6 +51,7 @@ board = esp12e
lib_deps = ${common.lib_deps}
build_flags = -Wl,-Teagle.flash.4m.ld
-DDEBUG
src_build_flags = !echo "-DBUILD_TAG="$TRAVIS_TAG
extra_scripts = scripts/DBGdeploy.py
upload_speed = 921600
monitor_speed = 115200
23 changes: 14 additions & 9 deletions src/config.esp
Original file line number Diff line number Diff line change
Expand Up @@ -112,25 +112,30 @@ bool ICACHE_FLASH_ATTR loadConfiguration() {
#ifdef DEBUG
Serial.println("[ INFO ] Trying to setup NTP Server");
#endif
/*
IPAddress timeserverip;
WiFi.hostByName(ntpserver, timeserverip);
String ip = printIP(timeserverip);
writeEvent("INFO", "ntp", "Connecting NTP Server", ip);
*/
NTP.Ntp(ntpserver, timeZone, ntpinter * 60);
mhs = strdup(mqtt["host"]);
mport = mqtt["port"];
const char *muser;
const char *mpas;
String muserString = mqtt["user"];
muser = strdup(muserString.c_str());
String mpasString = mqtt["pswd"];
mpas = strdup(mpasString.c_str());
mqttenabled = mqtt["enabled"];
if (mqttenabled == 1) {
#ifdef DEBUG
Serial.println("[ INFO ] Trying to setup MQTT");
#endif
mqttTopic = strdup(mqtt["topic"]);
String mhsString = mqtt["host"];
mhs = strdup(mhsString.c_str());

mport = mqtt["port"];

String muserString = mqtt["user"];
muser = strdup(muserString.c_str());
String mpasString = mqtt["pswd"];
mpas = strdup(mpasString.c_str());
String mqttTopicString = mqtt["topic"];
mqttTopic = strdup(mqttTopicString.c_str());

mqttClient.setServer(mhs, mport);
mqttClient.setCredentials(muser, mpas);
mqttClient.onDisconnect(onMqttDisconnect);
Expand Down
2 changes: 2 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ char *deviceHostname = NULL;
int mqttenabled = 0;
char *mqttTopic = NULL;
char *mhs = NULL;
char *muser = NULL;
char *mpas = NULL;
int mport;

int relayType;
Expand Down
2 changes: 1 addition & 1 deletion src/mqtt.esp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void mqtt_publish_heartbeat(time_t heartbeat) {
const char *topic = mqttTopic;
DynamicJsonBuffer jsonBuffer;
JsonObject &root = jsonBuffer.createObject();
root["type"] = "hearthbeat";
root["type"] = "heartbeat";
root["time"] = heartbeat;
String mqttBuffer4;
root.printTo(mqttBuffer4);
Expand Down
16 changes: 8 additions & 8 deletions src/webh/esprfid.htm.gz.h

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions src/webh/esprfid.js.gz.h

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/webh/index.html.gz.h

Large diffs are not rendered by default.

46 changes: 23 additions & 23 deletions src/webh/required.css.gz.h

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/websrc/3rdparty/css/sidebar.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions src/websrc/esprfid.htm
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ <h3 class="panel-title">Please wait while your ESP restarts...</h3>
<br>
<br>
<legend>General Settings</legend>
<br>
<div class="row form-group">
<label class="col-xs-3">Admin Password<i style="margin-left: 10px;" class="glyphicon glyphicon-info-sign" aria-hidden="true" data-toggle="popover" data-trigger="hover" data-placement="right" data-content="Log On password for the Administrator"></i></label>
<span class="col-xs-9 col-md-5">
Expand Down Expand Up @@ -120,7 +121,8 @@ <h3 class="panel-title">Please wait while your ESP restarts...</h3>
<br>
<br>
<legend>Hardware Settings</legend>
<h6 class="text-muted">Please refer the <a href="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/omersiar/esp-rfid#pin-layout">documentation</a> for pin configuration.</h6>
<h6 class="text-muted">Please refer the <a href="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/esprfid/esp-rfid#pin-layout">documentation</a> for pin configuration.</h6>
<br>
<div class="row form-group">
<label class="col-xs-3">Reader Type<i style="margin-left: 10px;" class="glyphicon glyphicon-info-sign" aria-hidden="true" data-toggle="popover" data-trigger="hover" data-placement="right" data-content="Choose RFID reader type."></i></label>
<div class="col-xs-9 col-md-5">
Expand Down Expand Up @@ -307,6 +309,7 @@ <h5>Please wait while fetching data...<span id="loadpages"></span></h5>
<br>
<br>
<legend>MQTT Settings</legend>
<br>
<div class="row form-group">
<label class="col-xs-3">MQTT<i style="margin-left: 10px;" class="glyphicon glyphicon-info-sign" aria-hidden="true" data-toggle="popover" data-trigger="hover" data-placement="right" data-content="Please choose if you want to enable MQTT"></i></label>
<div class="col-xs-9">
Expand Down Expand Up @@ -476,7 +479,8 @@ <h6 class="text-muted">Type your Wi-Fi Network's SSID or Scan for nerby Wireless
<br>
<br>
<legend>Time Settings</legend>
<h6 class="text-muted">Small differences between device time and local time can be ignored. Please see <a href="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/omersiar/esp-rfid#time">documentation</a> for additional information.</h6>
<h6 class="text-muted">Small differences between device time and local time can be ignored. Please see <a href="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/esprfid/esp-rfid#time">documentation</a> for additional information.</h6>
<br>
<div class="row form-group">
<label class="col-xs-3">Device Time</label>
<span id="utc" class="col-xs-9 col-md-5">
Expand Down Expand Up @@ -556,7 +560,6 @@ <h6 class="text-muted">Small differences between device time and local time can
<br>
</div>
<div id="statuscontent">
<br>
<br>
<div class="row text-center">
<div class="col-md-8 col-md-offset-2">
Expand Down
2 changes: 1 addition & 1 deletion src/websrc/js/esprfid.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var version = "0.8.2";
var version = "0.9.0";

var websock = null;
var wsUri = "ws:https://" + window.location.hostname + "/ws";
Expand Down

0 comments on commit 43584f9

Please sign in to comment.