Skip to content

Commit

Permalink
Update documentation for v2
Browse files Browse the repository at this point in the history
  • Loading branch information
matjack1 committed Nov 7, 2023
1 parent 3f03c33 commit d16a310
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 65 deletions.
13 changes: 10 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,19 @@ All notable changes to this project will be documented in this file.
- [firmware] MQTT endpoints have been changed to be more consistent and complete #501 @matjack1

#### Added
- [webui] Improvoed support for websocket reconnection #502 @matjack1
- [firmware] Moved to native Arduino support for timezone and NTP to support daylight saving time #604 @matjack1
- [firmware] Added door name, to send via MQTT access type and door name for setups with multiple doors #598 @matjack1
- [firmware] Added more options for Wiegand readers on which bits to read #582 @matjack1
- [firmware] Added support for MQTT auto-topic with topic postfixed with 6 characters from MAC address #566 @matjack1
- [firmware] Added support to read/write configuration via MQTT #565 @matjack1
- [firmware] Added valid-since date for user validity #562 @matjack1
- [firmware] Added support for pincode only option to open door #551 @matjack1
- [webui] Improved support for websocket reconnection #502 @matjack1
- [firmware] Added opening hours with an hourly granularity #499 @matjack1
- [firmware] Added LED to signal that we are waiting for pincode and beeper support #490 @matjack1
- beeper for valid, denied or admin access
- [firmware] Added different pincode for each user after a card swipe #477 @matjack1
- [firmware] Improvements in MQTT including AutoDiscovery for the Home Assistant #449 @xyzroe
- [firmware] Improvements in MQTT including AutoDiscovery for the Home Assistant #449 #559 @xyzroe
- [firmware] Added anti-tamper support #449 @xyzroe
- [firmware] Added pin to give users feedback when access denied #426 @matjack1
- [firmware] Added ability to delete a single user over MQTT via UID #424 @baden02
Expand All @@ -30,7 +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] Refactor WiFi connection #495 #497 @matjack1
- [firmware] Refactor WiFi connection #495 #497 #536 @matjack1
- Option to disable access point mode for production usage
- Automatic retries when connection drops
- [firmware] Refactor configuration #485 @matjack1
Expand Down
52 changes: 52 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# How to contributo to esp-rfid

If you want to contribute, first of all, thank you very much!

## If you want to contribute some code

### Bug fix

In case of a bug fix you can open a PR on the `stable` branch.


### New feature

For new features please open a PR on the `dev` branch which will be merged on `stable` when a new release will be launched.

Remember to add documentation in the main readme and in the changelog. If MQTT is affected, please also update the README-MQTT.md file.

When touching the configuration file, you should make sure that the old file will be supported by the new version and that your feature should work also with the old config file format.

### Frontend

You cannot simply edit Web UI files because you will need to convert them to C arrays, which can be done automatically by a gulp script that can be found in tools directory or you can use compiled executables at the same directory as well (for Windows PCs only).

If you want to edit esp-rfid's Web UI you will need (unless using compiled executables):
* NodeJS
* npm (comes with NodeJS installer)
* Gulp (can be installed with npm)

Gulp script also minifies HTML and JS files and compresses (gzip) them.

To minify and compress the frontend, enter the folder ```tools/webfilesbuilder``` and:
* Run ```npm install``` to install dependencies
* Run ```npm start``` to compress the web UI to make it ready for the ESP

In order to test your changes without flashing the firmware you can launch websocket emulator which is included in tools directory.
* You will need to Node JS for websocket emulator.
* Run ```npm install``` to install dependencies
* Run emulator ```node wserver.js```

