-
Notifications
You must be signed in to change notification settings - Fork 424
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #605 from esprfid/dev
esp-rfid v2
- Loading branch information
Showing
59 changed files
with
13,001 additions
and
4,352 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Platformio build | ||
|
||
on: push | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.10" | ||
- name: Install Platformio | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install platformio | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Run Platformio builds | ||
run: | | ||
platformio run -e generic -e debug | ||
- name: Export bins | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: bins | ||
path: | | ||
bin/generic.bin | ||
bin/forV2Board.bin | ||
bin/debug.bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Tools build for Linux | ||
|
||
on: push | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '16' | ||
- name: Install pkg | ||
run: npm i -g pkg | ||
- name: Generate webfilesbuilder binaries | ||
run: | | ||
cd tools/webfilesbuilder | ||
npm install | ||
pkg -t node16-linux -C GZip . | ||
- name: Generate wsemulator binaries | ||
run: | | ||
cd tools/wsemulator | ||
npm install | ||
pkg -t node16-linux -C GZip . | ||
- name: Export Linux binary | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: bins | ||
path: | | ||
tools/webfilesbuilder/webfilesbuilder | ||
tools/wsemulator/wsemulator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Tools build for Mac | ||
|
||
on: push | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '16' | ||
- name: Install pkg | ||
run: npm i -g pkg | ||
- name: Generate webfilesbuilder binaries | ||
run: | | ||
cd tools/webfilesbuilder | ||
npm install | ||
pkg -t node16-mac -C GZip . | ||
- name: Generate wsemulator binaries | ||
run: | | ||
cd tools/wsemulator | ||
npm install | ||
pkg -t node16-mac -C GZip . | ||
- name: Export Mac binary | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: bins | ||
path: | | ||
tools/webfilesbuilder/webfilesbuilder | ||
tools/wsemulator/wsemulator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Tools build for Windows | ||
|
||
on: push | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '16' | ||
- name: Install pkg | ||
run: npm i -g pkg | ||
- name: Generate webfilesbuilder binaries | ||
run: | | ||
cd tools/webfilesbuilder | ||
npm install | ||
pkg -t node16-win -C GZip . | ||
- name: Generate wsemulator binaries | ||
run: | | ||
cd tools/wsemulator | ||
npm install | ||
pkg -t node16-win -C GZip . | ||
- name: Export Windows binary | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: bins | ||
path: | | ||
tools/webfilesbuilder/webfilesbuilder.exe | ||
tools/wsemulator/wsemulator.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ```http://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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Debugging | ||
|
||
When the ESP crashes and it's connected to the serial port in debug mode, you can get its stacktrace. | ||
|
||
But then you need to decode it to see what's going on. To do that you need to: | ||
|
||
- install https://github.com/janLo/EspArduinoExceptionDecoder/ | ||
|
||
- save the stacktrace in a file, e.g. debug.txt | ||
|
||
- run `python3 ~/.platformio/packages/toolchain-xtensa/decoder.py -e .pio/build/debug/firmware.elf debug.txt -s` | ||
|
||
References: | ||
- https://github.com/esp8266/Arduino/blob/master/doc/faq/a02-my-esp-crashes.rst | ||
- https://arduino-esp8266.readthedocs.io/en/latest/exception_causes.html | ||
- https://arduino-esp8266.readthedocs.io/en/latest/Troubleshooting/stack_dump.html | ||
|
Oops, something went wrong.