ESP8266 Treppenlichtsteuerung mit OTA zum Firmware Upload
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

doku.md 3.7KB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. Hardware Timer didnt work https://github.com/khoih-prog/ESP8266TimerInterrupt#why-using-isr-based-hardware-timer-interrupt-is-better
  2. => Software Timer https://ullisroboterseite.de/esp8266-timing.html#timer
  3. ### __Zum aktivieren von GDBStub:__
  4. ```c
  5. #include <GDBStub.h>
  6. ...
  7. void setup() {
  8. Serial.begin(460800);
  9. gdbstub_init();
  10. ```
  11. ### __Achtung !__
  12. GDB muss dafür compiled werden
  13. GDB-Version aus Arduino Toolchain hat Support
  14. ```sh
  15. $ ./start_xtensa_gdb_stub.sh
  16. ```
  17. ### __Achtung !__
  18. Don`t forget __\r__
  19. ESP-OTA wird von ufw oder Defender geblockt.
  20. - Windows -> Python needs to be granted with rights
  21. - Linux -> open udp port in ufw ->
  22. ```sh
  23. platform.ini
  24. upload_flags =
  25. --host-port <PORT>
  26. ...
  27. $ sudo ufw allow tcp/<PORT>
  28. ```
  29. ```c++
  30. server.streamFile(f, mime::getContentType(SRH::_path), requestMethod);
  31. =====>
  32. const String& p = SRH::_path;
  33. if(p.endsWith(".gzip")) {
  34. server.sendHeader("Content-Encoding", "gzip");
  35. server.streamFile(f, mime::getContentType(p.substring(0, p.length()-5)), requestMethod);
  36. }
  37. else
  38. server.streamFile(f, mime::getContentType(SRH::_path), requestMethod);
  39. ```
  40. ### HW issues
  41. - GPIO2 used as input -> must be high during startup
  42. - PCB Solution: cut trace to GPIO2, solder bridge to GPIO16
  43. - -> disadvantage: GPIO16 is not interrupt capable
  44. ### FSM 2 - to do
  45. - stairway light switches off after timeout
  46. - switches concurrently on again if sensor is still high
  47. - desired behavior? Defective Sensor would cause continuos animation
  48. - edge detection / interrupts as solution ?
  49. ### LED_sequence_v1:
  50. TODO:
  51. - disable led stripes after defined time (webserver paramter?)
  52. - define what to do if people enter stairs from different directions
  53. - CAUTION: Sensor-Deadtime at LEAST 8 seconds
  54. - --> switch off with person leaving stairs might not be possible
  55. ### Webserver on v0.3.0 now working with LittleFS
  56. TODO:
  57. - check dir for files automatic
  58. - move handleNotFound to httpserver.h
  59. - maybe compress files ?
  60. ### LED Flickering issue
  61. https://github.com/NachtRaveVL/PCA9685-Arduino/issues/15
  62. PlatformIO Library veraltet !!
  63. ### TIMER in OTA unterbrechen !!!!!
  64. ### further improvments
  65. with streamFile gzip encoded Files can be sent
  66. this reduces space on fs !
  67. new easier script needed to just convert to .gz
  68. maybe measure timings on ESP
  69. __=> use serveStatic because way simpler !__
  70. __=> serverStatic("/") works wonders__
  71. AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARHRRHRGH
  72. Two implementations of FSM are not that good,
  73. linker puts them together ?!?
  74. :):):):):):):)
  75. => maybe investigate for doc
  76. ### TODO Treppe
  77. - dynamic lighting with ldr
  78. - http control over active pwm ... => set_active_pwm()
  79. -> is implemntiert, kann mit % oder abs eingestellt werden
  80. - testing if dimming crashes when two animations
  81. -> ldr does not interrupt animation, animation get's finished and stairs fade out -> FSM works without collisions
  82. - interrupt to pending from sensors
  83. - settings struct
  84. -> implemented with EEPROM
  85. - script for gdb on windows
  86. -> [implemented](start_xtensa_gdb_stub.cmd)
  87. - welcome animation ?
  88. -> wird hochgedimmt beim einschalten von 0
  89. - on/off switch http
  90. - use logging to serial http monitor with httpserver.logt()
  91. -> is used for some status updates
  92. - behavior when someone enters stairway from opposite direction while animation is running?
  93. -> currently ignored, second persons walks in darkness
  94. -> animation from both sides?
  95. -> problem: person 1 leaving stairway might pass the sensor right after person 2 -> person 1 leaving not detected
  96. - behavior when someone enters stairway from opposite direction after animation finished but person 1 is still on stairway?
  97. -> currently stairs fade off from direction 1
  98. -> additional wait-state between "warten hoch/runter" and "abdimmen hoch/runter" after sensor detected person?