There are two alternative ways to test the UI
1. you can launch your browser with CORS disabled:
```chrome.exe --args --disable-web-security -–allow-file-access-from-files --user-data-dir="C:\Users\USERNAME"```
and then open the HTML files directly (Get more information [here](https://stackoverflow.com/questions/3102819/disable-same-origin-policy-in-chrome))
2. alternatively, you can launch a web server from the ```src/websrc``` folder, for example with Python, like this:
```python3 -m http.server```
and then visit ```https://0.0.0.0:8000/```

When testing locally, use the password ```neo``` for admin capabilities.

## TODO

Explain more ways to help that are not code-related
26 changes: 24 additions & 2 deletions README-MQTT.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This has been added so far:
## Broker settings
You can add all the broker details in the web UI:

![MQTT settings](./demo/mqtt-settings.png)
![MQTT settings](./demo/mqtt-settings.png) <- to update

## Using MQTT Topics
For the MQTT communication some additional TOPICs have been added internally. The default Topic is configured in the web UI. If you use more then one device, every device should have the same `TOPIC` name configured. All MQTT communication is done with JSON Payload as MQTT Message.
Expand All @@ -35,6 +35,12 @@ TOPIC---+---/send
* /rfid/send
* /rfid/cmd

### Auto-topic

If auto-topic option is selected, esp-rfid will add the last 6 characters from the device MAC address to the MQTT topic.

This can be useful to deploy a batch of esp-rfid in one go. By knowing the MAC addresses in advance you can setup them all with a standard configuration and each one will talk on a separate topic.

## Commands received by ESP-RFID
The message format is JSON.

Expand Down Expand Up @@ -260,7 +266,8 @@ If the UID is in the users list, there can be a set of possible "access" configu
"access":"the access state",
"username":"username",
"uid":"token UID",
"hostname":"your esp-rfid hostname"
"hostname":"your esp-rfid hostname",
"doorName":"your door name"
}
```
If instead the UID is not present in the users list the message will be:
Expand Down Expand Up @@ -291,6 +298,21 @@ If the tag is unknown the message will be different:
}
```

In case of multiple doors managed by one esp-rfid, you'll get an array for doorname and for access:

```
{
"type":"access",
"time":1605991375,
"isKnown":"true",
"access":["the access state door 1", "access state door 2"],
"username":"username",
"uid":"token UID",
"hostname":"your esp-rfid hostname",
"doorName":["door 1", "door 2"]
}
```

### Log messages
Besides the above messages, ESP-RFID can send all the logs via MQTT instead of storing those locally. If this is enabled via the web UI, also the following messages are sent.

Expand Down
71 changes: 12 additions & 59 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# ESP RFID - Access Control with ESP8266, RC522 PN532 Wiegand RDM6300

[![Chat at https://gitter.im/esp-rfid/Lobby](https://badges.gitter.im/esp-rfid.svg)](https://gitter.im/esp-rfid/Lobby) [![Backers on Open Collective](https://opencollective.com/esp-rfid/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/esp-rfid/sponsors/badge.svg)](#sponsors) [![Bountysource](https://api.bountysource.com/badge/team?team_id=242217)](https://salt.bountysource.com/checkout/amount?team=esp-rfid)
[![Chat at https://gitter.im/esp-rfid/Lobby](https://badges.gitter.im/esp-rfid.svg)](https://gitter.im/esp-rfid/Lobby) [![Backers on Open Collective](https://opencollective.com/esp-rfid/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/esp-rfid/sponsors/badge.svg)](#sponsors)

Access Control system using a cheap MFRC522, PN532 RFID, RDM6300 readers or Wiegand RFID readers and Espressif's ESP8266 Microcontroller.

[![Showcase Gif](https://raw.githubusercontent.com/esprfid/esp-rfid/stable/demo/showcase.gif)](https://bitadvise.com/esp-rfid/)[![Board](https://raw.githubusercontent.com/esprfid/esp-rfid/stable/demo/board.jpg)](https://www.tindie.com/products/nardev/esp-rfid-relay-board-12v-in-esp8266-board/)
![Showcase Gif](https://raw.githubusercontent.com/esprfid/esp-rfid/stable/demo/showcase.gif)[![Board](https://raw.githubusercontent.com/esprfid/esp-rfid/stable/demo/board.jpg)](https://www.tindie.com/products/nardev/esp-rfid-relay-blue-board/)

## Features
### For Users
Expand Down Expand Up @@ -36,7 +36,7 @@ Access Control system using a cheap MFRC522, PN532 RFID, RDM6300 readers or Wieg
* Fits in an universal enclosures with DIN mount
* Open Source Hardware

Get more information and see accessory options from [Tindie Store](https://www.tindie.com/products/nardev/esp-rfid-relay-board-12v-in-esp8266-board/)
Get more information and see accessory options from [Tindie Store](https://www.tindie.com/products/nardev/esp-rfid-relay-blue-board/)

| What are others saying about esp-rfid? |
| ---- |
Expand All @@ -59,7 +59,7 @@ This project still in its development phase. New features (and also bugs) are in

### What You Will Need
### Hardware
* [Official ESP-RFID Relay Board](https://www.tindie.com/products/nardev/esp-rfid-relay-board-12v-in-esp8266-board/)
* [Official ESP-RFID Relay Board](https://www.tindie.com/products/nardev/esp-rfid-relay-blue-board/)
or
* An ESP8266 module or a development board like **WeMos D1 mini** or **NodeMcu 1.0** with at least **32Mbit Flash (equals to 4MBytes)** (ESP32 is not supported for now)
* A MFRC522 RFID PCD Module or PN532 NFC Reader Module or RDM6300 125KHz RFID Module Wiegand based RFID reader
Expand All @@ -75,7 +75,7 @@ https://github.com/esprfid/esp-rfid/releases
On Windows you can use **"flash.bat"**, it will ask you which COM port that ESP is connected and then flashes it. You can use any flashing tool and do the flashing manually. The flashing process itself has been described at numerous places on Internet.

#### Building With PlatformIO
##### Backend

The build environment is based on [PlatformIO](https://platformio.org). Follow the instructions found here: https://platformio.org/#!/get-started for installing it but skip the ```platform init``` step as this has already been done, modified and it is included in this repository. In summary:

```
Expand All @@ -96,34 +96,9 @@ When you run ```platformio run``` for the first time, it will download the toolc

The resulting (built) image(s) can be found in the directory ```/bin``` created during the build process.

##### Frontend
You cannot simply edit Web UI files because you will need to convert them to C arrays, which can be done automatically by a gulp script that can be found in tools directory or you can use compiled executables at the same directory as well (for Windows PCs only).

If you want to edit esp-rfid's Web UI you will need (unless using compiled executables):
* NodeJS
* npm (comes with NodeJS installer)
* Gulp (can be installed with npm)

Gulp script also minifies HTML and JS files and compresses (gzip) them.

To minify and compress the frontend, enter the folder ```tools/webfilesbuilder``` and:
* Run ```npm install``` to install dependencies
* Run ```npm start``` to compress the web UI to make it ready for the ESP

In order to test your changes without flashing the firmware you can launch websocket emulator which is included in tools directory.
* You will need to Node JS for websocket emulator.
* Run ```npm install``` to install dependencies
* Run emulator ```node wserver.js```
##### How to modify the project

There are two alternative ways to test the UI
1. you can launch your browser with CORS disabled:
```chrome.exe --args --disable-web-security -–allow-file-access-from-files --user-data-dir="C:\Users\USERNAME"```
and then open the HTML files directly (Get more information [here](https://stackoverflow.com/questions/3102819/disable-same-origin-policy-in-chrome))
2. alternatively, you can launch a web server from the ```src/websrc``` folder, for example with Python, like this:
```python3 -m http.server```
and then visit ```https://0.0.0.0:8000/```

When testing locally, use the password ```neo``` for admin capabilities.
If you want to modify the code, you can read more info in the [CONTRIBUTING](./CONTRIBUTING.md) file.


### Pin Layout
Expand Down Expand Up @@ -207,13 +182,14 @@ At least 1000 unique User (RFID Tag) can be handled, the test were performed on
* Reliability on Flash (these NOR Flash have limited write cycle on their cells). It depends on manufacturer choice of Flash Chip and usage.

## Community
* [![Chat at https://gitter.im/esp-rfid/Lobby](https://badges.gitter.im/esp-rfid.svg)](https://gitter.im/esp-rfid/Lobby) Join community chat on Gitter

### Projects that is based on esp-rfid
[![Chat at https://gitter.im/esp-rfid/Lobby](https://badges.gitter.im/esp-rfid.svg)](https://gitter.im/esp-rfid/Lobby) Join community chat on Gitter

### Projects that are based on esp-rfid

* [ESP-IO](https://github.com/Pako2/EventGhostPlugins/tree/master/ESP-IO) Project to manipulate GPIOs with EventGhost
* [ESP-RCM](https://github.com/Pako2/esp-rcm) Room Climate Monitor with ESP8266, HTU21D, Si7021, AM2320

[ESP-RFID-PY](https://github.com/esprfid/esp-rfid-py) Micro-Python implementation of esp-rfid is also made available by @iBobik
* [ESP-RFID-PY](https://github.com/esprfid/esp-rfid-py) Micro-Python implementation of esp-rfid is also made available by @iBobik

### Acknowledgements

Expand Down Expand Up @@ -247,28 +223,5 @@ Donations **transparently** processed by **[Open Collective](https://opencollect
This project exists thanks to all the people who contribute.
<a href="https://github.com/esprfid/esp-rfid/graphs/contributors"><img src="https://opencollective.com/esp-rfid/contributors.svg?width=890&button=false" /></a>


## Backers

Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/esp-rfid#backer)]

<a href="https://opencollective.com/esp-rfid#backers" target="_blank"><img src="https://opencollective.com/esp-rfid/backers.svg?width=890"></a>


## Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/esp-rfid#sponsor)]

<a href="https://opencollective.com/esp-rfid/sponsor/0/website" target="_blank"><img src="https://opencollective.com/esp-rfid/sponsor/0/avatar.svg"></a>
<a href="https://opencollective.com/esp-rfid/sponsor/1/website" target="_blank"><img src="https://opencollective.com/esp-rfid/sponsor/1/avatar.svg"></a>
<a href="https://opencollective.com/esp-rfid/sponsor/2/website" target="_blank"><img src="https://opencollective.com/esp-rfid/sponsor/2/avatar.svg"></a>
<a href="https://opencollective.com/esp-rfid/sponsor/3/website" target="_blank"><img src="https://opencollective.com/esp-rfid/sponsor/3/avatar.svg"></a>
<a href="https://opencollective.com/esp-rfid/sponsor/4/website" target="_blank"><img src="https://opencollective.com/esp-rfid/sponsor/4/avatar.svg"></a>
<a href="https://opencollective.com/esp-rfid/sponsor/5/website" target="_blank"><img src="https://opencollective.com/esp-rfid/sponsor/5/avatar.svg"></a>
<a href="https://opencollective.com/esp-rfid/sponsor/6/website" target="_blank"><img src="https://opencollective.com/esp-rfid/sponsor/6/avatar.svg"></a>
<a href="https://opencollective.com/esp-rfid/sponsor/7/website" target="_blank"><img src="https://opencollective.com/esp-rfid/sponsor/7/avatar.svg"></a>
<a href="https://opencollective.com/esp-rfid/sponsor/8/website" target="_blank"><img src="https://opencollective.com/esp-rfid/sponsor/8/avatar.svg"></a>
<a href="https://opencollective.com/esp-rfid/sponsor/9/website" target="_blank"><img src="https://opencollective.com/esp-rfid/sponsor/9/avatar.svg"></a>

## License
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.
Binary file modified demo/mqtt-settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#define VERSION "2.0.0-dev.2"
#define VERSION "2.0.0"

#include "Arduino.h"
#include <ESP8266WiFi.h>
Expand Down

0 comments on commit d16a310

Please sign in to comment.