{"id":20341940,"url":"https://github.com/douglaszuqueto/esp32-http-firmware","last_synced_at":"2025-04-11T23:34:19.391Z","repository":{"id":91302756,"uuid":"176807775","full_name":"douglaszuqueto/esp32-http-firmware","owner":"douglaszuqueto","description":"Firmware para ESP32 com suporte a integração com WebService e configuração via WiFiManager","archived":false,"fork":false,"pushed_at":"2019-03-30T22:55:41.000Z","size":917,"stargazers_count":14,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-25T19:21:20.859Z","etag":null,"topics":["esp32","espressif","http","iot","webservice","wifimanager"],"latest_commit_sha":null,"homepage":"https://github.com/douglaszuqueto/esp32-http-firmware","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/douglaszuqueto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-20T20:00:10.000Z","updated_at":"2020-12-27T01:24:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"b9ee2cf5-8f19-4258-9d51-fd05ae7134a4","html_url":"https://github.com/douglaszuqueto/esp32-http-firmware","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douglaszuqueto%2Fesp32-http-firmware","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douglaszuqueto%2Fesp32-http-firmware/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douglaszuqueto%2Fesp32-http-firmware/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douglaszuqueto%2Fesp32-http-firmware/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/douglaszuqueto","download_url":"https://codeload.github.com/douglaszuqueto/esp32-http-firmware/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248495181,"owners_count":21113581,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["esp32","espressif","http","iot","webservice","wifimanager"],"created_at":"2024-11-14T21:29:49.461Z","updated_at":"2025-04-11T23:34:19.381Z","avatar_url":"https://github.com/douglaszuqueto.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ESP32 HTTP Firmware - V1.2.0 (em desenvolvimento)\n\nFirmware para ESP32 com suporte a integração com WebService e configuração via WiFiManager\n\n## Versões\n\n* [V1](https://github.com/douglaszuqueto/esp32-http-firmware/releases/tag/1.0.0)\n* [V1.1.0](https://github.com/douglaszuqueto/esp32-http-firmware/releases/tag/1.1.0)\n\n## Posts relacionados\n\nSe você chegou até aqui e esta boiando sobre o que originou este projeto, recomendo ver os posts que fiz no [Grupo Arduino Brasil](https://www.facebook.com/groups/arduino.br) no Facebook!\n\n* [1º post](https://www.facebook.com/groups/arduino.br/permalink/2228450170527406/)\n* [2º post](https://www.facebook.com/groups/arduino.br/permalink/2231466933559063/)\n* [3º post](https://www.facebook.com/groups/arduino.br/permalink/2234227333283023/)\n* [4º post](https://www.facebook.com/groups/arduino.br/permalink/2237258569646566/)\n* [5º post](https://www.facebook.com/groups/arduino.br/permalink/2241613079211115/)\n\n## Bibliotecas\n\n* [WiFi](https://github.com/espressif/arduino-esp32/tree/master/libraries/WiFi)\n* [WebServer](https://github.com/espressif/arduino-esp32/tree/master/libraries/WebServer)\n* [Ticker](https://github.com/espressif/arduino-esp32/tree/master/libraries/Ticker)\n* [HTTPClient](https://github.com/espressif/arduino-esp32/tree/master/libraries/HTTPClient)\n* [Preferences](https://github.com/espressif/arduino-esp32/tree/master/libraries/Preferences)\n* [WiFiManager](https://github.com/tzapu/WiFiManager)\n* [SPIFFS](https://github.com/espressif/arduino-esp32/tree/master/libraries/SPIFFS)\n* [ESP-DASH](https://github.com/ayushsharma82/ESP-DASH)\n* [AsyncTCP](https://github.com/me-no-dev/AsyncTCP)\n* [ESPAsyncWebServer](https://github.com/me-no-dev/ESPAsyncWebServer)\n* [ESPAsyncTCP](https://github.com/me-no-dev/ESPAsyncTCP)\n* [Time](https://github.com/espressif/arduino-esp32/blob/master/tools/sdk/include/newlib/time.h)\n* [ArduinoJson](https://arduinojson.org/)\n\n## Arquitetura/Organização\n\nFirmware dividido em arquivos. Cada arquivo com sua responsabilidade. Tudo isso visando melhor organização e facilidade em manter o código a longo prazo.\n\n![img](https://raw.githubusercontent.com/douglaszuqueto/esp32-http-firmware/master/.github/architecture-v1.2.0.png)\n\n## Diagrama de fluxo\n\n![img](https://raw.githubusercontent.com/douglaszuqueto/esp32-http-firmware/master/.github/diagrama-fluxo.png)\n\n## Funcionalidades\n\n* Configuração WiFi/Device via WifiManager\n* Storage(Preferences)\n* Ticker\n* Cache(carregado no setup) - token, device_id, device_token, client_id\n* Integração com webservice\n* Autenticação e Autorização\n* Renovação de token apenas quando expirado\n* Suporte a debug\n* Suporte a deepsleep\n* Visualização através do webapp embarcado\n* Multi-tarefas\n\n## Código principal\n\n```c\nvoid setup() {\n  pinMode(LED, OUTPUT);\n  ticker.attach(0.3, tick);\n\n  initSerial();\n  openStorage();\n\n  setupWifiManager();\n  setupWiFi();\n\n  makeCache();\n  showConfig();\n\n  //\n  API_AUTH = API_URL + \"/auth\";\n  API_SEND_DATA = API_URL + \"/device/\" + device_id;\n  //\n\n  requestAccess();\n\n  ticker.detach();\n  digitalWrite(LED, LOW);\n\n#if ESP_DASH\n  initEspDash();\n#endif\n\n#if DEEP_SLEEP\n  sendData();\n  closeStorage();\n  DEBUG_PRINTLNC(F(\"[ESP] Sleeping...\"));\n  ESP.deepSleep(sleep_time);\n#endif\n\n  delay(1000);\n  initTasks();\n}\n\nvoid loop() {\n}\n```\n\n## Tasks\nX tarefas são criadas. Elas serão distribuidas e gerenciadas através do RTOS de forma automática.\n\n![img](https://raw.githubusercontent.com/douglaszuqueto/esp32-http-firmware/master/.github/tasks.png)\n\n## WifiManager\n\nPágina de configuração via wifi manager\n\n![img](https://raw.githubusercontent.com/douglaszuqueto/esp32-http-firmware/master/.github/wifimanager.png)\n\n## ESP-DASH\nComo brincadeira adicional acabei conhecendo o projeto [ESP-DASH](https://github.com/ayushsharma82/ESP-DASH) em um grupo, dei uma olhada e gostei bastante das funcionalidades e da arquitetura que foi aplicada no projeto.\n\nAinda não tem nenhuma integração real, mas o mesmo possui uma tarefa no qual os dados são atualizados de X em X tempo. Também possui um botão no qual possui integração com o led.\n\nÉ um projeto muito bacana, pois foi embarcado um WebAPP desenvolvido em VueJS e o build('compilação') desse webapp é embarcado dentro do esp através do SPIFFS - uma técnica deveras interessante que pode agregar muito nos projetos!\n\nOutro fato legal que eu gostei bastante, é que toda comunicação ocorre em 'tempo real' através do uso de websockets. Então além do ESP32 atuar como webserver servindo o webapp também cria um servidor de websockets, interessante não é?!\n\n* Dashboard\n\n![img](https://raw.githubusercontent.com/douglaszuqueto/esp32-http-firmware/master/.github/esp-dash.png)\n\n* Stats\n\n![img](https://raw.githubusercontent.com/douglaszuqueto/esp32-http-firmware/master/.github/esp-dash-stats.png)\n\n## Monitor serial\nUm pouco do fluxo que ocorre após o salvamento das configurações no wifi manager.\n\nNo monitor serial houve uma melhoria que agora possibilita ver em qual core as tasks estão rodando em tempo de execução.\n\n![img](https://raw.githubusercontent.com/douglaszuqueto/esp32-http-firmware/master/.github/serial-monitor-v2.png)\n\n## Referências\n\n* [Espressif - Arduino ESP32](https://github.com/espressif/arduino-esp32)\n* [WiFi Manager](https://github.com/tzapu/WiFiManager)\n* [WiFi Manager ESP32](https://github.com/zhouhan0126/WIFIMANAGER-ESP32)\n* [ESP32 com Arduino IDE - Programação Multi-Core](https://www.fernandok.com/2018/04/esp32-com-arduino-ide-programacao-multi.html)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdouglaszuqueto%2Fesp32-http-firmware","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdouglaszuqueto%2Fesp32-http-firmware","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdouglaszuqueto%2Fesp32-http-firmware/lists"}