mirror of
https://github.com/HERDAC/SmartLightBLE.git
synced 2024-11-24 10:33:27 +00:00
master
This commit is contained in:
commit
fec6f19309
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
.pio
|
||||||
|
.clang_complete
|
||||||
|
.gcc-flags.json
|
67
.travis.yml
Normal file
67
.travis.yml
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
# Continuous Integration (CI) is the practice, in software
|
||||||
|
# engineering, of merging all developer working copies with a shared mainline
|
||||||
|
# several times a day < https://docs.platformio.org/page/ci/index.html >
|
||||||
|
#
|
||||||
|
# Documentation:
|
||||||
|
#
|
||||||
|
# * Travis CI Embedded Builds with PlatformIO
|
||||||
|
# < https://docs.travis-ci.com/user/integration/platformio/ >
|
||||||
|
#
|
||||||
|
# * PlatformIO integration with Travis CI
|
||||||
|
# < https://docs.platformio.org/page/ci/travis.html >
|
||||||
|
#
|
||||||
|
# * User Guide for `platformio ci` command
|
||||||
|
# < https://docs.platformio.org/page/userguide/cmd_ci.html >
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# Please choose one of the following templates (proposed below) and uncomment
|
||||||
|
# it (remove "# " before each line) or use own configuration according to the
|
||||||
|
# Travis CI documentation (see above).
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Template #1: General project. Test it using existing `platformio.ini`.
|
||||||
|
#
|
||||||
|
|
||||||
|
# language: python
|
||||||
|
# python:
|
||||||
|
# - "2.7"
|
||||||
|
#
|
||||||
|
# sudo: false
|
||||||
|
# cache:
|
||||||
|
# directories:
|
||||||
|
# - "~/.platformio"
|
||||||
|
#
|
||||||
|
# install:
|
||||||
|
# - pip install -U platformio
|
||||||
|
# - platformio update
|
||||||
|
#
|
||||||
|
# script:
|
||||||
|
# - platformio run
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Template #2: The project is intended to be used as a library with examples.
|
||||||
|
#
|
||||||
|
|
||||||
|
# language: python
|
||||||
|
# python:
|
||||||
|
# - "2.7"
|
||||||
|
#
|
||||||
|
# sudo: false
|
||||||
|
# cache:
|
||||||
|
# directories:
|
||||||
|
# - "~/.platformio"
|
||||||
|
#
|
||||||
|
# env:
|
||||||
|
# - PLATFORMIO_CI_SRC=path/to/test/file.c
|
||||||
|
# - PLATFORMIO_CI_SRC=examples/file.ino
|
||||||
|
# - PLATFORMIO_CI_SRC=path/to/test/directory
|
||||||
|
#
|
||||||
|
# install:
|
||||||
|
# - pip install -U platformio
|
||||||
|
# - platformio update
|
||||||
|
#
|
||||||
|
# script:
|
||||||
|
# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N
|
227
.vscode/c_cpp_properties.json
vendored
Normal file
227
.vscode/c_cpp_properties.json
vendored
Normal file
@ -0,0 +1,227 @@
|
|||||||
|
//
|
||||||
|
// !!! WARNING !!! AUTO-GENERATED FILE!
|
||||||
|
// PLEASE DO NOT MODIFY IT AND USE "platformio.ini":
|
||||||
|
// https://docs.platformio.org/page/projectconf/section_env_build.html#build-flags
|
||||||
|
//
|
||||||
|
{
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "PlatformIO",
|
||||||
|
"includePath": [
|
||||||
|
"C:/Users/remi/OneDrive/Documents/Professionnel/EscapeWorld/eclairage intelligent/programme/eclairage_intelligent_dev/include",
|
||||||
|
"C:/Users/remi/OneDrive/Documents/Professionnel/EscapeWorld/eclairage intelligent/programme/eclairage_intelligent_dev/src",
|
||||||
|
"C:/Users/remi/OneDrive/Documents/Professionnel/EscapeWorld/eclairage intelligent/programme/eclairage_intelligent_dev/lib/Reseau",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/SPI/src",
|
||||||
|
"C:/Users/remi/OneDrive/Documents/Professionnel/EscapeWorld/eclairage intelligent/programme/eclairage_intelligent_dev/lib/Leds",
|
||||||
|
"C:/Users/remi/OneDrive/Documents/Professionnel/EscapeWorld/eclairage intelligent/programme/eclairage_intelligent_dev/lib/DFPlayer",
|
||||||
|
"C:/Users/remi/OneDrive/Documents/Professionnel/EscapeWorld/eclairage intelligent/programme/eclairage_intelligent_dev/lib/Bluetooth",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/BLE/src",
|
||||||
|
"C:/Users/remi/OneDrive/Documents/Professionnel/EscapeWorld/eclairage intelligent/programme/eclairage_intelligent_dev/.pio/libdeps/esp-wrover-kit/uFire SHT20/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/Wire/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/config",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/app_trace",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/app_update",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/asio",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/bootloader_support",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/bt",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/coap",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/console",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/driver",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp-tls",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp32",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_adc_cal",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_event",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_http_client",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_http_server",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_https_ota",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_ringbuf",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/ethernet",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/expat",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/fatfs",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/freemodbus",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/freertos",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/heap",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/idf_test",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/jsmn",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/json",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/libsodium",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/log",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/lwip",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/mbedtls",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/mdns",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/micro-ecc",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/mqtt",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/newlib",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/nghttp",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/nvs_flash",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/openssl",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/protobuf-c",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/protocomm",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/pthread",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/sdmmc",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/smartconfig_ack",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/soc",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/spi_flash",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/spiffs",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/tcp_transport",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/tcpip_adapter",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/ulp",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/vfs",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/wear_levelling",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/wifi_provisioning",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/wpa_supplicant",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/xtensa-debug-module",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp-face",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp32-camera",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/fb_gfx",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/cores/esp32",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/variants/esp32",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/ArduinoOTA/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/AsyncUDP/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/AzureIoT/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/BluetoothSerial/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/DNSServer/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/EEPROM/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/ESP32/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/ESPmDNS/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/FFat/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/FS/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/HTTPClient/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/HTTPUpdate/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/NetBIOS/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/Preferences/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/SD/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/SD_MMC/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/SPIFFS/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/SimpleBLE/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/Ticker/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/Update/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/WebServer/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/WiFiClientSecure/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/tool-unity",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
"browse": {
|
||||||
|
"limitSymbolsToIncludedHeaders": true,
|
||||||
|
"path": [
|
||||||
|
"C:/Users/remi/OneDrive/Documents/Professionnel/EscapeWorld/eclairage intelligent/programme/eclairage_intelligent_dev/include",
|
||||||
|
"C:/Users/remi/OneDrive/Documents/Professionnel/EscapeWorld/eclairage intelligent/programme/eclairage_intelligent_dev/src",
|
||||||
|
"C:/Users/remi/OneDrive/Documents/Professionnel/EscapeWorld/eclairage intelligent/programme/eclairage_intelligent_dev/lib/Reseau",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/SPI/src",
|
||||||
|
"C:/Users/remi/OneDrive/Documents/Professionnel/EscapeWorld/eclairage intelligent/programme/eclairage_intelligent_dev/lib/Leds",
|
||||||
|
"C:/Users/remi/OneDrive/Documents/Professionnel/EscapeWorld/eclairage intelligent/programme/eclairage_intelligent_dev/lib/DFPlayer",
|
||||||
|
"C:/Users/remi/OneDrive/Documents/Professionnel/EscapeWorld/eclairage intelligent/programme/eclairage_intelligent_dev/lib/Bluetooth",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/BLE/src",
|
||||||
|
"C:/Users/remi/OneDrive/Documents/Professionnel/EscapeWorld/eclairage intelligent/programme/eclairage_intelligent_dev/.pio/libdeps/esp-wrover-kit/uFire SHT20/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/Wire/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/config",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/app_trace",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/app_update",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/asio",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/bootloader_support",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/bt",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/coap",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/console",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/driver",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp-tls",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp32",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_adc_cal",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_event",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_http_client",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_http_server",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_https_ota",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_ringbuf",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/ethernet",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/expat",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/fatfs",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/freemodbus",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/freertos",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/heap",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/idf_test",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/jsmn",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/json",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/libsodium",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/log",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/lwip",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/mbedtls",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/mdns",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/micro-ecc",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/mqtt",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/newlib",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/nghttp",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/nvs_flash",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/openssl",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/protobuf-c",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/protocomm",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/pthread",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/sdmmc",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/smartconfig_ack",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/soc",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/spi_flash",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/spiffs",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/tcp_transport",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/tcpip_adapter",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/ulp",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/vfs",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/wear_levelling",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/wifi_provisioning",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/wpa_supplicant",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/xtensa-debug-module",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp-face",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp32-camera",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/fb_gfx",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/cores/esp32",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/variants/esp32",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/ArduinoOTA/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/AsyncUDP/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/AzureIoT/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/BluetoothSerial/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/DNSServer/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/EEPROM/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/ESP32/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/ESPmDNS/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/FFat/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/FS/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/HTTPClient/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/HTTPUpdate/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/NetBIOS/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/Preferences/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/SD/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/SD_MMC/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/SPIFFS/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/SimpleBLE/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/Ticker/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/Update/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/WebServer/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/framework-arduinoespressif32/libraries/WiFiClientSecure/src",
|
||||||
|
"C:/Users/remi/.platformio/packages/tool-unity",
|
||||||
|
""
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"defines": [
|
||||||
|
"PLATFORMIO=50101",
|
||||||
|
"ARDUINO_ESP32_DEV",
|
||||||
|
"ESP32",
|
||||||
|
"ESP_PLATFORM",
|
||||||
|
"F_CPU=240000000L",
|
||||||
|
"HAVE_CONFIG_H",
|
||||||
|
"MBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\"",
|
||||||
|
"ARDUINO=10805",
|
||||||
|
"ARDUINO_ARCH_ESP32",
|
||||||
|
"ARDUINO_VARIANT=\"esp32\"",
|
||||||
|
"ARDUINO_BOARD=\"Espressif ESP32 Dev Module\"",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
"cStandard": "c99",
|
||||||
|
"cppStandard": "c++11",
|
||||||
|
"compilerPath": "C:/Users/remi/.platformio/packages/toolchain-xtensa32/bin/xtensa-esp32-elf-gcc.exe",
|
||||||
|
"compilerArgs": [
|
||||||
|
"-mlongcalls",
|
||||||
|
""
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version": 4
|
||||||
|
}
|
7
.vscode/extensions.json
vendored
Normal file
7
.vscode/extensions.json
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
||||||
|
// for the documentation about the extensions.json format
|
||||||
|
"recommendations": [
|
||||||
|
"platformio.platformio-ide"
|
||||||
|
]
|
||||||
|
}
|
34
.vscode/launch.json
vendored
Normal file
34
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
// AUTOMATICALLY GENERATED FILE. PLEASE DO NOT MODIFY IT MANUALLY
|
||||||
|
//
|
||||||
|
// PIO Unified Debugger
|
||||||
|
//
|
||||||
|
// Documentation: https://docs.platformio.org/page/plus/debugging.html
|
||||||
|
// Configuration: https://docs.platformio.org/page/projectconf/section_env_debug.html
|
||||||
|
|
||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"type": "platformio-debug",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "PIO Debug",
|
||||||
|
"executable": "C:/Users/remi/OneDrive/Documents/Professionnel/EscapeWorld/eclairage intelligent/programme/eclairage_intelligent_dev/.pio/build/esp-wrover-kit/firmware.elf",
|
||||||
|
"projectEnvName": "esp-wrover-kit",
|
||||||
|
"toolchainBinDir": "C:/Users/remi/.platformio/packages/toolchain-xtensa32/bin",
|
||||||
|
"internalConsoleOptions": "openOnSessionStart",
|
||||||
|
"preLaunchTask": {
|
||||||
|
"type": "PlatformIO",
|
||||||
|
"task": "Pre-Debug"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "platformio-debug",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "PIO Debug (skip Pre-Debug)",
|
||||||
|
"executable": "C:/Users/remi/OneDrive/Documents/Professionnel/EscapeWorld/eclairage intelligent/programme/eclairage_intelligent_dev/.pio/build/esp-wrover-kit/firmware.elf",
|
||||||
|
"projectEnvName": "esp-wrover-kit",
|
||||||
|
"toolchainBinDir": "C:/Users/remi/.platformio/packages/toolchain-xtensa32/bin",
|
||||||
|
"internalConsoleOptions": "openOnSessionStart"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
11
.vscode/settings.json
vendored
Normal file
11
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"vscode-node-red.url": "http://remoras:1880/",
|
||||||
|
"vscode-node-red.settings.js": {
|
||||||
|
|
||||||
|
"editorTheme": {
|
||||||
|
"projects": {
|
||||||
|
"enabled": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
39
include/README
Normal file
39
include/README
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
|
||||||
|
This directory is intended for project header files.
|
||||||
|
|
||||||
|
A header file is a file containing C declarations and macro definitions
|
||||||
|
to be shared between several project source files. You request the use of a
|
||||||
|
header file in your project source file (C, C++, etc) located in `src` folder
|
||||||
|
by including it, with the C preprocessing directive `#include'.
|
||||||
|
|
||||||
|
```src/main.c
|
||||||
|
|
||||||
|
#include "header.h"
|
||||||
|
|
||||||
|
int main (void)
|
||||||
|
{
|
||||||
|
...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Including a header file produces the same results as copying the header file
|
||||||
|
into each source file that needs it. Such copying would be time-consuming
|
||||||
|
and error-prone. With a header file, the related declarations appear
|
||||||
|
in only one place. If they need to be changed, they can be changed in one
|
||||||
|
place, and programs that include the header file will automatically use the
|
||||||
|
new version when next recompiled. The header file eliminates the labor of
|
||||||
|
finding and changing all the copies as well as the risk that a failure to
|
||||||
|
find one copy will result in inconsistencies within a program.
|
||||||
|
|
||||||
|
In C, the usual convention is to give header files names that end with `.h'.
|
||||||
|
It is most portable to use only letters, digits, dashes, and underscores in
|
||||||
|
header file names, and at most one dot.
|
||||||
|
|
||||||
|
Read more about using header files in official GCC documentation:
|
||||||
|
|
||||||
|
* Include Syntax
|
||||||
|
* Include Operation
|
||||||
|
* Once-Only Headers
|
||||||
|
* Computed Includes
|
||||||
|
|
||||||
|
https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html
|
50
lib/Bluetooth/Bluetooth.cpp
Normal file
50
lib/Bluetooth/Bluetooth.cpp
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
#include <Arduino.h>
|
||||||
|
#include <BLEDevice.h>
|
||||||
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
#include <Bluetooth.h>
|
||||||
|
|
||||||
|
static BLEAddress *pServerAddress;
|
||||||
|
BLEScan* pBLEScan;
|
||||||
|
BLEClient* pClient;
|
||||||
|
|
||||||
|
std::vector<BeaconBLE> beacons;
|
||||||
|
|
||||||
|
unsigned long entry;
|
||||||
|
|
||||||
|
class MyAdvertisedDeviceCallbacks: public BLEAdvertisedDeviceCallbacks {
|
||||||
|
//Called for each advertising BLE server.
|
||||||
|
void onResult(BLEAdvertisedDevice advertisedDevice) {
|
||||||
|
pServerAddress = new BLEAddress(advertisedDevice.getAddress());
|
||||||
|
|
||||||
|
BeaconBLE tag;
|
||||||
|
tag.adresse = pServerAddress->toString().c_str();
|
||||||
|
tag.qualite = advertisedDevice.getRSSI();
|
||||||
|
beacons.push_back(tag);
|
||||||
|
/*
|
||||||
|
Serial.println();
|
||||||
|
Serial.print("Device found: ");
|
||||||
|
Serial.print(tag.adresse);
|
||||||
|
Serial.print(" => ");
|
||||||
|
Serial.print(tag.qualite);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
}; // MyAdvertisedDeviceCallbacks
|
||||||
|
|
||||||
|
void setup_ble(){
|
||||||
|
Serial.println("Starting Arduino BLE Client application...");
|
||||||
|
|
||||||
|
BLEDevice::init("");
|
||||||
|
|
||||||
|
pClient = BLEDevice::createClient();
|
||||||
|
Serial.println(" - Created client");
|
||||||
|
pBLEScan = BLEDevice::getScan();
|
||||||
|
pBLEScan->setAdvertisedDeviceCallbacks(new MyAdvertisedDeviceCallbacks());
|
||||||
|
pBLEScan->setActiveScan(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<BeaconBLE> loop_ble(){
|
||||||
|
beacons.clear();
|
||||||
|
BLEScanResults scanResults = pBLEScan->start(1);
|
||||||
|
return beacons;
|
||||||
|
}
|
12
lib/Bluetooth/Bluetooth.h
Normal file
12
lib/Bluetooth/Bluetooth.h
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#ifndef BLUETOOTH_H_INCLUDED
|
||||||
|
#define BLUETOOTH_H_INCLUDED
|
||||||
|
|
||||||
|
struct BeaconBLE {
|
||||||
|
String adresse;
|
||||||
|
int qualite;
|
||||||
|
};
|
||||||
|
|
||||||
|
void setup_ble();
|
||||||
|
std::vector<BeaconBLE> loop_ble();
|
||||||
|
|
||||||
|
#endif
|
74
lib/DFPlayer/DFPlayer.cpp
Normal file
74
lib/DFPlayer/DFPlayer.cpp
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
#include <Arduino.h>
|
||||||
|
#include <DFPlayer.h>
|
||||||
|
#include <SoftwareSerial.h>
|
||||||
|
#include <DFMiniMp3.h>
|
||||||
|
|
||||||
|
|
||||||
|
class Mp3Notify{
|
||||||
|
public:
|
||||||
|
static void PrintlnSourceAction(DfMp3_PlaySources source, const char* action)
|
||||||
|
{
|
||||||
|
if (source & DfMp3_PlaySources_Sd){
|
||||||
|
Serial.print("SD Card, ");
|
||||||
|
}
|
||||||
|
Serial.println(action);
|
||||||
|
}
|
||||||
|
static void OnError(uint16_t errorCode)
|
||||||
|
{
|
||||||
|
// see DfMp3_Error for code meaning
|
||||||
|
Serial.println();
|
||||||
|
Serial.print("Com Error ");
|
||||||
|
Serial.println(errorCode);
|
||||||
|
}
|
||||||
|
static void OnPlayFinished(DfMp3_PlaySources source, uint16_t track)
|
||||||
|
{
|
||||||
|
Serial.print("Play finished for #");
|
||||||
|
Serial.println(track);
|
||||||
|
}
|
||||||
|
static void OnPlaySourceOnline(DfMp3_PlaySources source)
|
||||||
|
{
|
||||||
|
PrintlnSourceAction(source, "online");
|
||||||
|
}
|
||||||
|
static void OnPlaySourceInserted(DfMp3_PlaySources source)
|
||||||
|
{
|
||||||
|
PrintlnSourceAction(source, "inserted");
|
||||||
|
}
|
||||||
|
static void OnPlaySourceRemoved(DfMp3_PlaySources source)
|
||||||
|
{
|
||||||
|
PrintlnSourceAction(source, "removed");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
SoftwareSerial secondarySerial(32, 33); // RX, TX
|
||||||
|
DFMiniMp3<SoftwareSerial, Mp3Notify> mp3(secondarySerial);
|
||||||
|
|
||||||
|
void setup_dfp(){
|
||||||
|
mp3.begin();
|
||||||
|
|
||||||
|
uint16_t volume = mp3.getVolume();
|
||||||
|
Serial.print("volume ");
|
||||||
|
Serial.println(volume);
|
||||||
|
mp3.setVolume(10);
|
||||||
|
|
||||||
|
uint16_t count = mp3.getTotalTrackCount(DfMp3_PlaySource_Sd);
|
||||||
|
Serial.print("files ");
|
||||||
|
Serial.println(count);
|
||||||
|
}
|
||||||
|
|
||||||
|
void play(int fichier){
|
||||||
|
mp3.loop();
|
||||||
|
mp3.playMp3FolderTrack(fichier);
|
||||||
|
}
|
||||||
|
|
||||||
|
void stop(){
|
||||||
|
mp3.loop();
|
||||||
|
mp3.stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean statut(){
|
||||||
|
return (mp3.getStatus() == 513);
|
||||||
|
}
|
||||||
|
|
||||||
|
void volume(int vol){
|
||||||
|
mp3.setVolume(vol);
|
||||||
|
}
|
10
lib/DFPlayer/DFPlayer.h
Normal file
10
lib/DFPlayer/DFPlayer.h
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#ifndef DFPLAYER_H_INCLUDED
|
||||||
|
#define DFPLAYER_H_INCLUDED
|
||||||
|
|
||||||
|
void setup_dfp();
|
||||||
|
void play(int fichier);
|
||||||
|
void stop();
|
||||||
|
boolean statut();
|
||||||
|
void volume(int vol = 10);
|
||||||
|
|
||||||
|
#endif
|
72
lib/Leds/Leds.cpp
Normal file
72
lib/Leds/Leds.cpp
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
#include <Arduino.h>
|
||||||
|
#include <Leds.h>
|
||||||
|
#include <Adafruit_NeoPixel.h>
|
||||||
|
|
||||||
|
Adafruit_NeoPixel strip = Adafruit_NeoPixel(LED_NOMBRE, LED_PIN, NEO_GRB + NEO_KHZ800);
|
||||||
|
#ifdef __AVR__
|
||||||
|
#include <avr/power.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int last_puissance;
|
||||||
|
int lr;
|
||||||
|
int lg;
|
||||||
|
int lb;
|
||||||
|
boolean firstOFF(true);
|
||||||
|
boolean change(true);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* IMPORTANT !!!! Pour réduire les risque sur le bandeau, ajoutez un condensateur de 1000 uF sur l'alimentation
|
||||||
|
* Mettez une résistance entre 300 et 500 Ohm sur le DataIn de la première LED
|
||||||
|
* Minimiser la distance entre l'Arduino et la première led
|
||||||
|
* Pour préserver le circuit... si vous le voulez, brancher le GND en premier
|
||||||
|
*/
|
||||||
|
|
||||||
|
void setup_led(){
|
||||||
|
// This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket
|
||||||
|
#if defined (__AVR_ATtiny85__)
|
||||||
|
if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
|
||||||
|
#endif
|
||||||
|
// End of trinket special code
|
||||||
|
|
||||||
|
strip.begin();
|
||||||
|
strip.show(); // Éteint toutes les LEDs
|
||||||
|
}
|
||||||
|
|
||||||
|
void LEDoff(){
|
||||||
|
if (firstOFF){
|
||||||
|
strip.clear();
|
||||||
|
strip.show();
|
||||||
|
firstOFF = false;
|
||||||
|
Serial.println("OFF");
|
||||||
|
last_puissance = 0;
|
||||||
|
lr = 0;
|
||||||
|
lg = 0;
|
||||||
|
lb = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void LEDon(int puissance, int r, int g, int b){
|
||||||
|
|
||||||
|
if(r!=lr || g!=lg || b!=lb){
|
||||||
|
for (int LED=0; LED<LED_NOMBRE; LED++){
|
||||||
|
strip.setPixelColor(LED, r, g, b);
|
||||||
|
}
|
||||||
|
lr = r;
|
||||||
|
lg = g;
|
||||||
|
lb = b;
|
||||||
|
change = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(puissance != last_puissance){
|
||||||
|
strip.setBrightness(puissance);
|
||||||
|
last_puissance = puissance;
|
||||||
|
change = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(change) {
|
||||||
|
strip.show();
|
||||||
|
change = false;
|
||||||
|
}
|
||||||
|
firstOFF = true;
|
||||||
|
}
|
10
lib/Leds/Leds.h
Normal file
10
lib/Leds/Leds.h
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#ifndef LEDS_H_INCLUDED
|
||||||
|
#define LEDS_H_INCLUDED
|
||||||
|
#define LED_NOMBRE 47
|
||||||
|
#define LED_PIN 22
|
||||||
|
|
||||||
|
void setup_led();
|
||||||
|
void LEDoff();
|
||||||
|
void LEDon(int puissance, int r, int g, int b);
|
||||||
|
|
||||||
|
#endif
|
46
lib/README
Normal file
46
lib/README
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
|
||||||
|
This directory is intended for project specific (private) libraries.
|
||||||
|
PlatformIO will compile them to static libraries and link into executable file.
|
||||||
|
|
||||||
|
The source code of each library should be placed in a an own separate directory
|
||||||
|
("lib/your_library_name/[here are source files]").
|
||||||
|
|
||||||
|
For example, see a structure of the following two libraries `Foo` and `Bar`:
|
||||||
|
|
||||||
|
|--lib
|
||||||
|
| |
|
||||||
|
| |--Bar
|
||||||
|
| | |--docs
|
||||||
|
| | |--examples
|
||||||
|
| | |--src
|
||||||
|
| | |- Bar.c
|
||||||
|
| | |- Bar.h
|
||||||
|
| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html
|
||||||
|
| |
|
||||||
|
| |--Foo
|
||||||
|
| | |- Foo.c
|
||||||
|
| | |- Foo.h
|
||||||
|
| |
|
||||||
|
| |- README --> THIS FILE
|
||||||
|
|
|
||||||
|
|- platformio.ini
|
||||||
|
|--src
|
||||||
|
|- main.c
|
||||||
|
|
||||||
|
and a contents of `src/main.c`:
|
||||||
|
```
|
||||||
|
#include <Foo.h>
|
||||||
|
#include <Bar.h>
|
||||||
|
|
||||||
|
int main (void)
|
||||||
|
{
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
PlatformIO Library Dependency Finder will find automatically dependent
|
||||||
|
libraries scanning project source files.
|
||||||
|
|
||||||
|
More information about PlatformIO Library Dependency Finder
|
||||||
|
- https://docs.platformio.org/page/librarymanager/ldf.html
|
174
lib/Reseau/Reseau.cpp
Normal file
174
lib/Reseau/Reseau.cpp
Normal file
@ -0,0 +1,174 @@
|
|||||||
|
#include <Arduino.h>
|
||||||
|
#include <vector>
|
||||||
|
#include <SPI.h>
|
||||||
|
#include <string>
|
||||||
|
#include <Ethernet.h>
|
||||||
|
#include <PubSubClient.h>
|
||||||
|
#include <Reseau.h>
|
||||||
|
const byte last_mac = ID;
|
||||||
|
int id = ID;
|
||||||
|
byte mac[] = { 0x02, 0x00, 0x00, 0x7A, 0x38, last_mac };
|
||||||
|
IPAddress ip (192, 168, 8, 100+id);
|
||||||
|
IPAddress server(SERVEUR_MQTT);
|
||||||
|
|
||||||
|
uint32_t lastReconnectAttempt = 0;
|
||||||
|
unsigned long check;
|
||||||
|
|
||||||
|
//Just Header
|
||||||
|
void callback(char* topic, byte* payload, unsigned int length);
|
||||||
|
boolean connection();
|
||||||
|
|
||||||
|
EthernetClient ethClient;
|
||||||
|
PubSubClient client(server, PORT, callback, ethClient);
|
||||||
|
|
||||||
|
struct TopicParametre {
|
||||||
|
String topic;
|
||||||
|
int parametre;
|
||||||
|
int defaut;
|
||||||
|
boolean subscribe;
|
||||||
|
boolean define;
|
||||||
|
};
|
||||||
|
std::vector<TopicParametre> topic_parametre;
|
||||||
|
void AddParametre (String topic, int defaut){
|
||||||
|
String sujet = String(id)+"/"+topic;
|
||||||
|
TopicParametre valeure;
|
||||||
|
valeure.topic = sujet;
|
||||||
|
valeure.subscribe = false;
|
||||||
|
valeure.define = false;
|
||||||
|
valeure.defaut = defaut;
|
||||||
|
topic_parametre.push_back(valeure);
|
||||||
|
Serial.println("add");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void callback(char* topic, byte* payload, unsigned int length) {
|
||||||
|
Serial.print("Message arrived [");
|
||||||
|
Serial.print(topic);
|
||||||
|
Serial.print("] ");
|
||||||
|
for (int i=0;i<length;i++) {
|
||||||
|
Serial.print((char)payload[i]);
|
||||||
|
}
|
||||||
|
Serial.println();
|
||||||
|
|
||||||
|
for (size_t i = 0; i < topic_parametre.size(); i++){
|
||||||
|
if(String(topic) == topic_parametre[i].topic){
|
||||||
|
String valeure;
|
||||||
|
for (size_t j=0;j<length;j++) {
|
||||||
|
valeure += ((char)payload[j]);
|
||||||
|
}
|
||||||
|
topic_parametre[i].parametre = (int)(valeure.toInt());
|
||||||
|
topic_parametre[i].define = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean setup_reseau (){
|
||||||
|
Ethernet.init(5); // ESP32 with Adafruit Featherwing Ethernet
|
||||||
|
|
||||||
|
|
||||||
|
// start the Ethernet connection:
|
||||||
|
Serial.println("Initialize Ethernet:");
|
||||||
|
Ethernet.begin(mac,ip);
|
||||||
|
if (Ethernet.begin(mac) == 0) {
|
||||||
|
Serial.println("Failed to configure Ethernet");
|
||||||
|
if (Ethernet.hardwareStatus() == EthernetNoHardware) {
|
||||||
|
Serial.println("Ethernet shield was not found. Sorry, can't run without hardware. :(");
|
||||||
|
} else if (Ethernet.linkStatus() == LinkOFF) {
|
||||||
|
Serial.println("Ethernet cable is not connected.");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
//Ethernet.begin(mac,ip);
|
||||||
|
// print your local IP address:
|
||||||
|
Serial.print("My IP address: ");
|
||||||
|
Serial.println(Ethernet.localIP());
|
||||||
|
|
||||||
|
connection();
|
||||||
|
|
||||||
|
String msg = "Démarrage de la lampe "+String(id);
|
||||||
|
client.publish("outTopic",msg.c_str());
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean connection(){
|
||||||
|
|
||||||
|
Serial.println("connection");
|
||||||
|
if (client.connect((String(id)).c_str())) {
|
||||||
|
String msg = "Connexion de la lampe "+String(id);
|
||||||
|
client.publish("outTopic",msg.c_str());
|
||||||
|
client.subscribe("inTopic");
|
||||||
|
for(auto str:topic_parametre){
|
||||||
|
const char* topic = str.topic.c_str();
|
||||||
|
client.subscribe(topic);
|
||||||
|
str.subscribe = true;
|
||||||
|
Serial.print("sub: ");
|
||||||
|
Serial.println(topic);
|
||||||
|
}
|
||||||
|
Serial.println("subscribe OK");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean loop_reseau(){
|
||||||
|
unsigned long now = millis();
|
||||||
|
unsigned long intervalle = now - check;
|
||||||
|
client.loop();
|
||||||
|
|
||||||
|
if(client.state()==0){
|
||||||
|
check = now;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (intervalle > 20000) {
|
||||||
|
ESP.restart();
|
||||||
|
}
|
||||||
|
if (!client.connected()) {
|
||||||
|
Serial.println("=== MQTT NOT CONNECTED ===");
|
||||||
|
// Reconnect every 10 seconds
|
||||||
|
uint32_t t = millis();
|
||||||
|
if (t - lastReconnectAttempt > 10000L) {
|
||||||
|
lastReconnectAttempt = t;
|
||||||
|
if (connection()) {
|
||||||
|
lastReconnectAttempt = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//NO-USE - Pour tester la connexion avec la carte ethernet
|
||||||
|
if (Ethernet.linkStatus() == LinkOFF) {
|
||||||
|
}
|
||||||
|
else if (Ethernet.linkStatus() == LinkON) {
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean publish(String topic, String msg){
|
||||||
|
String sujet = String(id)+"/"+topic;
|
||||||
|
return (client.publish(sujet.c_str(),msg.c_str()) == 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
int ReadParametre (String topic){
|
||||||
|
//String sujet = String(ID)+"/"+topic;
|
||||||
|
for(auto val:topic_parametre){
|
||||||
|
String sujet = String(id)+"/"+topic;
|
||||||
|
|
||||||
|
if(sujet == val.topic){
|
||||||
|
if(val.define){
|
||||||
|
return val.parametre;
|
||||||
|
} else {
|
||||||
|
return val.defaut;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ResetValues (){
|
||||||
|
for(auto& val:topic_parametre){
|
||||||
|
val.define = false;
|
||||||
|
}
|
||||||
|
}
|
16
lib/Reseau/Reseau.h
Normal file
16
lib/Reseau/Reseau.h
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#ifndef RESEAU_H_INCLUDED
|
||||||
|
#define RESEAU_H_INCLUDED
|
||||||
|
#define ID 18
|
||||||
|
//de 0 à 255
|
||||||
|
#define SERVEUR_MQTT 192,168,8,100
|
||||||
|
#define PORT 1883
|
||||||
|
|
||||||
|
boolean setup_reseau ();
|
||||||
|
boolean loop_reseau();
|
||||||
|
|
||||||
|
boolean publish(String topic, String msg);
|
||||||
|
void AddParametre (String topic, int defaut = 0);
|
||||||
|
int ReadParametre (String topic);
|
||||||
|
void ResetValues ();
|
||||||
|
|
||||||
|
#endif
|
20
platformio.ini
Normal file
20
platformio.ini
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
; PlatformIO Project Configuration File
|
||||||
|
;
|
||||||
|
; Build options: build flags, source filter
|
||||||
|
; Upload options: custom upload port, speed and extra flags
|
||||||
|
; Library options: dependencies, extra library storages
|
||||||
|
; Advanced options: extra scripting
|
||||||
|
;
|
||||||
|
; Please visit documentation for the other options and examples
|
||||||
|
; https://docs.platformio.org/page/projectconf.html
|
||||||
|
|
||||||
|
[platformio]
|
||||||
|
default_envs = esp-wrover-kit
|
||||||
|
description = En développement continu
|
||||||
|
|
||||||
|
[env:esp-wrover-kit]
|
||||||
|
platform = espressif32
|
||||||
|
board = esp32dev
|
||||||
|
framework = arduino
|
||||||
|
monitor_speed = 115200
|
||||||
|
lib_deps = u-fire/uFire SHT20@^1.1.1
|
239
src/main.cpp
Normal file
239
src/main.cpp
Normal file
@ -0,0 +1,239 @@
|
|||||||
|
//Ajout des bibliothèques
|
||||||
|
#include <Arduino.h>
|
||||||
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
#include <Reseau.h>
|
||||||
|
#include <Bluetooth.h>
|
||||||
|
#include <DFPlayer.h>
|
||||||
|
#include <Leds.h>
|
||||||
|
#include <Wire.h>
|
||||||
|
#include <uFire_SHT20.h>
|
||||||
|
uFire_SHT20 sht20;
|
||||||
|
|
||||||
|
//Définition des PINs
|
||||||
|
#define LED 02
|
||||||
|
#define SON1 A15
|
||||||
|
#define SON2 14
|
||||||
|
#define PIR1 26
|
||||||
|
#define PIR2 27
|
||||||
|
#define INT1 34
|
||||||
|
#define INT2 35
|
||||||
|
#define TEST 04
|
||||||
|
#define CHAUF 25
|
||||||
|
|
||||||
|
|
||||||
|
int WatchDog;
|
||||||
|
std::vector<BeaconBLE> tag;
|
||||||
|
int volume_past;
|
||||||
|
boolean play_sound;
|
||||||
|
|
||||||
|
unsigned long tps_max;
|
||||||
|
int tps_last_max;
|
||||||
|
int analog_past(0);
|
||||||
|
boolean clign(false);
|
||||||
|
|
||||||
|
int color_r;
|
||||||
|
int color_g;
|
||||||
|
int color_b;
|
||||||
|
int LED_max;
|
||||||
|
int LED_ampli;
|
||||||
|
int vol_sound;
|
||||||
|
boolean chauffage;
|
||||||
|
boolean pb_test;
|
||||||
|
float humidity;
|
||||||
|
float temperature;
|
||||||
|
float dewpoint;
|
||||||
|
|
||||||
|
|
||||||
|
void setup() {
|
||||||
|
delay(5000);
|
||||||
|
|
||||||
|
//Définition des PINs
|
||||||
|
pinMode(LED, OUTPUT);
|
||||||
|
digitalWrite(LED,HIGH);
|
||||||
|
pinMode(PIR1,INPUT);
|
||||||
|
pinMode(PIR2,INPUT);
|
||||||
|
pinMode(TEST,INPUT_PULLUP);
|
||||||
|
pinMode(INT1,INPUT);
|
||||||
|
pinMode(INT2,INPUT);
|
||||||
|
pinMode(CHAUF, OUTPUT);
|
||||||
|
|
||||||
|
//Ouverture du port série pour l'ordi
|
||||||
|
Serial.begin(115200);
|
||||||
|
|
||||||
|
//Ajout des paramètres d'entrées
|
||||||
|
AddParametre("BLE/recherche", 1);
|
||||||
|
AddParametre("LED/ON", 0);
|
||||||
|
AddParametre("LED/color/r", 245);
|
||||||
|
AddParametre("LED/color/g", 255);
|
||||||
|
AddParametre("LED/color/b", 20);
|
||||||
|
AddParametre("LED/MAX", 40);
|
||||||
|
AddParametre("LED/ampli", 20);
|
||||||
|
AddParametre("SON/volume", 20);
|
||||||
|
AddParametre("TEMP/CHAUFFAGE", 0);
|
||||||
|
AddParametre("WDG/ESP");
|
||||||
|
|
||||||
|
//Setup des différentes fonctions
|
||||||
|
setup_ble();
|
||||||
|
while (!setup_reseau()) {
|
||||||
|
delay(500);
|
||||||
|
Serial.println("Echec réseau");
|
||||||
|
}
|
||||||
|
setup_led();
|
||||||
|
Wire.begin(15,13);
|
||||||
|
sht20.begin();
|
||||||
|
|
||||||
|
|
||||||
|
delay(random(5000));
|
||||||
|
|
||||||
|
//Check première connection
|
||||||
|
WatchDog = random(1000);
|
||||||
|
publish("WDG/NR", String(WatchDog));
|
||||||
|
while (WatchDog != ReadParametre("WDG/ESP")){
|
||||||
|
Serial.println("Pas encore connecté");
|
||||||
|
loop_reseau();
|
||||||
|
delay(100);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Reset valeurs des paramètres
|
||||||
|
//ResetValues();
|
||||||
|
|
||||||
|
//Setup du DFPlayer
|
||||||
|
setup_dfp();
|
||||||
|
|
||||||
|
|
||||||
|
//Paramètre fixe
|
||||||
|
color_r = ReadParametre("LED/color/r");
|
||||||
|
color_g = ReadParametre("LED/color/g");
|
||||||
|
color_b = ReadParametre("LED/color/b");
|
||||||
|
LED_max = ReadParametre("LED/MAX");
|
||||||
|
LED_ampli = ReadParametre("LED/ampli");
|
||||||
|
vol_sound = ReadParametre("SON/volume");
|
||||||
|
}
|
||||||
|
|
||||||
|
void loop() {
|
||||||
|
if(loop_reseau()){
|
||||||
|
digitalWrite(LED,LOW);
|
||||||
|
} else {
|
||||||
|
digitalWrite(LED,HIGH);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
publish("INT1", String(digitalRead(INT1)));
|
||||||
|
publish("INT2", String(digitalRead(INT2)));
|
||||||
|
|
||||||
|
|
||||||
|
//Lecture des paramètres BLE + LED
|
||||||
|
int recherche = ReadParametre("BLE/recherche");
|
||||||
|
int actif = ReadParametre("LED/ON");
|
||||||
|
|
||||||
|
if(!actif){
|
||||||
|
//Paramètre fixe
|
||||||
|
color_r = ReadParametre("LED/color/r");
|
||||||
|
color_g = ReadParametre("LED/color/g");
|
||||||
|
color_b = ReadParametre("LED/color/b");
|
||||||
|
LED_max = ReadParametre("LED/MAX");
|
||||||
|
LED_ampli = ReadParametre("LED/ampli");
|
||||||
|
vol_sound = ReadParametre("SON/volume");
|
||||||
|
|
||||||
|
chauffage = ReadParametre("TEMP/CHAUFFAGE");
|
||||||
|
pb_test = !digitalRead(TEST);
|
||||||
|
humidity = sht20.humidity();
|
||||||
|
temperature = sht20.temperature();
|
||||||
|
dewpoint = sht20.dew_point();
|
||||||
|
|
||||||
|
Serial.print("humidité: ");
|
||||||
|
Serial.println(humidity);
|
||||||
|
publish("TEMP/HR",String(humidity));
|
||||||
|
Serial.print("Température: ");
|
||||||
|
Serial.println(temperature);
|
||||||
|
publish("TEMP/T",String(temperature));
|
||||||
|
//Serial.print("Dewpoint: ");
|
||||||
|
//Serial.println(dewpoint);
|
||||||
|
publish("TEMP/DP",String(dewpoint));
|
||||||
|
|
||||||
|
if(volume_past != vol_sound){
|
||||||
|
volume(vol_sound);
|
||||||
|
volume_past = vol_sound;
|
||||||
|
}
|
||||||
|
|
||||||
|
digitalWrite(CHAUF, chauffage);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
chauffage = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean pir_1 = digitalRead(PIR1);
|
||||||
|
boolean pir_2 = digitalRead(PIR2);
|
||||||
|
int son1 = random(1000);//analogRead(SON1);
|
||||||
|
int son2 = analogRead(SON2);
|
||||||
|
|
||||||
|
|
||||||
|
// envoie des capteurs de mouvements
|
||||||
|
publish("PIR1", String(pir_1));
|
||||||
|
publish("PIR2", String(pir_2));
|
||||||
|
|
||||||
|
Serial.println(son1);
|
||||||
|
|
||||||
|
unsigned long now = millis();
|
||||||
|
if((son1-analog_past)>0){
|
||||||
|
analog_past = son1;
|
||||||
|
clign = true;
|
||||||
|
} else if((son1-analog_past)<0){
|
||||||
|
analog_past = son1;
|
||||||
|
clign = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(clign){
|
||||||
|
tps_last_max = now - tps_max;
|
||||||
|
tps_max = now;
|
||||||
|
}
|
||||||
|
int x = son1 -2500;
|
||||||
|
int y = map(x, 0, 1500, 0, LED_ampli);
|
||||||
|
int val = map(y, 0, LED_ampli, 0, LED_max);
|
||||||
|
|
||||||
|
//Serial.println(son1);
|
||||||
|
//Serial.println(LED_max);
|
||||||
|
//Serial.println(LED_ampli);
|
||||||
|
//Serial.println(val);
|
||||||
|
//Serial.println(tps_last_max);
|
||||||
|
//publish("test", String(val));
|
||||||
|
|
||||||
|
//--------------------
|
||||||
|
|
||||||
|
if(recherche){
|
||||||
|
tag = loop_ble();
|
||||||
|
for(auto val:tag){
|
||||||
|
publish("BLE/TAG",val.adresse + " => " + val.qualite);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if(actif){
|
||||||
|
Serial.println("TEST");
|
||||||
|
//LEDon(val,color_r,color_g,color_b);
|
||||||
|
delay(100);
|
||||||
|
if(clign){
|
||||||
|
LEDon(LED_max,color_r,color_g,color_b);
|
||||||
|
Serial.println("ON");
|
||||||
|
} else {
|
||||||
|
LEDon(LED_max-(LED_ampli*LED_max)/100,color_r,color_g,color_b);
|
||||||
|
Serial.println("OFF");
|
||||||
|
}
|
||||||
|
if(!play_sound){
|
||||||
|
play(1);
|
||||||
|
play_sound = true;
|
||||||
|
}
|
||||||
|
digitalWrite(CHAUF, 0);
|
||||||
|
} else {
|
||||||
|
LEDoff();
|
||||||
|
stop();
|
||||||
|
play_sound = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Serial.println("--- - --- - ---");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
11
test/README
Normal file
11
test/README
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
This directory is intended for PIO Unit Testing and project tests.
|
||||||
|
|
||||||
|
Unit Testing is a software testing method by which individual units of
|
||||||
|
source code, sets of one or more MCU program modules together with associated
|
||||||
|
control data, usage procedures, and operating procedures, are tested to
|
||||||
|
determine whether they are fit for use. Unit testing finds problems early
|
||||||
|
in the development cycle.
|
||||||
|
|
||||||
|
More information about PIO Unit Testing:
|
||||||
|
- https://docs.platformio.org/page/plus/unit-testing.html
|
Loading…
Reference in New Issue
Block a user