Browse Source

refactored directory structure

pull/421/head
lumapu 2 years ago
parent
commit
fbad251236
  1. 21
      .github/workflows/compile_development.yml
  2. 27
      .gitignore
  3. 10
      Getting_Started.md
  4. 4
      README.md
  5. 2
      User_Manual.md
  6. 2
      scripts/auto_firmware_version.py
  7. 2
      scripts/buildManifest.py
  8. 2
      scripts/getVersion.py
  9. 0
      scripts/gh-action-dev-build-flash.html
  10. 0
      src/app.cpp
  11. 2
      src/app.h
  12. 0
      src/config/config.h
  13. 0
      src/config/config_override_example.h
  14. 0
      src/config/eep.h
  15. 0
      src/defines.h
  16. 0
      src/hm/CircularBuffer.h
  17. 0
      src/hm/hmDefines.h
  18. 0
      src/hm/hmInverter.h
  19. 0
      src/hm/hmRadio.h
  20. 0
      src/hm/hmSystem.h
  21. 6
      src/main.cpp
  22. 4
      src/platformio.ini
  23. 0
      src/utils/crc.cpp
  24. 0
      src/utils/crc.h
  25. 0
      src/utils/dbg.cpp
  26. 0
      src/utils/dbg.h
  27. 0
      src/web/html/api.js
  28. 5
      src/web/html/convert.py
  29. BIN
      src/web/html/favicon.ico
  30. 0
      src/web/html/h/favicon_ico_gz.h
  31. 0
      src/web/html/index.html
  32. 0
      src/web/html/login.html
  33. 0
      src/web/html/serial.html
  34. 0
      src/web/html/setup.html
  35. 0
      src/web/html/style.css
  36. 0
      src/web/html/system.html
  37. 0
      src/web/html/update.html
  38. 0
      src/web/html/visualization.html
  39. 0
      src/web/mqtt.h
  40. 20
      src/web/web.cpp
  41. 0
      src/web/web.h
  42. 0
      src/web/webApi.cpp
  43. 0
      src/web/webApi.h
  44. 0
      src/wifi/ahoywifi.cpp
  45. 0
      src/wifi/ahoywifi.h
  46. 6
      tools/esp8266/.gitignore

21
.github/workflows/compile_development.yml

