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 2.4KB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARHRRHRGH
  71. Two implementations of FSM are not that good,
  72. linker puts them together ?!?
  73. :):):):):):):)