Skip to content

Commit

Permalink
Support for old config and feature in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
matjack1 committed Nov 7, 2023
1 parent 104a4d6 commit 2191b6e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ All notable changes to this project will be documented in this file.
- [firmware] Added button to open door and door status pin @nardev

#### Changed
- [firmware] Changed timezone support to add daylight saving management #604 @matjack1
- [firmware] Refactor WiFi connection #495 #497 #536 @matjack1
- Option to disable access point mode for production usage
- Automatic retries when connection drops
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ You can integrate ESP-RFID with other systems using MQTT. Read the [additional d
* Please also check [GitHub issues](https://github.com/esprfid/esp-rfid/issues).

#### Time
We are syncing time from a NTP Server (in Client -aka infrastructure- Mode). This will require ESP to have an Internet connection. Additionally your ESP can also work without Internet connection too (Access Point -aka Ad-Hoc- Mode), without giving up functionality.
This will require you to do syncing manually. ESP can store and hold time for you approximately 51 days without a major issue, device time can drift from actual time depending on usage, temperature, etc.
So you have to login to settings page and sync it in a timely fashion.
We are syncing time from a NTP Server (in Client -aka infrastructure- Mode). This will require ESP to have an Internet connection. Additionally your ESP can also work without Internet connection (Access Point -aka Ad-Hoc- Mode), without giving up functionality.
This will require you to sync time manually. ESP can store and hold time for you approximately 51 days without major issues, device time can drift from actual time depending on usage, temperature, etc. so you have to login to settings page and sync it in a timely fashion.
Timezones are supported with automatic switch to and from daylight saving time.

## **Security**
We assume **ESP-RFID** project -as a whole- does not offer strong security. There are PICCs available that their UID (Unique Identification Numbers) can be set manually (Currently esp-rfid relies only UID to identify its users). Also there may be a bug in the code that may result free access to your belongings. And also, like every other network connected device esp-rfid is vulnerable to many attacks including Man-in-the-middle, Brute-force, etc.
Expand Down
17 changes: 17 additions & 0 deletions src/config.esp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,23 @@ bool ICACHE_FLASH_ATTR loadConfiguration(Config &config)
{
config.tzInfo = strdup(ntp["tzinfo"]);
}
// support for old config
if (ntp.containsKey("timezone"))
{
float tz = ntp["timezone"];
if(tz > 0)
{
sprintf(config.tzInfo, "UTC+%f", tz);
}
else if(tz < 0)
{
sprintf(config.tzInfo, "UTC-%f", tz);
}
else
{
sprintf(config.tzInfo, "UTC");
}
}
config.activateTime[0] = hardware["rtime"];
config.lockType[0] = hardware["ltype"];
config.relayType[0] = hardware["rtype"];
Expand Down

0 comments on commit 2191b6e

Please sign in to comment.