@ -43,16 +43,16 @@ jobs:
pip install --upgrade platformio
- name: Convert HTML files
working-directory: tools/esp8266/html
working-directory: src/web/html
run: python convert.py
- name: Run PlatformIO
run: pio run -d tools/esp8266 --environment esp8266-release --environment esp8266-1m-release --environment esp32-wroom32-release
run: pio run -d src --environment esp8266-release --environment esp8266-1m-release --environment esp32-wroom32-release
- name: Rename Binary files
id: rename-binary-files
working-directory: tools/esp8266/scripts
run: python getVersion.py >> $GITHUB_OUTPUT
working-directory: src
run: python ../scripts/getVersion.py >> $GITHUB_OUTPUT
- name: Set Version
uses: cschleiden/replace-tokens@v1
@ -62,18 +62,15 @@ jobs:
VERSION: ${{ steps.rename-binary-files.outputs.name }}
- name: Create Manifest
working-directory: tools/esp8266/scripts
run: python buildManifest.py
working-directory: src
run: python ../scripts/buildManifest.py
#run: zip --junk-paths ${{ steps.rename-binary-files.outputs.name }}.zip tools/esp8266/.pio/build/out/* tools/esp8266/User_Manual.md
- name: Create Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ steps.rename-binary-files.outputs.name }}_dev_build
path: |
tools/esp8266/firmware/*
tools/esp8266/User_Manual.md
tools/esp8266/install.html
#./${{ steps.rename-binary-files.outputs.name }}.zip
src/firmware/*
src/User_Manual.md
src/install.html

27
.gitignore

@ -1,24 +1,13 @@
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
build
tools/esp8266/tmp
tools/esp8266/binaries
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
.vscode/extensions.json
src/config/config_override.h
src/html/h/*
/**/Debug
/**/v16/*
*.db
*.suo
*.ipch
tools/esp8266/.vscode/extensions.json
.DS_Store
.vscode
tools/esp8266/platformio-device-monitor-*.log
tools/esp8266/html/h/*

10
tools/esp8266/README.md → Getting_Started.md

@ -85,7 +85,7 @@ To also run our sister project OpenDTU and be upwards compatible for the future
#### There are fake NRF24L01+ Modules out there
Watch out, there are some fake NRF24L01+ Modules out there that seem to use rebranded NRF24L01 Chips (without the +).<br/>
An example can be found in [Issue #230](https://github.com/grindylow/ahoy/issues/230).<br/>
An example can be found in [Issue #230](https://github.com/lumapu/ahoy/issues/230).<br/>
You are welcome to add more examples of faked chips. We will add that information here.<br/>
## Wiring things up
@ -112,11 +112,11 @@ This is an example wiring using a Wemos D1 mini.<br>
##### Schematic
![Schematic](../../doc/AhoyWemos_Schaltplan.jpg)
![Schematic](doc/AhoyWemos_Schaltplan.jpg)
##### Symbolic view
![Symbolic](../../doc/AhoyWemos_Steckplatine.jpg)
![Symbolic](doc/AhoyWemos_Steckplatine.jpg)
#### ESP32 wiring example
@ -124,11 +124,11 @@ Example wiring for a 38pin ESP32 module
##### Schematic
![Schematic](../../doc/Wiring_ESP32_Schematic.png)
![Schematic](doc/Wiring_ESP32_Schematic.png)
##### Symbolic view
![Symbolic](../../doc/Wiring_ESP32_Symbol.png)
![Symbolic](doc/Wiring_ESP32_Symbol.png)
##### ESP32 GPIO settings

4
README.md

@ -7,13 +7,13 @@
List of approaches
- [ESP8266/ESP32, C++](tools/esp8266/) 👈 the most effort is spent here
- [ESP8266/ESP32, C++](Getting_Started.md) 👈 the most effort is spent here
- [Arduino Nano, C++](tools/nano/NRF24_SendRcv/)
- [Raspberry Pi, Python](tools/rpi/)
- [Others, C/C++](tools/nano/NRF24_SendRcv/)
## Quick Start with ESP8266
- [Go here ✨](tools/esp8266/README.md#things-needed)
- [Go here ✨](Getting_Started.md#things-needed)
## Success Stories

2
tools/esp8266/User_Manual.md → User_Manual.md

@ -1,7 +1,7 @@
# User Manual Ahoy DTU (on ESP8266)
Version #{VERSION}#
## Introduction
See the repository [README.md](README.md)
See the repository [README.md](Getting_Started.md)
## Setup
Assuming you have a running ahoy-dtu and you can access the setup page.

2
tools/esp8266/scripts/auto_firmware_version.py → scripts/auto_firmware_version.py

@ -17,7 +17,7 @@ from dulwich import porcelain
def get_firmware_specifier_build_flag():
try:
build_version = porcelain.describe('../../') # refers to the repository root dir
build_version = porcelain.describe('../') # refers to the repository root dir
except:
build_version = "g0000000"

2
tools/esp8266/scripts/buildManifest.py → scripts/buildManifest.py

@ -52,4 +52,4 @@ def buildManifest(path, infile, outfile):
fp.close()
buildManifest("../", "defines.h", "manifest.json")
buildManifest("", "defines.h", "manifest.json")

2
tools/esp8266/scripts/getVersion.py → scripts/getVersion.py

@ -70,4 +70,4 @@ def readVersion(path, infile):
print("name=" + versionnumber[:-1] )
readVersion("../", "defines.h")
readVersion("", "defines.h")

0
tools/esp8266/scripts/gh-action-dev-build-flash.html → scripts/gh-action-dev-build-flash.html

0
tools/esp8266/src/app.cpp → src/app.cpp

2
tools/esp8266/src/app.h → src/app.h

@ -6,7 +6,7 @@
#ifndef __APP_H__
#define __APP_H__
#include "src/utils/dbg.h"
#include "utils/dbg.h"
#include "Arduino.h"

0
tools/esp8266/src/config/config.h → src/config/config.h

0
tools/esp8266/src/config/config_override_example.h → src/config/config_override_example.h

0
tools/esp8266/src/config/eep.h → src/config/eep.h

0
tools/esp8266/src/defines.h → src/defines.h

0
tools/esp8266/src/hm/CircularBuffer.h → src/hm/CircularBuffer.h

0
tools/esp8266/src/hm/hmDefines.h → src/hm/hmDefines.h

0
tools/esp8266/src/hm/hmInverter.h → src/hm/hmInverter.h

0
tools/esp8266/src/hm/hmRadio.h → src/hm/hmRadio.h

0
tools/esp8266/src/hm/hmSystem.h → src/hm/hmSystem.h

6
tools/esp8266/main.cpp → src/main.cpp

@ -3,9 +3,9 @@
// Creative Commons - http://creativecommons.org/licenses/by-nc-sa/3.0/de/
//-----------------------------------------------------------------------------
#include "src/utils/dbg.h"
#include "src/app.h"
#include "src/config/config.h"
#include "utils/dbg.h"
#include "app.h"
#include "config/config.h"
app myApp;

4
tools/esp8266/platformio.ini → src/platformio.ini

@ -28,8 +28,8 @@ build_flags =
monitor_speed = 115200
extra_scripts =
pre:scripts/auto_firmware_version.py
pre:html/convert.py
pre:../scripts/auto_firmware_version.py
pre:web/html/convert.py
lib_deps =
https://github.com/yubox-node-org/ESPAsyncWebServer

0
tools/esp8266/src/utils/crc.cpp → src/utils/crc.cpp

0
tools/esp8266/src/utils/crc.h → src/utils/crc.h

0
tools/esp8266/src/utils/dbg.cpp → src/utils/dbg.cpp

0
tools/esp8266/src/utils/dbg.h → src/utils/dbg.h

0
tools/esp8266/html/api.js → src/web/html/api.js

5
tools/esp8266/html/convert.py → src/web/html/convert.py

@ -65,8 +65,9 @@ def convert2Header(inFile, compress):
# delete all files in the 'h' dir, but ignore 'favicon_ico_gz.h'
dir = 'h'
print(os.getcwd())
if os.getcwd()[-4:] != "html":
dir = "html/" + dir
dir = "web/html/" + dir
for f in os.listdir(dir):
if not f.startswith('favicon_ico_gz'):
@ -74,7 +75,7 @@ for f in os.listdir(dir):
# grab all files with following extensions
if os.getcwd()[-4:] != "html":
os.chdir('./html')
os.chdir('./web/html')
types = ('*.html', '*.css', '*.js') # the tuple of file types
files_grabbed = []
for files in types:

BIN
src/web/html/favicon.ico

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

0
tools/esp8266/html/h/favicon_ico_gz.h → src/web/html/h/favicon_ico_gz.h

0
tools/esp8266/html/index.html → src/web/html/index.html

0
tools/esp8266/html/login.html → src/web/html/login.html

0
tools/esp8266/html/serial.html → src/web/html/serial.html

0
tools/esp8266/html/setup.html → src/web/html/setup.html

0
tools/esp8266/html/style.css → src/web/html/style.css

0
tools/esp8266/html/system.html → src/web/html/system.html

0
tools/esp8266/html/update.html → src/web/html/update.html

0
tools/esp8266/html/visualization.html → src/web/html/visualization.html

0
tools/esp8266/src/web/mqtt.h → src/web/mqtt.h

20
tools/esp8266/src/web/web.cpp → src/web/web.cpp

@ -10,16 +10,16 @@
#include "web.h"
#include "../../html/h/index_html.h"
#include "../../html/h/login_html.h"
#include "../../html/h/style_css.h"
#include "../../html/h/api_js.h"
#include "../../html/h/favicon_ico_gz.h"
#include "../../html/h/setup_html.h"
#include "../../html/h/visualization_html.h"
#include "../../html/h/update_html.h"
#include "../../html/h/serial_html.h"
#include "../../html/h/system_html.h"
#include "html/h/index_html.h"
#include "html/h/login_html.h"
#include "html/h/style_css.h"
#include "html/h/api_js.h"
#include "html/h/favicon_ico_gz.h"
#include "html/h/setup_html.h"
#include "html/h/visualization_html.h"
#include "html/h/update_html.h"
#include "html/h/serial_html.h"
#include "html/h/system_html.h"
const char* const pinArgNames[] = {"pinCs", "pinCe", "pinIrq", "pinLed0", "pinLed1"};

0
tools/esp8266/src/web/web.h → src/web/web.h

0
tools/esp8266/src/web/webApi.cpp → src/web/webApi.cpp

0
tools/esp8266/src/web/webApi.h → src/web/webApi.h

0
tools/esp8266/src/wifi/ahoywifi.cpp → src/wifi/ahoywifi.cpp

0
tools/esp8266/src/wifi/ahoywifi.h → src/wifi/ahoywifi.h

6
tools/esp8266/.gitignore

@ -1,6 +0,0 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
config_override.h
Loading…
Cancel
Save