From a01b3b0f982cee6c3e1b030b4696779938bedd67 Mon Sep 17 00:00:00 2001 From: Clement Date: Sat, 24 Jun 2023 17:09:33 +0200 Subject: [PATCH 01/27] feat: template --- IOT/.clang-tidy | 7 +++ IOT/.editorconfig | 39 +++++++++++++++ IOT/.gitignore | 12 +++++ IOT/.vscode/extensions.json | 10 ++++ IOT/config.cppcheck | 19 ++++++++ IOT/config.ini | 19 ++++++++ IOT/docs/README.md | 18 +++++++ IOT/envs.ini | 15 ++++++ IOT/include/Program.h | 19 ++++++++ IOT/include/README | 39 +++++++++++++++ IOT/lib/README | 46 ++++++++++++++++++ IOT/platformio.ini | 73 +++++++++++++++++++++++++++++ IOT/scripts/get_additionnal_envs.py | 41 ++++++++++++++++ IOT/secrets.ini.example | 6 +++ IOT/src/Program.cpp | 10 ++++ IOT/src/main.cpp | 11 +++++ IOT/test/README | 11 +++++ 17 files changed, 395 insertions(+) create mode 100644 IOT/.clang-tidy create mode 100644 IOT/.editorconfig create mode 100644 IOT/.gitignore create mode 100644 IOT/.vscode/extensions.json create mode 100644 IOT/config.cppcheck create mode 100644 IOT/config.ini create mode 100644 IOT/docs/README.md create mode 100644 IOT/envs.ini create mode 100644 IOT/include/Program.h create mode 100644 IOT/include/README create mode 100644 IOT/lib/README create mode 100644 IOT/platformio.ini create mode 100644 IOT/scripts/get_additionnal_envs.py create mode 100644 IOT/secrets.ini.example create mode 100644 IOT/src/Program.cpp create mode 100644 IOT/src/main.cpp create mode 100644 IOT/test/README diff --git a/IOT/.clang-tidy b/IOT/.clang-tidy new file mode 100644 index 0000000..790367c --- /dev/null +++ b/IOT/.clang-tidy @@ -0,0 +1,7 @@ +# Clangtidy configuration file (not used until PIO 6) +--- +Checks: 'abseil-*,boost-*,bugprone-*,cert-*,cppcoreguidelines-*,clang-analyzer-*,google-*,hicpp-*,modernize-*,performance-*,portability-*,readability-*,-cppcoreguidelines-avoid-non-const-global-variables,-cppcoreguidelines-owning-memory,-modernize-use-trailing-return-type,-cppcoreguidelines-init-variables' +WarningsAsErrors: false +HeaderFilterRegex: '' +AnalyzeTemporaryDtors: false +FormatStyle: google diff --git a/IOT/.editorconfig b/IOT/.editorconfig new file mode 100644 index 0000000..fdfd862 --- /dev/null +++ b/IOT/.editorconfig @@ -0,0 +1,39 @@ +root = true + +# Base Configuration +[*] +indent_style = tab +indent_size = 4 +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 120 +end_of_line = lf + +# Yaml Standard +[*.{yaml,yml}] +indent_style = space +indent_size = 2 + +# Markdown Standards +[*.md] +indent_style = space +indent_size = 2 +trim_trailing_whitespace = false + +# Java, Kotlin, Gradle, XML Standards +[*.{java,kt,kts,gradle,xml,pro}] +indent_style = space + + +# C++ Files +[*.{cpp,h,ino}] +indent_style = space + +# PHP files +[*.php] +indent_style = space + +# INI Files +[*.ini] +indent_style = space diff --git a/IOT/.gitignore b/IOT/.gitignore new file mode 100644 index 0000000..53072ca --- /dev/null +++ b/IOT/.gitignore @@ -0,0 +1,12 @@ +# macOS +.DS_Store + +# Platformio specifics +.pio +.vscode/.browse.c_cpp.db* +.vscode/c_cpp_properties.json +.vscode/launch.json +.vscode/ipch + +# Aptatio/Platformio specifics +secrets.ini diff --git a/IOT/.vscode/extensions.json b/IOT/.vscode/extensions.json new file mode 100644 index 0000000..080e70d --- /dev/null +++ b/IOT/.vscode/extensions.json @@ -0,0 +1,10 @@ +{ + // See http://go.microsoft.com/fwlink/?LinkId=827846 + // for the documentation about the extensions.json format + "recommendations": [ + "platformio.platformio-ide" + ], + "unwantedRecommendations": [ + "ms-vscode.cpptools-extension-pack" + ] +} diff --git a/IOT/config.cppcheck b/IOT/config.cppcheck new file mode 100644 index 0000000..77fd7d8 --- /dev/null +++ b/IOT/config.cppcheck @@ -0,0 +1,19 @@ + + + + .cppcheck-build + Unspecified + false + true + false + 10 + + + + + noCopyConstructor + noExplicitConstructor + unusedFunction + noOperatorEq + + diff --git a/IOT/config.ini b/IOT/config.ini new file mode 100644 index 0000000..11e4023 --- /dev/null +++ b/IOT/config.ini @@ -0,0 +1,19 @@ +; Project configuration file + +[config] +; Hardware Serial baud rate +; Also available in the code as `MONITOR_SPEED` +monitor_speed = 115200 + +; Software Config +; note: additionnal flags are added by Platform.io (see total amount in `.vscode/c_cpp_properties.json` in the `defines` section) +; notworthy ones: +; __PLATFORMIO_BUILD_DEBUG__ = debug mode +build_flags = +; DO NOT TOUCH --- START + -D MONITOR_SPEED=${config.monitor_speed} +; DO NOT TOUCH --- END + + -D EXAMPLE_NUMBER=69 + + -D EXAMPLE_STRING=\"Pouet\" diff --git a/IOT/docs/README.md b/IOT/docs/README.md new file mode 100644 index 0000000..9ff0271 --- /dev/null +++ b/IOT/docs/README.md @@ -0,0 +1,18 @@ +# Docs + +Documentation Technique du projet + +## fichiers .puml + +Les fichiers en .puml sont des fichiers UMLs sous forme de code + +Afin d'en avoir le résultat graphique : + +1. Ouvrez un navigateur +2. lancer le lien suivant [https://www.plantuml.com/plantuml/uml/](https://www.plantuml.com/plantuml/uml/) +3. Copiez/Collez le contenu du fichier .puml dans le voite de texte +4. Cliquez sur `Submit` + +ou si vous utilisez `VSCode`: +1. installez l'extensions [PlantUML](https://marketplace.visualstudio.com/items?itemName=jebbs.plantuml) _jebbs.plantuml_ +2. `ALT+D` lorsque vous êtes dans un fichier .puml diff --git a/IOT/envs.ini b/IOT/envs.ini new file mode 100644 index 0000000..9df4a04 --- /dev/null +++ b/IOT/envs.ini @@ -0,0 +1,15 @@ +; Add additionnal environments in this file + +; Default production environment +[env:prod] + +; Debug environemnt +[env:debug] +build_type = debug + + +; Example additionnal env +; [env:example] +; ; note: keep the `${env.build_flags}` to includes others build flags +; build_flags = ${env.build_flags} +; -D POUET diff --git a/IOT/include/Program.h b/IOT/include/Program.h new file mode 100644 index 0000000..66e4a79 --- /dev/null +++ b/IOT/include/Program.h @@ -0,0 +1,19 @@ +#ifndef PROGRAM_H +#define PROGRAM_H + +#include "Arduino.h" + +class Program { +public: + /** + * Program startup + */ + Program(); + + /** + * Program main loop + */ + void loop(); +}; + +#endif diff --git a/IOT/include/README b/IOT/include/README new file mode 100644 index 0000000..194dcd4 --- /dev/null +++ b/IOT/include/README @@ -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 diff --git a/IOT/lib/README b/IOT/lib/README new file mode 100644 index 0000000..6debab1 --- /dev/null +++ b/IOT/lib/README @@ -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 +#include + +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 diff --git a/IOT/platformio.ini b/IOT/platformio.ini new file mode 100644 index 0000000..329b7c7 --- /dev/null +++ b/IOT/platformio.ini @@ -0,0 +1,73 @@ +; PlatformIO Project Configuration File + +; WARNING: Items containing version number MUST be the version NOT A RANGE + +; Additionnal files +; `secrets.ini`: Secret Build Flags that will be ignored in git (content: `[secrets]\nbuild_flags = `) +; `envs.ini`: Build environments +; `config.ini`: Global Configuration File + +; Defaults +[secrets] +build_flags = + +[platformio] +default_envs = debug +extra_configs = + secrets.ini + config.ini + envs.ini + +; Cache folder +build_cache_dir = ./.pio/cache + +[env] +; build Envs +build_flags = ${config.build_flags} ${secrets.build_flags} + +; Add scripts for more functionnalities +; see individual scripts for more informations +extra_scripts = pre:scripts/get_additionnal_envs.py + +; Device Settings (make sure to fix versions where possible!) +platform = espressif8266 +board = d1_mini +framework = arduino + +; Monitoring settings +monitor_speed = ${config.monitor_speed} + +; note: make sure to rebuild after changing it (log2file add a .log file containing the monitor logs) +monitor_filters = esp32_exception_decoder, time, send_on_enter, default ;, log2file + +; Ask the monitor to echo the content written +monitor_echo = yes + +; upload settings +; upload_port = COM1 + +upload_speed = 921600 + +; librairies (make sure to fix versions where possible!) +lib_deps = +; example: +; erropix/ESP32 AnalogWrite@0.2 + +; Checker settings +check_tool = clangtidy, cppcheck + +; Filters for checkers +check_src_filters = + + + + + + + + + -<.pio/> + +; Ask pio to not scan `./.pio` files +check_skip_packages = yes + +; use config files for clangtidy and cppcheck +check_flags = + clangtidy: --config-file=.clang-tidy + cppcheck: --project=config.cppcheck --inline-suppr -i=".pio" diff --git a/IOT/scripts/get_additionnal_envs.py b/IOT/scripts/get_additionnal_envs.py new file mode 100644 index 0000000..0a349fd --- /dev/null +++ b/IOT/scripts/get_additionnal_envs.py @@ -0,0 +1,41 @@ +""" + Add additionnal ENVs to the program + + GIT_COMMIT: the git commit ID + GIT_BRANCH: the current git branch + GIT_TAG: the current git tag or "dev" + + _note: to get the full list of env at build time run: `pio run -t envdump > pouet.log` and look at "BUILD_FLAGS_ +""" + +import subprocess + +Import("env") + +def run_command(command): + """ + run a command on the system + """ + return subprocess.run(command, stdout=subprocess.PIPE, text=True).stdout + +def get_additionnal_envs(): + """ + get the git commit/branch/tag of the project and return them + """ + commit = run_command(["git", "rev-parse", "HEAD"])[:7] + branch = run_command(["git", "rev-parse", "--abbrev-ref", "HEAD"]) + tag = run_command(["git", "tag", "-l", "--points-at", "HEAD"]) + + items = [ + f"-D GIT_COMMIT=\\\"{commit}\\\"", + f"-D GIT_BRANCH=\\\"{branch.strip()}\\\"" + ] + if tag != "": + items.append(f"-D GIT_TAG=\\\"{tag.strip()}\\\"") + else: + items.append("-D GIT_TAG=\\\"dev\\\"") + return items + +env.Append( + BUILD_FLAGS=get_additionnal_envs() +) diff --git a/IOT/secrets.ini.example b/IOT/secrets.ini.example new file mode 100644 index 0000000..90b9782 --- /dev/null +++ b/IOT/secrets.ini.example @@ -0,0 +1,6 @@ +; Add secrets token/logins/etc `secrets.ini` +; Add the sames values as blank in `secrets.ini.example +; To be able to reproduce it + +[secrets] +build_flags = diff --git a/IOT/src/Program.cpp b/IOT/src/Program.cpp new file mode 100644 index 0000000..e412959 --- /dev/null +++ b/IOT/src/Program.cpp @@ -0,0 +1,10 @@ +#include "Program.h" + +Program::Program() { + // Startup + Serial.begin(MONITOR_SPEED); +} + +void Program::loop() { + // Loop +} diff --git a/IOT/src/main.cpp b/IOT/src/main.cpp new file mode 100644 index 0000000..74bf5a7 --- /dev/null +++ b/IOT/src/main.cpp @@ -0,0 +1,11 @@ +#include "Program.h" + +Program* program; + +void setup() { + program = new Program(); +} + +void loop() { + program->loop(); +} diff --git a/IOT/test/README b/IOT/test/README new file mode 100644 index 0000000..9b1e87b --- /dev/null +++ b/IOT/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PlatformIO Test Runner 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 PlatformIO Unit Testing: +- https://docs.platformio.org/en/latest/advanced/unit-testing/index.html From 36a1fe4d910895844232ab7d223ab89958f24dca Mon Sep 17 00:00:00 2001 From: Clement Date: Sat, 24 Jun 2023 20:10:25 +0200 Subject: [PATCH 02/27] =?UTF-8?q?feat=20:=20lecteur=20capteur=20temp=C3=A9?= =?UTF-8?q?rature=20(DHT22)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IOT/include/Program.h | 9 +++++- IOT/lib/Capteur/include/Capteur.h | 49 ++++++++++++++++++++++++++++++ IOT/lib/Capteur/include/HumiTemp.h | 38 +++++++++++++++++++++++ IOT/lib/Capteur/src/Capteur.cpp | 13 ++++++++ IOT/lib/Capteur/src/HumiTemp.cpp | 34 +++++++++++++++++++++ IOT/platformio.ini | 2 ++ IOT/src/Program.cpp | 3 ++ 7 files changed, 147 insertions(+), 1 deletion(-) create mode 100644 IOT/lib/Capteur/include/Capteur.h create mode 100644 IOT/lib/Capteur/include/HumiTemp.h create mode 100644 IOT/lib/Capteur/src/Capteur.cpp create mode 100644 IOT/lib/Capteur/src/HumiTemp.cpp diff --git a/IOT/include/Program.h b/IOT/include/Program.h index 66e4a79..7f57f9b 100644 --- a/IOT/include/Program.h +++ b/IOT/include/Program.h @@ -1,7 +1,9 @@ #ifndef PROGRAM_H #define PROGRAM_H -#include "Arduino.h" +#include +#include "Capteur.h" +#include "HumiTemp.h" class Program { public: @@ -14,6 +16,11 @@ public: * Program main loop */ void loop(); +private: + + //TODO: faire commentaire + Capteur* DHT; + }; #endif diff --git a/IOT/lib/Capteur/include/Capteur.h b/IOT/lib/Capteur/include/Capteur.h new file mode 100644 index 0000000..1844cdc --- /dev/null +++ b/IOT/lib/Capteur/include/Capteur.h @@ -0,0 +1,49 @@ +#ifndef CAPTEUR_H +#define CAPTEUR_H + +#include + +class Capteur{ +public: + + /** + * @brief Construct a new Capteur object + * + * @param[in] type type de mesure lue (T/H, W, D,...) + */ + Capteur(String type); + + /** + * @brief tar le capteur si il a besoins d'être tarré + * + * @param[in] val *opt* si le capteur a besoins d'une valeur de ref pour être tarré + * @return true si la tarre a bien réussi (ou si il n'a pas besoins de tarre) + * @return false erreur durrant la tar + */ + virtual bool tar(int val = 0); + + /** + * @brief lit la valeur du capteur + * + * @return String retour la valeur + */ + virtual String read() = 0; + + /** + * @brief retourne le type de valeur lue + * + * @return String + */ + String getValType(); + +protected: + /** + * @brief type de mesure lue (T/H, W, D,...) + * + */ + String type; + +}; + + +#endif // CAPTEUR_H diff --git a/IOT/lib/Capteur/include/HumiTemp.h b/IOT/lib/Capteur/include/HumiTemp.h new file mode 100644 index 0000000..09a937e --- /dev/null +++ b/IOT/lib/Capteur/include/HumiTemp.h @@ -0,0 +1,38 @@ +#ifndef HUMI_TEMP_H +#define HUMI_TEMP_H + +#include +#include +#include "Capteur.h" + +class HumiTemp : public Capteur{ + +public: + + /** + * @brief Construct a new Humi Temp object + * + * @param pin pin du capteur dht + * @param type type de capteur dht (11,22,...) + */ + HumiTemp(int pin, uint8_t type); + + /** + * @brief lit le capteur d'humi/temp + * + * @return String valeur format "XX/YY" X% et Y°C + */ + String read(); + + //TODO: faire commentaire + int getTemp(); + int getHumi(); + +private: + + DHT* capteur; + +}; + + +#endif //HUMI_TEMP_H diff --git a/IOT/lib/Capteur/src/Capteur.cpp b/IOT/lib/Capteur/src/Capteur.cpp new file mode 100644 index 0000000..b54b9e4 --- /dev/null +++ b/IOT/lib/Capteur/src/Capteur.cpp @@ -0,0 +1,13 @@ +#include "../include/Capteur.h" + +Capteur::Capteur(String type){ + this->type = type; +} + +bool Capteur::tar(int val){ + return true; +} + +String Capteur::getValType(){ + return this->type; +} \ No newline at end of file diff --git a/IOT/lib/Capteur/src/HumiTemp.cpp b/IOT/lib/Capteur/src/HumiTemp.cpp new file mode 100644 index 0000000..5f98982 --- /dev/null +++ b/IOT/lib/Capteur/src/HumiTemp.cpp @@ -0,0 +1,34 @@ +#include "../include/HumiTemp.h" + +HumiTemp::HumiTemp(int pin, uint8_t type): + Capteur("H/T"){ + this->capteur = new DHT(pin, type); + this->capteur->begin(); +} + +int HumiTemp::getTemp(){ + int temp = this->capteur->readTemperature(); + if(isnan(temp)){ + Serial.println(" DHT reading failed "); + return -1; + } + return temp; +} + +int HumiTemp::getHumi(){ + int hum = this->capteur->readHumidity(); + if(isnan(hum)){ + Serial.println(" DHT reading failed "); + return -1; + } + return hum; +} + +String HumiTemp::read(){ + String sortie = ""; + + sortie += String(this->getHumi()); + sortie += "/"; + sortie += String(this->getTemp()); + return sortie; +} diff --git a/IOT/platformio.ini b/IOT/platformio.ini index 329b7c7..f1d6117 100644 --- a/IOT/platformio.ini +++ b/IOT/platformio.ini @@ -52,6 +52,8 @@ upload_speed = 921600 lib_deps = ; example: ; erropix/ESP32 AnalogWrite@0.2 + adafruit/DHT sensor library@^1.4.4 + adafruit/Adafruit Unified Sensor@^1.1.9 ; required by DHT ; Checker settings check_tool = clangtidy, cppcheck diff --git a/IOT/src/Program.cpp b/IOT/src/Program.cpp index e412959..13a068b 100644 --- a/IOT/src/Program.cpp +++ b/IOT/src/Program.cpp @@ -3,8 +3,11 @@ Program::Program() { // Startup Serial.begin(MONITOR_SPEED); + this->DHT = new HumiTemp(D4, DHT22); } void Program::loop() { // Loop + delay(2000); + Serial.println(this->DHT->read()); } From 8c588ed2c08f8d4dabf2f9f5a522f0f3e6d19286 Mon Sep 17 00:00:00 2001 From: Clement Date: Sun, 25 Jun 2023 10:38:25 +0200 Subject: [PATCH 03/27] fix: move IOT to capteur subfolder --- IOT/{ => Capteur}/.clang-tidy | 0 IOT/{ => Capteur}/.editorconfig | 0 IOT/{ => Capteur}/.gitignore | 0 IOT/{ => Capteur}/.vscode/extensions.json | 0 IOT/Capteur/.vscode/settings.json | 6 ++++++ IOT/{ => Capteur}/config.cppcheck | 0 IOT/{ => Capteur}/config.ini | 0 IOT/{ => Capteur}/docs/README.md | 0 IOT/{ => Capteur}/envs.ini | 0 IOT/{ => Capteur}/include/Program.h | 0 IOT/{ => Capteur}/include/README | 0 IOT/{ => Capteur}/lib/Capteur/include/Capteur.h | 0 IOT/{ => Capteur}/lib/Capteur/include/HumiTemp.h | 0 IOT/{ => Capteur}/lib/Capteur/src/Capteur.cpp | 0 IOT/{ => Capteur}/lib/Capteur/src/HumiTemp.cpp | 0 IOT/{ => Capteur}/lib/README | 0 IOT/{ => Capteur}/platformio.ini | 0 IOT/{ => Capteur}/scripts/get_additionnal_envs.py | 0 IOT/{ => Capteur}/secrets.ini.example | 0 IOT/{ => Capteur}/src/Program.cpp | 0 IOT/{ => Capteur}/src/main.cpp | 0 IOT/{ => Capteur}/test/README | 0 22 files changed, 6 insertions(+) rename IOT/{ => Capteur}/.clang-tidy (100%) rename IOT/{ => Capteur}/.editorconfig (100%) rename IOT/{ => Capteur}/.gitignore (100%) rename IOT/{ => Capteur}/.vscode/extensions.json (100%) create mode 100644 IOT/Capteur/.vscode/settings.json rename IOT/{ => Capteur}/config.cppcheck (100%) rename IOT/{ => Capteur}/config.ini (100%) rename IOT/{ => Capteur}/docs/README.md (100%) rename IOT/{ => Capteur}/envs.ini (100%) rename IOT/{ => Capteur}/include/Program.h (100%) rename IOT/{ => Capteur}/include/README (100%) rename IOT/{ => Capteur}/lib/Capteur/include/Capteur.h (100%) rename IOT/{ => Capteur}/lib/Capteur/include/HumiTemp.h (100%) rename IOT/{ => Capteur}/lib/Capteur/src/Capteur.cpp (100%) rename IOT/{ => Capteur}/lib/Capteur/src/HumiTemp.cpp (100%) rename IOT/{ => Capteur}/lib/README (100%) rename IOT/{ => Capteur}/platformio.ini (100%) rename IOT/{ => Capteur}/scripts/get_additionnal_envs.py (100%) rename IOT/{ => Capteur}/secrets.ini.example (100%) rename IOT/{ => Capteur}/src/Program.cpp (100%) rename IOT/{ => Capteur}/src/main.cpp (100%) rename IOT/{ => Capteur}/test/README (100%) diff --git a/IOT/.clang-tidy b/IOT/Capteur/.clang-tidy similarity index 100% rename from IOT/.clang-tidy rename to IOT/Capteur/.clang-tidy diff --git a/IOT/.editorconfig b/IOT/Capteur/.editorconfig similarity index 100% rename from IOT/.editorconfig rename to IOT/Capteur/.editorconfig diff --git a/IOT/.gitignore b/IOT/Capteur/.gitignore similarity index 100% rename from IOT/.gitignore rename to IOT/Capteur/.gitignore diff --git a/IOT/.vscode/extensions.json b/IOT/Capteur/.vscode/extensions.json similarity index 100% rename from IOT/.vscode/extensions.json rename to IOT/Capteur/.vscode/extensions.json diff --git a/IOT/Capteur/.vscode/settings.json b/IOT/Capteur/.vscode/settings.json new file mode 100644 index 0000000..d01027a --- /dev/null +++ b/IOT/Capteur/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "files.associations": { + "*.html": "html", + "cmath": "cpp" + } +} \ No newline at end of file diff --git a/IOT/config.cppcheck b/IOT/Capteur/config.cppcheck similarity index 100% rename from IOT/config.cppcheck rename to IOT/Capteur/config.cppcheck diff --git a/IOT/config.ini b/IOT/Capteur/config.ini similarity index 100% rename from IOT/config.ini rename to IOT/Capteur/config.ini diff --git a/IOT/docs/README.md b/IOT/Capteur/docs/README.md similarity index 100% rename from IOT/docs/README.md rename to IOT/Capteur/docs/README.md diff --git a/IOT/envs.ini b/IOT/Capteur/envs.ini similarity index 100% rename from IOT/envs.ini rename to IOT/Capteur/envs.ini diff --git a/IOT/include/Program.h b/IOT/Capteur/include/Program.h similarity index 100% rename from IOT/include/Program.h rename to IOT/Capteur/include/Program.h diff --git a/IOT/include/README b/IOT/Capteur/include/README similarity index 100% rename from IOT/include/README rename to IOT/Capteur/include/README diff --git a/IOT/lib/Capteur/include/Capteur.h b/IOT/Capteur/lib/Capteur/include/Capteur.h similarity index 100% rename from IOT/lib/Capteur/include/Capteur.h rename to IOT/Capteur/lib/Capteur/include/Capteur.h diff --git a/IOT/lib/Capteur/include/HumiTemp.h b/IOT/Capteur/lib/Capteur/include/HumiTemp.h similarity index 100% rename from IOT/lib/Capteur/include/HumiTemp.h rename to IOT/Capteur/lib/Capteur/include/HumiTemp.h diff --git a/IOT/lib/Capteur/src/Capteur.cpp b/IOT/Capteur/lib/Capteur/src/Capteur.cpp similarity index 100% rename from IOT/lib/Capteur/src/Capteur.cpp rename to IOT/Capteur/lib/Capteur/src/Capteur.cpp diff --git a/IOT/lib/Capteur/src/HumiTemp.cpp b/IOT/Capteur/lib/Capteur/src/HumiTemp.cpp similarity index 100% rename from IOT/lib/Capteur/src/HumiTemp.cpp rename to IOT/Capteur/lib/Capteur/src/HumiTemp.cpp diff --git a/IOT/lib/README b/IOT/Capteur/lib/README similarity index 100% rename from IOT/lib/README rename to IOT/Capteur/lib/README diff --git a/IOT/platformio.ini b/IOT/Capteur/platformio.ini similarity index 100% rename from IOT/platformio.ini rename to IOT/Capteur/platformio.ini diff --git a/IOT/scripts/get_additionnal_envs.py b/IOT/Capteur/scripts/get_additionnal_envs.py similarity index 100% rename from IOT/scripts/get_additionnal_envs.py rename to IOT/Capteur/scripts/get_additionnal_envs.py diff --git a/IOT/secrets.ini.example b/IOT/Capteur/secrets.ini.example similarity index 100% rename from IOT/secrets.ini.example rename to IOT/Capteur/secrets.ini.example diff --git a/IOT/src/Program.cpp b/IOT/Capteur/src/Program.cpp similarity index 100% rename from IOT/src/Program.cpp rename to IOT/Capteur/src/Program.cpp diff --git a/IOT/src/main.cpp b/IOT/Capteur/src/main.cpp similarity index 100% rename from IOT/src/main.cpp rename to IOT/Capteur/src/main.cpp diff --git a/IOT/test/README b/IOT/Capteur/test/README similarity index 100% rename from IOT/test/README rename to IOT/Capteur/test/README From 1ecf8d3270a10f5b24c3c3b6e82c68596bd4d17b Mon Sep 17 00:00:00 2001 From: Clement Date: Sun, 25 Jun 2023 10:38:35 +0200 Subject: [PATCH 04/27] create receiver lora --- IOT/receiver LoRa/.clang-tidy | 7 ++ IOT/receiver LoRa/.editorconfig | 39 ++++++++++ IOT/receiver LoRa/.gitattributes | 1 + .../.github/ISSUE_TEMPLATE/autre.yml | 11 +++ .../.github/ISSUE_TEMPLATE/config.yml | 6 ++ .../ISSUE_TEMPLATE/idee_amelioration.yml | 21 ++++++ .../.github/ISSUE_TEMPLATE/rapport_de_bug.yml | 31 ++++++++ .../.github/PULL_REQUEST_TEMPLATE.md | 8 ++ .../.github/workflows/test_build.yml | 41 +++++++++++ IOT/receiver LoRa/.gitignore | 12 +++ IOT/receiver LoRa/.vscode/extensions.json | 10 +++ IOT/receiver LoRa/CONTRIBUTING.md | 57 +++++++++++++++ IOT/receiver LoRa/README.md | 19 +++++ IOT/receiver LoRa/SETUP.md | 10 +++ IOT/receiver LoRa/UPDATE.md | 15 ++++ IOT/receiver LoRa/config.cppcheck | 19 +++++ IOT/receiver LoRa/config.ini | 19 +++++ IOT/receiver LoRa/docs/README.md | 18 +++++ IOT/receiver LoRa/envs.ini | 15 ++++ IOT/receiver LoRa/include/Program.h | 19 +++++ IOT/receiver LoRa/include/README.md | 4 + IOT/receiver LoRa/lib/README.md | 27 +++++++ IOT/receiver LoRa/platformio.ini | 73 +++++++++++++++++++ .../scripts/get_additionnal_envs.py | 41 +++++++++++ IOT/receiver LoRa/secrets.ini.example | 6 ++ IOT/receiver LoRa/src/Program.cpp | 10 +++ IOT/receiver LoRa/src/README.md | 3 + IOT/receiver LoRa/src/main.cpp | 11 +++ IOT/receiver LoRa/test/README.md | 4 + 29 files changed, 557 insertions(+) create mode 100644 IOT/receiver LoRa/.clang-tidy create mode 100644 IOT/receiver LoRa/.editorconfig create mode 100644 IOT/receiver LoRa/.gitattributes create mode 100644 IOT/receiver LoRa/.github/ISSUE_TEMPLATE/autre.yml create mode 100644 IOT/receiver LoRa/.github/ISSUE_TEMPLATE/config.yml create mode 100644 IOT/receiver LoRa/.github/ISSUE_TEMPLATE/idee_amelioration.yml create mode 100644 IOT/receiver LoRa/.github/ISSUE_TEMPLATE/rapport_de_bug.yml create mode 100644 IOT/receiver LoRa/.github/PULL_REQUEST_TEMPLATE.md create mode 100644 IOT/receiver LoRa/.github/workflows/test_build.yml create mode 100644 IOT/receiver LoRa/.gitignore create mode 100644 IOT/receiver LoRa/.vscode/extensions.json create mode 100644 IOT/receiver LoRa/CONTRIBUTING.md create mode 100644 IOT/receiver LoRa/README.md create mode 100644 IOT/receiver LoRa/SETUP.md create mode 100644 IOT/receiver LoRa/UPDATE.md create mode 100644 IOT/receiver LoRa/config.cppcheck create mode 100644 IOT/receiver LoRa/config.ini create mode 100644 IOT/receiver LoRa/docs/README.md create mode 100644 IOT/receiver LoRa/envs.ini create mode 100644 IOT/receiver LoRa/include/Program.h create mode 100644 IOT/receiver LoRa/include/README.md create mode 100644 IOT/receiver LoRa/lib/README.md create mode 100644 IOT/receiver LoRa/platformio.ini create mode 100644 IOT/receiver LoRa/scripts/get_additionnal_envs.py create mode 100644 IOT/receiver LoRa/secrets.ini.example create mode 100644 IOT/receiver LoRa/src/Program.cpp create mode 100644 IOT/receiver LoRa/src/README.md create mode 100644 IOT/receiver LoRa/src/main.cpp create mode 100644 IOT/receiver LoRa/test/README.md diff --git a/IOT/receiver LoRa/.clang-tidy b/IOT/receiver LoRa/.clang-tidy new file mode 100644 index 0000000..790367c --- /dev/null +++ b/IOT/receiver LoRa/.clang-tidy @@ -0,0 +1,7 @@ +# Clangtidy configuration file (not used until PIO 6) +--- +Checks: 'abseil-*,boost-*,bugprone-*,cert-*,cppcoreguidelines-*,clang-analyzer-*,google-*,hicpp-*,modernize-*,performance-*,portability-*,readability-*,-cppcoreguidelines-avoid-non-const-global-variables,-cppcoreguidelines-owning-memory,-modernize-use-trailing-return-type,-cppcoreguidelines-init-variables' +WarningsAsErrors: false +HeaderFilterRegex: '' +AnalyzeTemporaryDtors: false +FormatStyle: google diff --git a/IOT/receiver LoRa/.editorconfig b/IOT/receiver LoRa/.editorconfig new file mode 100644 index 0000000..fdfd862 --- /dev/null +++ b/IOT/receiver LoRa/.editorconfig @@ -0,0 +1,39 @@ +root = true + +# Base Configuration +[*] +indent_style = tab +indent_size = 4 +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 120 +end_of_line = lf + +# Yaml Standard +[*.{yaml,yml}] +indent_style = space +indent_size = 2 + +# Markdown Standards +[*.md] +indent_style = space +indent_size = 2 +trim_trailing_whitespace = false + +# Java, Kotlin, Gradle, XML Standards +[*.{java,kt,kts,gradle,xml,pro}] +indent_style = space + + +# C++ Files +[*.{cpp,h,ino}] +indent_style = space + +# PHP files +[*.php] +indent_style = space + +# INI Files +[*.ini] +indent_style = space diff --git a/IOT/receiver LoRa/.gitattributes b/IOT/receiver LoRa/.gitattributes new file mode 100644 index 0000000..94f480d --- /dev/null +++ b/IOT/receiver LoRa/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf \ No newline at end of file diff --git a/IOT/receiver LoRa/.github/ISSUE_TEMPLATE/autre.yml b/IOT/receiver LoRa/.github/ISSUE_TEMPLATE/autre.yml new file mode 100644 index 0000000..aaf270d --- /dev/null +++ b/IOT/receiver LoRa/.github/ISSUE_TEMPLATE/autre.yml @@ -0,0 +1,11 @@ +name: Autre +description: Tout autre éléments liée au projet +title: "" +labels: [] +body: + - type: textarea + id: detail + attributes: + label: Details + validations: + required: true diff --git a/IOT/receiver LoRa/.github/ISSUE_TEMPLATE/config.yml b/IOT/receiver LoRa/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..8a8917e --- /dev/null +++ b/IOT/receiver LoRa/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,6 @@ +# fichier non pris en compte pour le moment :( +blank_issues_enabled: false +contact_links: + - name: Discussions sur Git & Discord + url: https://discord.gg/TWKy76TptD + about: Pour discuter du projet on priorise le direct si possible :D \ No newline at end of file diff --git a/IOT/receiver LoRa/.github/ISSUE_TEMPLATE/idee_amelioration.yml b/IOT/receiver LoRa/.github/ISSUE_TEMPLATE/idee_amelioration.yml new file mode 100644 index 0000000..220260c --- /dev/null +++ b/IOT/receiver LoRa/.github/ISSUE_TEMPLATE/idee_amelioration.yml @@ -0,0 +1,21 @@ +name: Fonctionalité +description: Une nouvelle fonctionalité ou amélioration d'un élément du logiciel +title: "amélioration: " +labels: [] +body: + - type: checkboxes + id: needs + attributes: + label: Besoins de la fonctionalité + description: Indiquez quelle sont les besoins pour la fonctionalité + options: + - label: Code + - label: Design + + - type: textarea + id: detail + attributes: + label: Details + description: Détaillez la fonctionnalité voulu + validations: + required: false diff --git a/IOT/receiver LoRa/.github/ISSUE_TEMPLATE/rapport_de_bug.yml b/IOT/receiver LoRa/.github/ISSUE_TEMPLATE/rapport_de_bug.yml new file mode 100644 index 0000000..fbf1c58 --- /dev/null +++ b/IOT/receiver LoRa/.github/ISSUE_TEMPLATE/rapport_de_bug.yml @@ -0,0 +1,31 @@ +name: Rapport de bug +description: Un problème dans le logiciel +title: "bug: " +labels: [type/bug] +body: + - type: checkboxes + id: needs + attributes: + label: Localisation du bug + description: Dans quel environement le bug a été vu + options: + - label: Production + - label: Développement + - label: Figma/Design + + - type: textarea + id: detail + attributes: + label: Details + description: Détaillez le bug qui a été vu + validations: + required: true + + - type: textarea + id: reproduce + attributes: + label: Reproduction + description: Comment reproduire le bug + placeholder: "1. démarrer l'application\n2. Cliquer ...\n3. Faire ..." + validations: + required: true diff --git a/IOT/receiver LoRa/.github/PULL_REQUEST_TEMPLATE.md b/IOT/receiver LoRa/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..7ab3ff5 --- /dev/null +++ b/IOT/receiver LoRa/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ + diff --git a/IOT/receiver LoRa/.github/workflows/test_build.yml b/IOT/receiver LoRa/.github/workflows/test_build.yml new file mode 100644 index 0000000..b443179 --- /dev/null +++ b/IOT/receiver LoRa/.github/workflows/test_build.yml @@ -0,0 +1,41 @@ +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + test: + + runs-on: ubuntu-latest + + steps: + - name: Checkout project + uses: actions/checkout@v3 + + # - name: Cache pip + # uses: actions/cache@v3 + # with: + # path: ~/.cache/pip + # key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + # restore-keys: | + # ${{ runner.os }}-pip- + + # # this cache the platformio binaries and not the .pio folder + # - name: Cache PlatformIO + # uses: actions/cache@v3 + # with: + # path: ~/.platformio + # key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} + + - name: Set up Python + uses: https://github.com/actions/setup-python@v3 + + - name: Install PlatformIO + run: pip install platformio + + - name: Build the project + run: platformio run + + - name: Test the project + run: platformio check --fail-on-defect high diff --git a/IOT/receiver LoRa/.gitignore b/IOT/receiver LoRa/.gitignore new file mode 100644 index 0000000..53072ca --- /dev/null +++ b/IOT/receiver LoRa/.gitignore @@ -0,0 +1,12 @@ +# macOS +.DS_Store + +# Platformio specifics +.pio +.vscode/.browse.c_cpp.db* +.vscode/c_cpp_properties.json +.vscode/launch.json +.vscode/ipch + +# Aptatio/Platformio specifics +secrets.ini diff --git a/IOT/receiver LoRa/.vscode/extensions.json b/IOT/receiver LoRa/.vscode/extensions.json new file mode 100644 index 0000000..080e70d --- /dev/null +++ b/IOT/receiver LoRa/.vscode/extensions.json @@ -0,0 +1,10 @@ +{ + // See http://go.microsoft.com/fwlink/?LinkId=827846 + // for the documentation about the extensions.json format + "recommendations": [ + "platformio.platformio-ide" + ], + "unwantedRecommendations": [ + "ms-vscode.cpptools-extension-pack" + ] +} diff --git a/IOT/receiver LoRa/CONTRIBUTING.md b/IOT/receiver LoRa/CONTRIBUTING.md new file mode 100644 index 0000000..0c55c9a --- /dev/null +++ b/IOT/receiver LoRa/CONTRIBUTING.md @@ -0,0 +1,57 @@ +# Fonctionnement + +## Labels + +- `Type/Amélioration`: Issue/PR lié à une amélioration d'une fonctionalité +- `Type/Bug`: Issue/PR lié à un bug présent dans le logiciel a corriger +- `Type/Documentation`: Issue/PR lié à un changement dans la documentation technique et/ou le design UI/UX +- `Type/Fonctionnalité`: Issue/PR lié à une nouvelle fonctionnalité +- `Type/Sécurité`: Issue/PR lié a la sécurité du logiciel +- `Type/Tests`: Issue/PR lié a des tests + +- `Status/Besoin d'infos`: Feedback nécessaire pour avancer +- `Status/Bloqué`: Issue/PR bloqué par quelque chose + +- `Tech/Logiciel`: issue ou PR qui est liée a du logiciel (Code) +- `Tech/Mécatronique`:Issue qui est dans le hard (Éléctronique, Mécanique) + +- `Priorité/Critique`: issue critique dans l'usage du logiciel +- `Priorité/Haute`: issue importante +- `Priorité/Moyenne`: issue moyenement importante +- `Priorité/Basse`: Issue non/peu importante + +- `Revue/Confirmé`: Issue validé qui est à faire +- `Revue/Dupliqué`: Issue fermé car elle est déjà éxistante +- `Revue/Invalide`: Issue invalide (raison en commentaire) +- `Revue/Non Corrigable`: Issue non corrigable (raison en commentaire) + +## Workflow d'un issue + +- Ajout d'une issue +- trie selon le type de l'issue avec les labels +- Affectassion a un milestone si possible +- travail sur l'issue +- fermeture de l'issue avec une liaison avec un commit/PR si relié + +## Branches/Tags + +_Basé sur `Git Flow` mais en plus simplifié_ + +- `branch/master`: Branche principal qui contient le code mergé final et fonctionnel +- `branch/blablabla`: Branche liée a une **Pull Request** qui contient du code non stable selon l'avancement +- `tags/*.*.*`: Chaque tag est sa version et doit Respecter le format `semver` alias `MAJOR.MINOR.PATCH` toute les versions en dessous de `1.0.0` seront considéré comme non-stable + +## Commits/PR + +_basé sur `Conventional Commits` mais en plus simplifié_ + +Globalement c'est recommendé d'utiliser sa pour **TOUT** les commits _mais_ au minimum a utiliser pour nommer la **PR** pour garder la branche principal clean + +architecture: `prefix: description` +trois partis pour un commit/pr: +- prefix + - `feat`: grosso modo c'est le label `fonctionnalité` + - `fix`: c'est le label `bug` ou un amélioration de perfs + - `docs`: Changement au niveau de la documentation technique + - `chore`: Changement autre (dépendances, CI/CD) +- `description`: texte en anglais commencant par un verbe indiquant ce qui a été fait (ex: `allow`,`send`, `change`, etc) diff --git a/IOT/receiver LoRa/README.md b/IOT/receiver LoRa/README.md new file mode 100644 index 0000000..6b89f3e --- /dev/null +++ b/IOT/receiver LoRa/README.md @@ -0,0 +1,19 @@ +# Nom du projet + +Description du projet + +_note: voir le fichier SETUP.md pour setup le template dans un nouveau repo_ + +## Getting Started + +### Installation + +Description sur la façon dont on installe le logiciel/lib + +### Usage + +Description rapide de l'usage du logiciel + +## Règles de contributions + +Voir le fichier CONTRIBUTING.md diff --git a/IOT/receiver LoRa/SETUP.md b/IOT/receiver LoRa/SETUP.md new file mode 100644 index 0000000..c1fb550 --- /dev/null +++ b/IOT/receiver LoRa/SETUP.md @@ -0,0 +1,10 @@ +1. Activer la protection de branche pour `master` +2. `Enabled Branch Protection` +3. `Disable Push` +4. `Enable Merge Whitelist` +5. `Whitelisted teams for merging` = `owners` + `you` +6. `Required approvals` = `1` +7. `Block merge on rejected reviews` +8. `Dismiss stale approvals` +9. `Block merge id pull request is outdated` +10. Delete this file and `UPDATE.md` :D diff --git a/IOT/receiver LoRa/UPDATE.md b/IOT/receiver LoRa/UPDATE.md new file mode 100644 index 0000000..9288d35 --- /dev/null +++ b/IOT/receiver LoRa/UPDATE.md @@ -0,0 +1,15 @@ +# How to update a child repo from this template + +run this script and remove the possibly added files +``` +git push -d fix/update-template +git branch -D fix/update-template +git checkout -b fix/update-template +git clone ssh://git@git.dzeio.com:8022/aptatio/template-2.git tpl +rm -rf tpl/.git tpl/SETUP.md tpl/UPDATE.md tpl/README.md +yes | cp tpl/{.,}* ./ -r +rm -rf tpl +git add . +git commit -m "misc: update template" +git push -u origin fix/update-template +``` \ No newline at end of file diff --git a/IOT/receiver LoRa/config.cppcheck b/IOT/receiver LoRa/config.cppcheck new file mode 100644 index 0000000..77fd7d8 --- /dev/null +++ b/IOT/receiver LoRa/config.cppcheck @@ -0,0 +1,19 @@ + + + + .cppcheck-build + Unspecified + false + true + false + 10 + + + + + noCopyConstructor + noExplicitConstructor + unusedFunction + noOperatorEq + + diff --git a/IOT/receiver LoRa/config.ini b/IOT/receiver LoRa/config.ini new file mode 100644 index 0000000..11e4023 --- /dev/null +++ b/IOT/receiver LoRa/config.ini @@ -0,0 +1,19 @@ +; Project configuration file + +[config] +; Hardware Serial baud rate +; Also available in the code as `MONITOR_SPEED` +monitor_speed = 115200 + +; Software Config +; note: additionnal flags are added by Platform.io (see total amount in `.vscode/c_cpp_properties.json` in the `defines` section) +; notworthy ones: +; __PLATFORMIO_BUILD_DEBUG__ = debug mode +build_flags = +; DO NOT TOUCH --- START + -D MONITOR_SPEED=${config.monitor_speed} +; DO NOT TOUCH --- END + + -D EXAMPLE_NUMBER=69 + + -D EXAMPLE_STRING=\"Pouet\" diff --git a/IOT/receiver LoRa/docs/README.md b/IOT/receiver LoRa/docs/README.md new file mode 100644 index 0000000..9ff0271 --- /dev/null +++ b/IOT/receiver LoRa/docs/README.md @@ -0,0 +1,18 @@ +# Docs + +Documentation Technique du projet + +## fichiers .puml + +Les fichiers en .puml sont des fichiers UMLs sous forme de code + +Afin d'en avoir le résultat graphique : + +1. Ouvrez un navigateur +2. lancer le lien suivant [https://www.plantuml.com/plantuml/uml/](https://www.plantuml.com/plantuml/uml/) +3. Copiez/Collez le contenu du fichier .puml dans le voite de texte +4. Cliquez sur `Submit` + +ou si vous utilisez `VSCode`: +1. installez l'extensions [PlantUML](https://marketplace.visualstudio.com/items?itemName=jebbs.plantuml) _jebbs.plantuml_ +2. `ALT+D` lorsque vous êtes dans un fichier .puml diff --git a/IOT/receiver LoRa/envs.ini b/IOT/receiver LoRa/envs.ini new file mode 100644 index 0000000..9df4a04 --- /dev/null +++ b/IOT/receiver LoRa/envs.ini @@ -0,0 +1,15 @@ +; Add additionnal environments in this file + +; Default production environment +[env:prod] + +; Debug environemnt +[env:debug] +build_type = debug + + +; Example additionnal env +; [env:example] +; ; note: keep the `${env.build_flags}` to includes others build flags +; build_flags = ${env.build_flags} +; -D POUET diff --git a/IOT/receiver LoRa/include/Program.h b/IOT/receiver LoRa/include/Program.h new file mode 100644 index 0000000..66e4a79 --- /dev/null +++ b/IOT/receiver LoRa/include/Program.h @@ -0,0 +1,19 @@ +#ifndef PROGRAM_H +#define PROGRAM_H + +#include "Arduino.h" + +class Program { +public: + /** + * Program startup + */ + Program(); + + /** + * Program main loop + */ + void loop(); +}; + +#endif diff --git a/IOT/receiver LoRa/include/README.md b/IOT/receiver LoRa/include/README.md new file mode 100644 index 0000000..e142f15 --- /dev/null +++ b/IOT/receiver LoRa/include/README.md @@ -0,0 +1,4 @@ + +Dossier pour les fichiers `headers` de CPP + +en savoir plus: https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/IOT/receiver LoRa/lib/README.md b/IOT/receiver LoRa/lib/README.md new file mode 100644 index 0000000..2d18ac9 --- /dev/null +++ b/IOT/receiver LoRa/lib/README.md @@ -0,0 +1,27 @@ +# Librairies maisons utilisé pour ce projet + +Architecture fichiers: +``` +|--lib +| | +| |--Bar +| | |--docs +| | |--examples +| | |--src +| | |- Bar.c +| | |- Bar.h +| | |- library.json voir: https://docs.platformio.org/page/librarymanager/config.html +| | +| |--Foo +| | |- Foo.c +| | |- Foo.h +| | +| |- README --> THIS FILE +| +|- platformio.ini +|--src + |- main.cpp + |- Program.cpp +``` + +En savoir plus: https://docs.platformio.org/en/latest/librarymanager/quickstart.html diff --git a/IOT/receiver LoRa/platformio.ini b/IOT/receiver LoRa/platformio.ini new file mode 100644 index 0000000..6efbe50 --- /dev/null +++ b/IOT/receiver LoRa/platformio.ini @@ -0,0 +1,73 @@ +; PlatformIO Project Configuration File + +; WARNING: Items containing version number MUST be the version NOT A RANGE + +; Additionnal files +; `secrets.ini`: Secret Build Flags that will be ignored in git (content: `[secrets]\nbuild_flags = `) +; `envs.ini`: Build environments +; `config.ini`: Global Configuration File + +; Defaults +[secrets] +build_flags = + +[platformio] +default_envs = debug +extra_configs = + secrets.ini + config.ini + envs.ini + +; Cache folder +build_cache_dir = ./.pio/cache + +[env] +; build Envs +build_flags = ${config.build_flags} ${secrets.build_flags} + +; Add scripts for more functionnalities +; see individual scripts for more informations +extra_scripts = pre:scripts/get_additionnal_envs.py + +; Device Settings (make sure to fix versions where possible!) +platform = espressif32@4.2.0 +board = esp32dev +framework = arduino + +; Monitoring settings +monitor_speed = ${config.monitor_speed} + +; note: make sure to rebuild after changing it (log2file add a .log file containing the monitor logs) +monitor_filters = esp32_exception_decoder, time, send_on_enter, default ;, log2file + +; Ask the monitor to echo the content written +monitor_echo = yes + +; upload settings +; upload_port = COM1 + +upload_speed = 921600 + +; librairies (make sure to fix versions where possible!) +lib_deps = +; example: +; erropix/ESP32 AnalogWrite@0.2 + +; Checker settings +check_tool = clangtidy, cppcheck + +; Filters for checkers +check_src_filters = + + + + + + + + + -<.pio/> + +; Ask pio to not scan `./.pio` files +check_skip_packages = yes + +; use config files for clangtidy and cppcheck +check_flags = + clangtidy: --config-file=.clang-tidy + cppcheck: --project=config.cppcheck --inline-suppr -i=".pio" diff --git a/IOT/receiver LoRa/scripts/get_additionnal_envs.py b/IOT/receiver LoRa/scripts/get_additionnal_envs.py new file mode 100644 index 0000000..0a349fd --- /dev/null +++ b/IOT/receiver LoRa/scripts/get_additionnal_envs.py @@ -0,0 +1,41 @@ +""" + Add additionnal ENVs to the program + + GIT_COMMIT: the git commit ID + GIT_BRANCH: the current git branch + GIT_TAG: the current git tag or "dev" + + _note: to get the full list of env at build time run: `pio run -t envdump > pouet.log` and look at "BUILD_FLAGS_ +""" + +import subprocess + +Import("env") + +def run_command(command): + """ + run a command on the system + """ + return subprocess.run(command, stdout=subprocess.PIPE, text=True).stdout + +def get_additionnal_envs(): + """ + get the git commit/branch/tag of the project and return them + """ + commit = run_command(["git", "rev-parse", "HEAD"])[:7] + branch = run_command(["git", "rev-parse", "--abbrev-ref", "HEAD"]) + tag = run_command(["git", "tag", "-l", "--points-at", "HEAD"]) + + items = [ + f"-D GIT_COMMIT=\\\"{commit}\\\"", + f"-D GIT_BRANCH=\\\"{branch.strip()}\\\"" + ] + if tag != "": + items.append(f"-D GIT_TAG=\\\"{tag.strip()}\\\"") + else: + items.append("-D GIT_TAG=\\\"dev\\\"") + return items + +env.Append( + BUILD_FLAGS=get_additionnal_envs() +) diff --git a/IOT/receiver LoRa/secrets.ini.example b/IOT/receiver LoRa/secrets.ini.example new file mode 100644 index 0000000..90b9782 --- /dev/null +++ b/IOT/receiver LoRa/secrets.ini.example @@ -0,0 +1,6 @@ +; Add secrets token/logins/etc `secrets.ini` +; Add the sames values as blank in `secrets.ini.example +; To be able to reproduce it + +[secrets] +build_flags = diff --git a/IOT/receiver LoRa/src/Program.cpp b/IOT/receiver LoRa/src/Program.cpp new file mode 100644 index 0000000..e412959 --- /dev/null +++ b/IOT/receiver LoRa/src/Program.cpp @@ -0,0 +1,10 @@ +#include "Program.h" + +Program::Program() { + // Startup + Serial.begin(MONITOR_SPEED); +} + +void Program::loop() { + // Loop +} diff --git a/IOT/receiver LoRa/src/README.md b/IOT/receiver LoRa/src/README.md new file mode 100644 index 0000000..ff37eaa --- /dev/null +++ b/IOT/receiver LoRa/src/README.md @@ -0,0 +1,3 @@ +# Code source du projet + +En savoir plus: https://docs.platformio.org/en/latest/core/quickstart.html diff --git a/IOT/receiver LoRa/src/main.cpp b/IOT/receiver LoRa/src/main.cpp new file mode 100644 index 0000000..74bf5a7 --- /dev/null +++ b/IOT/receiver LoRa/src/main.cpp @@ -0,0 +1,11 @@ +#include "Program.h" + +Program* program; + +void setup() { + program = new Program(); +} + +void loop() { + program->loop(); +} diff --git a/IOT/receiver LoRa/test/README.md b/IOT/receiver LoRa/test/README.md new file mode 100644 index 0000000..7fa0127 --- /dev/null +++ b/IOT/receiver LoRa/test/README.md @@ -0,0 +1,4 @@ + +# Fichiers de tests unitaire de PlatformIO + +En savoir plus: https://docs.platformio.org/page/plus/unit-testing.html From d9c3ee7d0884a63599883b6e8225926035d917fa Mon Sep 17 00:00:00 2001 From: Clement Date: Mon, 26 Jun 2023 16:33:44 +0200 Subject: [PATCH 05/27] add pin SD/DHT/BMS --- IOT/Capteur/config.ini | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/IOT/Capteur/config.ini b/IOT/Capteur/config.ini index 11e4023..b1bd465 100644 --- a/IOT/Capteur/config.ini +++ b/IOT/Capteur/config.ini @@ -17,3 +17,16 @@ build_flags = -D EXAMPLE_NUMBER=69 -D EXAMPLE_STRING=\"Pouet\" + + + -D DHT_PIN=\"D4\" + -D DHT_TYPE=\"DHT22\" + + -D BMS180_SDA=\"D2\" + -D BMS180_SCL=\"D1\" + + -D SD_CLK=\"D5\" + -D SD_MISO=\"D6\" + -D SD_MOSI=\"D7\" + -D SD_CS=\"D4\" + From 9da116cadd934f3fb88eca7e8ddca0ca0bf0196a Mon Sep 17 00:00:00 2001 From: Clement Date: Mon, 26 Jun 2023 16:33:54 +0200 Subject: [PATCH 06/27] ADD BMS LIB --- IOT/Capteur/platformio.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/IOT/Capteur/platformio.ini b/IOT/Capteur/platformio.ini index f1d6117..c13d96b 100644 --- a/IOT/Capteur/platformio.ini +++ b/IOT/Capteur/platformio.ini @@ -54,6 +54,7 @@ lib_deps = ; erropix/ESP32 AnalogWrite@0.2 adafruit/DHT sensor library@^1.4.4 adafruit/Adafruit Unified Sensor@^1.1.9 ; required by DHT + sparkfun/Sparkfun BMP180@^1.1.2 ; Checker settings check_tool = clangtidy, cppcheck From e773e6c0995b11c36707c2ad50c2df39fff57d51 Mon Sep 17 00:00:00 2001 From: Clement Date: Mon, 26 Jun 2023 16:34:14 +0200 Subject: [PATCH 07/27] ADD barometer --- IOT/Capteur/include/Program.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/IOT/Capteur/include/Program.h b/IOT/Capteur/include/Program.h index 7f57f9b..0a3abaf 100644 --- a/IOT/Capteur/include/Program.h +++ b/IOT/Capteur/include/Program.h @@ -4,6 +4,7 @@ #include #include "Capteur.h" #include "HumiTemp.h" +#include "Barometer.h" class Program { public: @@ -20,6 +21,7 @@ private: //TODO: faire commentaire Capteur* DHT; + Capteur* barometer; }; From b73bc67c8edd01184802f6357a86d674a3b3b747 Mon Sep 17 00:00:00 2001 From: Clement Date: Mon, 26 Jun 2023 17:23:41 +0200 Subject: [PATCH 08/27] add Barometer --- IOT/Capteur/lib/Capteur/include/Barometer.h | 44 ++++++++++++++++++++ IOT/Capteur/lib/Capteur/src/Barometer.cpp | 45 +++++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 IOT/Capteur/lib/Capteur/include/Barometer.h create mode 100644 IOT/Capteur/lib/Capteur/src/Barometer.cpp diff --git a/IOT/Capteur/lib/Capteur/include/Barometer.h b/IOT/Capteur/lib/Capteur/include/Barometer.h new file mode 100644 index 0000000..f00f5ce --- /dev/null +++ b/IOT/Capteur/lib/Capteur/include/Barometer.h @@ -0,0 +1,44 @@ +#ifndef BAROMETER_H +#define BAROMETER_H + +#include +#include +#include +#include "Capteur.h" + +class Barometer : public Capteur{ +public: + + /** + * @brief Construct a new Capteur object + * + */ + Barometer(); + + /** + * @brief lit la valeur du capteur + * + * @return String valeur forma "XX/YY" X mBar et Y °C + */ + virtual String read(); + + /** + * @brief retourne le type de valeur lue + * + * @return String + */ + String getValType(); + + //TODO: faire commentaire + int getTemp(); + int getPressure(); + +private: + + //TODO: faire commentaire + SFE_BMP180* capteur; + +}; + + +#endif // BAROMETER_H diff --git a/IOT/Capteur/lib/Capteur/src/Barometer.cpp b/IOT/Capteur/lib/Capteur/src/Barometer.cpp new file mode 100644 index 0000000..e7ae486 --- /dev/null +++ b/IOT/Capteur/lib/Capteur/src/Barometer.cpp @@ -0,0 +1,45 @@ +#include "../include/Barometer.h" + +Barometer::Barometer(): + Capteur("P/T"){ + this->capteur = new SFE_BMP180(); + this->capteur->begin(); +} + +int Barometer::getTemp(){ + char status = capteur->startTemperature(); + if (status != 0){ + delay(status); + } + double temp; + status = this->capteur->getTemperature(temp); + if(status == 0){ + Serial.println("Temperature reading failed "); + return -1; + } + return temp; +} + +int Barometer::getPressure(){ + char status = this->capteur->startPressure(3); + if(status){ + delay(status); + } + double press = 0; + double T = 0; + status = this->capteur->getPressure(press, T); + if(status == 0){ + Serial.println("Pressure reading failed "); + return -1; + } + return press; +} + +String Barometer::read(){ + String sortie = ""; + + sortie += String(this->getPressure()); + sortie += "/"; + sortie += String(this->getTemp()); + return sortie; +} From f92d19b61f00c2fe2f519e2e64b87d41cb03ad77 Mon Sep 17 00:00:00 2001 From: Clement Date: Mon, 26 Jun 2023 17:24:06 +0200 Subject: [PATCH 09/27] add lib and config lora --- IOT/receiver LoRa/config.ini | 16 +++++++++++++++- IOT/receiver LoRa/platformio.ini | 6 ++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/IOT/receiver LoRa/config.ini b/IOT/receiver LoRa/config.ini index 11e4023..7ba9ac2 100644 --- a/IOT/receiver LoRa/config.ini +++ b/IOT/receiver LoRa/config.ini @@ -14,6 +14,20 @@ build_flags = -D MONITOR_SPEED=${config.monitor_speed} ; DO NOT TOUCH --- END - -D EXAMPLE_NUMBER=69 + ; LoRa pinout + -D RADIO_MOSI_PIN=27 + -D RADIO_MISO_PIN=19 + -D RADIO_SCLK_PIN=5 + -D RADIO_CS_PIN=18 + -D RADIO_RST_PIN=14 + -D RADIO_DIO0_PIN=26 + + ;LoRa frequency + -D LoRa_frequency=433E6 + + ;Oled pin + -D I2C_SDA=21 + -D I2C_SCL=22 + -D EXAMPLE_STRING=\"Pouet\" diff --git a/IOT/receiver LoRa/platformio.ini b/IOT/receiver LoRa/platformio.ini index 6efbe50..0aa4ecc 100644 --- a/IOT/receiver LoRa/platformio.ini +++ b/IOT/receiver LoRa/platformio.ini @@ -30,8 +30,8 @@ build_flags = ${config.build_flags} ${secrets.build_flags} extra_scripts = pre:scripts/get_additionnal_envs.py ; Device Settings (make sure to fix versions where possible!) -platform = espressif32@4.2.0 -board = esp32dev +platform = espressif32 +board = ttgo-lora32-v1 framework = arduino ; Monitoring settings @@ -52,6 +52,8 @@ upload_speed = 921600 lib_deps = ; example: ; erropix/ESP32 AnalogWrite@0.2 + sandeepmistry/LoRa@^0.8.0 ;LoRa lib + olikraus/U8g2@^2.34.22 ;Oled Lib ; Checker settings check_tool = clangtidy, cppcheck From 92cd2b35534e9c10363c6f74e0e0f651f6ff1084 Mon Sep 17 00:00:00 2001 From: Clement Date: Mon, 26 Jun 2023 17:24:18 +0200 Subject: [PATCH 10/27] add readin barometter --- IOT/Capteur/src/Program.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/IOT/Capteur/src/Program.cpp b/IOT/Capteur/src/Program.cpp index 13a068b..6584974 100644 --- a/IOT/Capteur/src/Program.cpp +++ b/IOT/Capteur/src/Program.cpp @@ -3,11 +3,17 @@ Program::Program() { // Startup Serial.begin(MONITOR_SPEED); - this->DHT = new HumiTemp(D4, DHT22); + this->DHT = new HumiTemp(DHT_PIN, DHT_TYPE); + this->barometer = new Barometer(); } void Program::loop() { // Loop delay(2000); - Serial.println(this->DHT->read()); + Serial.print(this->DHT->read()); + Serial.print('\t'); + Serial.print(this->barometer->read()); + + + Serial.println(); } From 1a66b59d1b72f5f9f2f869cf90ded3579630cb37 Mon Sep 17 00:00:00 2001 From: Clement Date: Mon, 26 Jun 2023 17:24:50 +0200 Subject: [PATCH 11/27] test sur reveiver --- IOT/receiver LoRa/include/Program.h | 5 +- IOT/receiver LoRa/src/Program.cpp | 12 +++ IOT/receiver LoRa/src/main.cpp | 116 ++++++++++++++++++++++++++-- 3 files changed, 126 insertions(+), 7 deletions(-) diff --git a/IOT/receiver LoRa/include/Program.h b/IOT/receiver LoRa/include/Program.h index 66e4a79..c840657 100644 --- a/IOT/receiver LoRa/include/Program.h +++ b/IOT/receiver LoRa/include/Program.h @@ -1,7 +1,10 @@ #ifndef PROGRAM_H #define PROGRAM_H -#include "Arduino.h" +#include +#include +#include +#include class Program { public: diff --git a/IOT/receiver LoRa/src/Program.cpp b/IOT/receiver LoRa/src/Program.cpp index e412959..82ff6d8 100644 --- a/IOT/receiver LoRa/src/Program.cpp +++ b/IOT/receiver LoRa/src/Program.cpp @@ -3,6 +3,18 @@ Program::Program() { // Startup Serial.begin(MONITOR_SPEED); + Serial.println("initBoard"); + SPI.begin(RADIO_SCLK_PIN, RADIO_MISO_PIN, RADIO_MOSI_PIN); //for LoRa module + Wire.begin(I2C_SDA, I2C_SCL);//for oled screen + // When the power is turned on, a delay is required. + delay(1500); + + //init LoRa + LoRa.setPins(RADIO_CS_PIN, RADIO_RST_PIN, RADIO_DIO0_PIN); + if (!LoRa.begin(LoRa_frequency)) { + Serial.println("Starting LoRa failed!"); + while (1); + } } void Program::loop() { diff --git a/IOT/receiver LoRa/src/main.cpp b/IOT/receiver LoRa/src/main.cpp index 74bf5a7..70fe082 100644 --- a/IOT/receiver LoRa/src/main.cpp +++ b/IOT/receiver LoRa/src/main.cpp @@ -1,11 +1,115 @@ -#include "Program.h" +// #include "Program.h" -Program* program; +// Program* program; -void setup() { - program = new Program(); +// void setup() { +// program = new Program(); +// } + +// void loop() { +// program->loop(); +// } + + +#include +#include "boards.h" + +#include + +void setup() +{ + initBoard(); + // When the power is turned on, a delay is required. + delay(1500); + + Serial.println("LoRa Receiver"); + + LoRa.setPins(RADIO_CS_PIN, RADIO_RST_PIN, RADIO_DIO0_PIN); + if (!LoRa.begin(LoRa_frequency)) { + Serial.println("Starting LoRa failed!"); + while (1); + } } -void loop() { - program->loop(); +void loop() +{ + // try to parse packet + int packetSize = LoRa.parsePacket(); + if (packetSize) { + // received a packet + Serial.print("Received packet '"); + + String recv = ""; + // read packet + while (LoRa.available()) { + recv += (char)LoRa.read(); + } + + Serial.println(recv); + + // print RSSI of packet + Serial.print("' with RSSI "); + Serial.println(LoRa.packetRssi()); +#ifdef HAS_DISPLAY + if (u8g2) { + u8g2->clearBuffer(); + char buf[256]; + u8g2->drawStr(0, 12, "Received OK!"); + u8g2->drawStr(0, 26, recv.c_str()); + snprintf(buf, sizeof(buf), "RSSI:%i", LoRa.packetRssi()); + u8g2->drawStr(0, 40, buf); + snprintf(buf, sizeof(buf), "SNR:%.1f", LoRa.packetSnr()); + u8g2->drawStr(0, 56, buf); + u8g2->sendBuffer(); + } +#endif + } } + + + +// #define HAS_DISPLAY + +// #include +// #include "boards.h" + +// int counter = 0; + +// void setup() +// { +// initBoard(); +// // When the power is turned on, a delay is required. +// delay(1500); + +// Serial.println("LoRa Sender"); +// LoRa.setPins(RADIO_CS_PIN, RADIO_RST_PIN, RADIO_DIO0_PIN); +// if (!LoRa.begin(LoRa_frequency)) { +// Serial.println("Starting LoRa failed!"); +// while (1); +// } +// } + +// void loop() +// { +// Serial.print("Sending packet: "); +// Serial.println(counter); + +// // send packet +// LoRa.beginPacket(); +// LoRa.print("hello "); +// LoRa.print(counter); +// LoRa.endPacket(); + +// #ifdef HAS_DISPLAY +// if (u8g2) { +// char buf[256]; +// u8g2->clearBuffer(); +// u8g2->drawStr(0, 12, "Transmitting: OK!"); +// snprintf(buf, sizeof(buf), "Sending: %d", counter); +// u8g2->drawStr(0, 30, buf); +// u8g2->sendBuffer(); +// } +// #endif +// counter++; +// delay(10000); +// } From 10e71d5cc2bf27abdad2905a849bd7037e87656e Mon Sep 17 00:00:00 2001 From: Clement Date: Tue, 11 Jul 2023 15:17:19 +0200 Subject: [PATCH 12/27] add kicad shematics --- .../docs/Schématics/Schématics.kicad_pcb | 2 + .../docs/Schématics/Schématics.kicad_prl | 77 ++ .../docs/Schématics/Schématics.kicad_pro | 332 +++++++ .../docs/Schématics/Schématics.kicad_sch | 936 ++++++++++++++++++ .../docs/Schématics/Schématics_lib.kicad_sym | 272 +++++ IOT/Capteur/docs/Schématics/sym-lib-table | 4 + 6 files changed, 1623 insertions(+) create mode 100644 IOT/Capteur/docs/Schématics/Schématics.kicad_pcb create mode 100644 IOT/Capteur/docs/Schématics/Schématics.kicad_prl create mode 100644 IOT/Capteur/docs/Schématics/Schématics.kicad_pro create mode 100644 IOT/Capteur/docs/Schématics/Schématics.kicad_sch create mode 100644 IOT/Capteur/docs/Schématics/Schématics_lib.kicad_sym create mode 100644 IOT/Capteur/docs/Schématics/sym-lib-table diff --git a/IOT/Capteur/docs/Schématics/Schématics.kicad_pcb b/IOT/Capteur/docs/Schématics/Schématics.kicad_pcb new file mode 100644 index 0000000..2b8ba10 --- /dev/null +++ b/IOT/Capteur/docs/Schématics/Schématics.kicad_pcb @@ -0,0 +1,2 @@ +(kicad_pcb (version 20221018) (generator pcbnew) +) \ No newline at end of file diff --git a/IOT/Capteur/docs/Schématics/Schématics.kicad_prl b/IOT/Capteur/docs/Schématics/Schématics.kicad_prl new file mode 100644 index 0000000..2d111f0 --- /dev/null +++ b/IOT/Capteur/docs/Schématics/Schématics.kicad_prl @@ -0,0 +1,77 @@ +{ + "board": { + "active_layer": 0, + "active_layer_preset": "", + "auto_track_width": true, + "hidden_netclasses": [], + "hidden_nets": [], + "high_contrast_mode": 0, + "net_color_mode": 1, + "opacity": { + "images": 0.6, + "pads": 1.0, + "tracks": 1.0, + "vias": 1.0, + "zones": 0.6 + }, + "selection_filter": { + "dimensions": true, + "footprints": true, + "graphics": true, + "keepouts": true, + "lockedItems": false, + "otherItems": true, + "pads": true, + "text": true, + "tracks": true, + "vias": true, + "zones": true + }, + "visible_items": [ + 0, + 1, + 2, + 3, + 4, + 5, + 8, + 9, + 10, + 11, + 12, + 13, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 32, + 33, + 34, + 35, + 36, + 39, + 40 + ], + "visible_layers": "fffffff_ffffffff", + "zone_display_mode": 0 + }, + "meta": { + "filename": "Schématics.kicad_prl", + "version": 3 + }, + "project": { + "files": [] + } +} diff --git a/IOT/Capteur/docs/Schématics/Schématics.kicad_pro b/IOT/Capteur/docs/Schématics/Schématics.kicad_pro new file mode 100644 index 0000000..4f368ab --- /dev/null +++ b/IOT/Capteur/docs/Schématics/Schématics.kicad_pro @@ -0,0 +1,332 @@ +{ + "board": { + "3dviewports": [], + "design_settings": { + "defaults": { + "board_outline_line_width": 0.1, + "copper_line_width": 0.2, + "copper_text_size_h": 1.5, + "copper_text_size_v": 1.5, + "copper_text_thickness": 0.3, + "other_line_width": 0.15, + "silk_line_width": 0.15, + "silk_text_size_h": 1.0, + "silk_text_size_v": 1.0, + "silk_text_thickness": 0.15 + }, + "diff_pair_dimensions": [], + "drc_exclusions": [], + "rules": { + "min_copper_edge_clearance": 0.0, + "solder_mask_clearance": 0.0, + "solder_mask_min_width": 0.0 + }, + "track_widths": [], + "via_dimensions": [] + }, + "layer_presets": [], + "viewports": [] + }, + "boards": [], + "cvpcb": { + "equivalence_files": [] + }, + "erc": { + "erc_exclusions": [], + "meta": { + "version": 0 + }, + "pin_map": [ + [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 2 + ], + [ + 0, + 2, + 0, + 1, + 0, + 0, + 1, + 0, + 2, + 2, + 2, + 2 + ], + [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 0, + 1, + 2 + ], + [ + 0, + 1, + 0, + 0, + 0, + 0, + 1, + 1, + 2, + 1, + 1, + 2 + ], + [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 2 + ], + [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2 + ], + [ + 1, + 1, + 1, + 1, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 2 + ], + [ + 0, + 0, + 0, + 1, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 2 + ], + [ + 0, + 2, + 1, + 2, + 0, + 0, + 1, + 0, + 2, + 2, + 2, + 2 + ], + [ + 0, + 2, + 0, + 1, + 0, + 0, + 1, + 0, + 2, + 0, + 0, + 2 + ], + [ + 0, + 2, + 1, + 1, + 0, + 0, + 1, + 0, + 2, + 0, + 0, + 2 + ], + [ + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2 + ] + ], + "rule_severities": { + "bus_definition_conflict": "error", + "bus_entry_needed": "error", + "bus_to_bus_conflict": "error", + "bus_to_net_conflict": "error", + "conflicting_netclasses": "error", + "different_unit_footprint": "error", + "different_unit_net": "error", + "duplicate_reference": "error", + "duplicate_sheet_names": "error", + "endpoint_off_grid": "warning", + "extra_units": "error", + "global_label_dangling": "warning", + "hier_label_mismatch": "error", + "label_dangling": "error", + "lib_symbol_issues": "warning", + "missing_bidi_pin": "warning", + "missing_input_pin": "warning", + "missing_power_pin": "error", + "missing_unit": "warning", + "multiple_net_names": "warning", + "net_not_bus_member": "warning", + "no_connect_connected": "warning", + "no_connect_dangling": "warning", + "pin_not_connected": "error", + "pin_not_driven": "error", + "pin_to_pin": "warning", + "power_pin_not_driven": "error", + "similar_labels": "warning", + "simulation_model_issue": "ignore", + "unannotated": "error", + "unit_value_mismatch": "error", + "unresolved_variable": "error", + "wire_dangling": "error" + } + }, + "libraries": { + "pinned_footprint_libs": [], + "pinned_symbol_libs": [] + }, + "meta": { + "filename": "Schématics.kicad_pro", + "version": 1 + }, + "net_settings": { + "classes": [ + { + "bus_width": 12, + "clearance": 0.2, + "diff_pair_gap": 0.25, + "diff_pair_via_gap": 0.25, + "diff_pair_width": 0.2, + "line_style": 0, + "microvia_diameter": 0.3, + "microvia_drill": 0.1, + "name": "Default", + "pcb_color": "rgba(0, 0, 0, 0.000)", + "schematic_color": "rgba(0, 0, 0, 0.000)", + "track_width": 0.25, + "via_diameter": 0.8, + "via_drill": 0.4, + "wire_width": 6 + } + ], + "meta": { + "version": 3 + }, + "net_colors": null, + "netclass_assignments": null, + "netclass_patterns": [] + }, + "pcbnew": { + "last_paths": { + "gencad": "", + "idf": "", + "netlist": "", + "specctra_dsn": "", + "step": "", + "vrml": "" + }, + "page_layout_descr_file": "" + }, + "schematic": { + "annotate_start_num": 0, + "drawing": { + "dashed_lines_dash_length_ratio": 12.0, + "dashed_lines_gap_length_ratio": 3.0, + "default_line_thickness": 6.0, + "default_text_size": 50.0, + "field_names": [], + "intersheets_ref_own_page": false, + "intersheets_ref_prefix": "", + "intersheets_ref_short": false, + "intersheets_ref_show": false, + "intersheets_ref_suffix": "", + "junction_size_choice": 3, + "label_size_ratio": 0.375, + "pin_symbol_size": 25.0, + "text_offset_ratio": 0.15 + }, + "legacy_lib_dir": "", + "legacy_lib_list": [], + "meta": { + "version": 1 + }, + "net_format_name": "", + "page_layout_descr_file": "", + "plot_directory": "", + "spice_current_sheet_as_root": false, + "spice_external_command": "spice \"%I\"", + "spice_model_current_sheet_as_root": true, + "spice_save_all_currents": false, + "spice_save_all_voltages": false, + "subpart_first_id": 65, + "subpart_id_separator": 0 + }, + "sheets": [ + [ + "fd3f9336-dfc5-4b09-a9e1-948dbf38d050", + "" + ] + ], + "text_variables": {} +} diff --git a/IOT/Capteur/docs/Schématics/Schématics.kicad_sch b/IOT/Capteur/docs/Schématics/Schématics.kicad_sch new file mode 100644 index 0000000..cf86096 --- /dev/null +++ b/IOT/Capteur/docs/Schématics/Schématics.kicad_sch @@ -0,0 +1,936 @@ +(kicad_sch (version 20230121) (generator eeschema) + + (uuid fd3f9336-dfc5-4b09-a9e1-948dbf38d050) + + (paper "A4") + + (lib_symbols + (symbol "Schématics_lib:BMP180" (in_bom yes) (on_board yes) + (property "Reference" "BMP" (at 2.54 1.27 0) + (effects (font (size 1.27 1.27))) + ) + (property "Value" "" (at 0 0 0) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (symbol "BMP180_0_1" + (rectangle (start 0 0) (end 10.16 -5.08) + (stroke (width 0) (type default)) + (fill (type none)) + ) + ) + (symbol "BMP180_1_1" + (pin bidirectional line (at 6.35 -7.62 90) (length 2.54) + (name "3V3" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 8.89 -7.62 90) (length 2.54) + (name "GND" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 3.81 -7.62 90) (length 2.54) + (name "SCL" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 1.27 -7.62 90) (length 2.54) + (name "SDA" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + ) + ) + (symbol "Schématics_lib:LORA_emitter" (in_bom yes) (on_board yes) + (property "Reference" "LoRa" (at 2.54 1.27 0) + (effects (font (size 1.27 1.27))) + ) + (property "Value" "" (at 0 0 0) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (symbol "LORA_emitter_0_1" + (rectangle (start 0 0) (end 20.32 -10.16) + (stroke (width 0) (type default)) + (fill (type none)) + ) + ) + (symbol "LORA_emitter_1_1" + (pin bidirectional line (at 19.05 -12.7 90) (length 2.54) + (name "3V3" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 8.89 -12.7 90) (length 2.54) + (name "GND" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 11.43 -12.7 90) (length 2.54) + (name "IO0" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 1.27 -12.7 90) (length 2.54) + (name "MISO" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 13.97 -12.7 90) (length 2.54) + (name "MOSI" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 16.51 -12.7 90) (length 2.54) + (name "NSS" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 6.35 -12.7 90) (length 2.54) + (name "RST" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 3.81 -12.7 90) (length 2.54) + (name "SCK" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + ) + ) + (symbol "Schématics_lib:Wemos_D1_mini" (in_bom yes) (on_board yes) + (property "Reference" "ESP" (at -7.62 5.08 0) + (effects (font (size 1.27 1.27))) + ) + (property "Value" "" (at 0 0 0) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (symbol "Wemos_D1_mini_0_1" + (polyline + (pts + (xy 3.81 2.54) + (xy 3.81 1.27) + ) + (stroke (width 0) (type default)) + (fill (type none)) + ) + (polyline + (pts + (xy 3.81 3.81) + (xy 12.7 3.81) + ) + (stroke (width 0) (type default)) + (fill (type none)) + ) + (polyline + (pts + (xy 12.7 0) + (xy 12.7 2.54) + (xy 10.16 2.54) + (xy 10.16 1.27) + (xy 8.89 1.27) + (xy 8.89 2.54) + (xy 7.62 2.54) + (xy 7.62 1.27) + (xy 6.35 1.27) + (xy 6.35 2.54) + (xy 2.54 2.54) + (xy 2.54 1.27) + ) + (stroke (width 0) (type default)) + (fill (type none)) + ) + (rectangle (start 0 0) (end 16.51 -20.32) + (stroke (width 0) (type default)) + (fill (type none)) + ) + (arc (start 3.81 3.81) (mid 1.1258 2.6842) (end 0 0) + (stroke (width 0) (type default)) + (fill (type none)) + ) + (rectangle (start 5.08 -17.78) (end 11.43 -21.59) + (stroke (width 0) (type default)) + (fill (type none)) + ) + (arc (start 16.51 0) (mid 15.3926 2.6926) (end 12.7 3.81) + (stroke (width 0) (type default)) + (fill (type none)) + ) + ) + (symbol "Wemos_D1_mini_1_1" + (pin input line (at -2.54 -1.27 0) (length 2.54) + (name "RST" (effects (font (size 1.27 1.27)))) + (number "1" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 19.05 -16.51 180) (length 2.54) + (name "GND" (effects (font (size 1.27 1.27)))) + (number "15" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -2.54 -16.51 0) (length 2.54) + (name "D8" (effects (font (size 1.27 1.27)))) + (number "16" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 19.05 -13.97 180) (length 2.54) + (name "D4" (effects (font (size 1.27 1.27)))) + (number "17" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 19.05 -11.43 180) (length 2.54) + (name "D3" (effects (font (size 1.27 1.27)))) + (number "18" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 19.05 -8.89 180) (length 2.54) + (name "D2(sdl)" (effects (font (size 1.27 1.27)))) + (number "19" (effects (font (size 1.27 1.27)))) + ) + (pin input line (at -2.54 -3.81 0) (length 2.54) + (name "A0" (effects (font (size 1.27 1.27)))) + (number "2" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 19.05 -6.35 180) (length 2.54) + (name "D1(sda)" (effects (font (size 1.27 1.27)))) + (number "20" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 19.05 -3.81 180) (length 2.54) + (name "RX" (effects (font (size 1.27 1.27)))) + (number "21" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 19.05 -1.27 180) (length 2.54) + (name "TX" (effects (font (size 1.27 1.27)))) + (number "22" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -2.54 -6.35 0) (length 2.54) + (name "D0" (effects (font (size 1.27 1.27)))) + (number "4" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -2.54 -8.89 0) (length 2.54) + (name "D5" (effects (font (size 1.27 1.27)))) + (number "5" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -2.54 -11.43 0) (length 2.54) + (name "D6" (effects (font (size 1.27 1.27)))) + (number "6" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -2.54 -13.97 0) (length 2.54) + (name "D7" (effects (font (size 1.27 1.27)))) + (number "7" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -2.54 -19.05 0) (length 2.54) + (name "3V3" (effects (font (size 1.27 1.27)))) + (number "8" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 19.05 -19.05 180) (length 2.54) + (name "5V" (effects (font (size 1.27 1.27)))) + (number "USB" (effects (font (size 1.27 1.27)))) + ) + ) + ) + (symbol "Schématics_lib:micro_SD" (in_bom yes) (on_board yes) + (property "Reference" "SD" (at 1.27 1.27 0) + (effects (font (size 1.27 1.27))) + ) + (property "Value" "" (at 0 0 0) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (symbol "micro_SD_0_1" + (rectangle (start 0 0) (end 15.24 -11.43) + (stroke (width 0) (type default)) + (fill (type none)) + ) + ) + (symbol "micro_SD_1_1" + (pin bidirectional line (at 3.81 -13.97 90) (length 2.54) + (name "3V3" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 13.97 -13.97 90) (length 2.54) + (name "CLK" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 11.43 -13.97 90) (length 2.54) + (name "CS" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 1.27 -13.97 90) (length 2.54) + (name "GND" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 8.89 -13.97 90) (length 2.54) + (name "MISO" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 6.35 -13.97 90) (length 2.54) + (name "MOSI" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + ) + ) + (symbol "Sensor:DHT11" (in_bom yes) (on_board yes) + (property "Reference" "U" (at -3.81 6.35 0) + (effects (font (size 1.27 1.27))) + ) + (property "Value" "DHT11" (at 3.81 6.35 0) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "Sensor:Aosong_DHT11_5.5x12.0_P2.54mm" (at 0 -10.16 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "http://akizukidenshi.com/download/ds/aosong/DHT11.pdf" (at 3.81 6.35 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "ki_keywords" "Digital temperature humidity sensor" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "ki_description" "Temperature and humidity module" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "ki_fp_filters" "Aosong*DHT11*5.5x12.0*P2.54mm*" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (symbol "DHT11_0_1" + (rectangle (start -5.08 5.08) (end 5.08 -5.08) + (stroke (width 0.254) (type default)) + (fill (type background)) + ) + ) + (symbol "DHT11_1_1" + (pin power_in line (at 0 7.62 270) (length 2.54) + (name "VCC" (effects (font (size 1.27 1.27)))) + (number "1" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 7.62 0 180) (length 2.54) + (name "IO" (effects (font (size 1.27 1.27)))) + (number "2" (effects (font (size 1.27 1.27)))) + ) + (pin no_connect line (at -5.08 0 0) (length 2.54) hide + (name "NC" (effects (font (size 1.27 1.27)))) + (number "3" (effects (font (size 1.27 1.27)))) + ) + (pin power_in line (at 0 -7.62 90) (length 2.54) + (name "GND" (effects (font (size 1.27 1.27)))) + (number "4" (effects (font (size 1.27 1.27)))) + ) + ) + ) + (symbol "power:+3V3" (power) (pin_names (offset 0)) (in_bom yes) (on_board yes) + (property "Reference" "#PWR" (at 0 -3.81 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Value" "+3V3" (at 0 3.556 0) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "ki_keywords" "global power" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "ki_description" "Power symbol creates a global label with name \"+3V3\"" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (symbol "+3V3_0_1" + (polyline + (pts + (xy -0.762 1.27) + (xy 0 2.54) + ) + (stroke (width 0) (type default)) + (fill (type none)) + ) + (polyline + (pts + (xy 0 0) + (xy 0 2.54) + ) + (stroke (width 0) (type default)) + (fill (type none)) + ) + (polyline + (pts + (xy 0 2.54) + (xy 0.762 1.27) + ) + (stroke (width 0) (type default)) + (fill (type none)) + ) + ) + (symbol "+3V3_1_1" + (pin power_in line (at 0 0 90) (length 0) hide + (name "+3V3" (effects (font (size 1.27 1.27)))) + (number "1" (effects (font (size 1.27 1.27)))) + ) + ) + ) + (symbol "power:GND" (power) (pin_names (offset 0)) (in_bom yes) (on_board yes) + (property "Reference" "#PWR" (at 0 -6.35 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Value" "GND" (at 0 -3.81 0) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "ki_keywords" "global power" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "ki_description" "Power symbol creates a global label with name \"GND\" , ground" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (symbol "GND_0_1" + (polyline + (pts + (xy 0 0) + (xy 0 -1.27) + (xy 1.27 -1.27) + (xy 0 -2.54) + (xy -1.27 -1.27) + (xy 0 -1.27) + ) + (stroke (width 0) (type default)) + (fill (type none)) + ) + ) + (symbol "GND_1_1" + (pin power_in line (at 0 0 270) (length 0) hide + (name "GND" (effects (font (size 1.27 1.27)))) + (number "1" (effects (font (size 1.27 1.27)))) + ) + ) + ) + ) + + (junction (at 66.04 54.61) (diameter 0) (color 0 0 0 0) + (uuid 00f187c3-f956-443e-84e6-2008510a7d72) + ) + (junction (at 105.41 52.07) (diameter 0) (color 0 0 0 0) + (uuid 05320e14-19e2-42fd-b933-8f2a8e253a4b) + ) + (junction (at 63.5 72.39) (diameter 0) (color 0 0 0 0) + (uuid 07229aff-4172-4dc4-a2c0-27f850a03fd3) + ) + (junction (at 62.23 77.47) (diameter 0) (color 0 0 0 0) + (uuid 07aba3da-d306-42b2-be06-3078ae85e6d1) + ) + (junction (at 105.41 57.15) (diameter 0) (color 0 0 0 0) + (uuid 466dc48e-e041-403a-a1a9-813377c03418) + ) + (junction (at 66.04 67.31) (diameter 0) (color 0 0 0 0) + (uuid 80aa7578-f724-4798-97cc-b80e7c0ee956) + ) + (junction (at 64.77 69.85) (diameter 0) (color 0 0 0 0) + (uuid 8f3858d3-6a15-42dc-a69b-add665e315f2) + ) + (junction (at 67.31 64.77) (diameter 0) (color 0 0 0 0) + (uuid d0b78a28-3e34-4e10-90d2-92ec57ada2c5) + ) + (junction (at 118.11 34.29) (diameter 0) (color 0 0 0 0) + (uuid f7ecaa26-17f4-4115-9f44-e1c5f0d18e4e) + ) + + (no_connect (at 69.85 39.37) (uuid 3f47eb46-2e68-4b82-8eb1-0c241ef61ae9)) + + (wire (pts (xy 66.04 67.31) (xy 66.04 101.6)) + (stroke (width 0) (type default)) + (uuid 05f8e4f6-58bb-42d8-a95e-bc03ba6928a8) + ) + (wire (pts (xy 64.77 49.53) (xy 69.85 49.53)) + (stroke (width 0) (type default)) + (uuid 0e32b3fd-34c7-4a1e-a01d-efc02d97a8d7) + ) + (wire (pts (xy 59.69 52.07) (xy 59.69 74.93)) + (stroke (width 0) (type default)) + (uuid 134fdb55-4ff2-4e7e-b29e-5cbe58a63358) + ) + (wire (pts (xy 91.44 52.07) (xy 105.41 52.07)) + (stroke (width 0) (type default)) + (uuid 161a9767-dded-4503-a9fe-6f2041914450) + ) + (wire (pts (xy 69.85 54.61) (xy 66.04 54.61)) + (stroke (width 0) (type default)) + (uuid 1632ccec-b6df-45a6-90bc-4445109fe2fa) + ) + (wire (pts (xy 54.61 93.98) (xy 68.58 93.98)) + (stroke (width 0) (type default)) + (uuid 23324e72-c948-4192-86a0-033e152870a8) + ) + (wire (pts (xy 62.23 99.06) (xy 68.58 99.06)) + (stroke (width 0) (type default)) + (uuid 248d6aa2-9a69-46b7-b8d6-bc50a34e03aa) + ) + (wire (pts (xy 68.58 91.44) (xy 67.31 91.44)) + (stroke (width 0) (type default)) + (uuid 2785c978-79fc-46c4-afb6-10ec98553e29) + ) + (wire (pts (xy 120.65 34.29) (xy 118.11 34.29)) + (stroke (width 0) (type default)) + (uuid 29943c32-bd20-40cf-a917-38ce1f4f5d77) + ) + (wire (pts (xy 102.87 34.29) (xy 118.11 34.29)) + (stroke (width 0) (type default)) + (uuid 2d6d3785-2ef7-49a7-a7a1-b2fc9a04dc3b) + ) + (wire (pts (xy 53.34 64.77) (xy 67.31 64.77)) + (stroke (width 0) (type default)) + (uuid 2e44de81-ed3c-4fbb-a5a7-6e80508e1ff3) + ) + (wire (pts (xy 91.44 39.37) (xy 93.98 39.37)) + (stroke (width 0) (type default)) + (uuid 2e4b9fee-4685-4f03-a9c4-69bf2bfc8636) + ) + (wire (pts (xy 120.65 57.15) (xy 105.41 57.15)) + (stroke (width 0) (type default)) + (uuid 2ec9fd2d-8ef4-4786-916e-2840df6ef1bd) + ) + (wire (pts (xy 63.5 83.82) (xy 63.5 72.39)) + (stroke (width 0) (type default)) + (uuid 2fb3e23a-61ec-453e-be00-9ec8017af700) + ) + (wire (pts (xy 68.58 67.31) (xy 66.04 67.31)) + (stroke (width 0) (type default)) + (uuid 3117bf92-c0f3-46fe-93b6-acb89b30ab1f) + ) + (wire (pts (xy 100.33 44.45) (xy 91.44 44.45)) + (stroke (width 0) (type default)) + (uuid 352d321b-a79d-469d-9a09-b3b4637e5591) + ) + (wire (pts (xy 66.04 101.6) (xy 68.58 101.6)) + (stroke (width 0) (type default)) + (uuid 3d715416-ca25-43a2-8399-c1aadd6bfa47) + ) + (wire (pts (xy 62.23 77.47) (xy 62.23 86.36)) + (stroke (width 0) (type default)) + (uuid 3e04f6ae-550c-4e91-a25b-d3c9c9b4d6f6) + ) + (wire (pts (xy 100.33 33.02) (xy 100.33 44.45)) + (stroke (width 0) (type default)) + (uuid 483df354-9eb0-4c4c-a338-9ea06430ad8e) + ) + (wire (pts (xy 66.04 54.61) (xy 66.04 67.31)) + (stroke (width 0) (type default)) + (uuid 4926759a-4b05-44ce-8358-c41233d03cc8) + ) + (wire (pts (xy 62.23 86.36) (xy 68.58 86.36)) + (stroke (width 0) (type default)) + (uuid 5327fb84-1ff2-49b6-b939-f329f5c465d0) + ) + (wire (pts (xy 66.04 41.91) (xy 66.04 36.83)) + (stroke (width 0) (type default)) + (uuid 5cde2e34-1fde-4ee1-a441-30185d06ff63) + ) + (wire (pts (xy 59.69 52.07) (xy 69.85 52.07)) + (stroke (width 0) (type default)) + (uuid 5de8fd5b-f06a-4606-94e0-a3a621e3dfb5) + ) + (wire (pts (xy 118.11 31.75) (xy 118.11 34.29)) + (stroke (width 0) (type default)) + (uuid 5e75bda4-74b3-482e-91a3-3ebb3aa4708e) + ) + (wire (pts (xy 69.85 46.99) (xy 63.5 46.99)) + (stroke (width 0) (type default)) + (uuid 6ad91adb-1f68-4336-a491-f2abbc8d00eb) + ) + (wire (pts (xy 64.77 96.52) (xy 68.58 96.52)) + (stroke (width 0) (type default)) + (uuid 6be53eb8-3b76-46d2-bd15-5a8757cad1a2) + ) + (wire (pts (xy 105.41 33.02) (xy 105.41 52.07)) + (stroke (width 0) (type default)) + (uuid 6c654e85-f548-4ff9-bf57-a27dea1bfe83) + ) + (wire (pts (xy 105.41 57.15) (xy 105.41 52.07)) + (stroke (width 0) (type default)) + (uuid 6cda8130-ab60-4d90-acba-d4f2b6e00279) + ) + (wire (pts (xy 68.58 69.85) (xy 64.77 69.85)) + (stroke (width 0) (type default)) + (uuid 72541a13-dd60-4b3f-a660-514d4e800450) + ) + (wire (pts (xy 53.34 54.61) (xy 66.04 54.61)) + (stroke (width 0) (type default)) + (uuid 83fd1208-fe71-47a4-93b1-65d962d67d0f) + ) + (wire (pts (xy 59.69 74.93) (xy 68.58 74.93)) + (stroke (width 0) (type default)) + (uuid 8928d5c6-3e91-40cb-926d-1d3beee1a593) + ) + (wire (pts (xy 66.04 36.83) (xy 69.85 36.83)) + (stroke (width 0) (type default)) + (uuid 91645f57-9801-4c63-81a2-73c58682e6d4) + ) + (wire (pts (xy 63.5 72.39) (xy 68.58 72.39)) + (stroke (width 0) (type default)) + (uuid 9494ef32-6252-4faa-bc7a-6520e345be7a) + ) + (wire (pts (xy 102.87 33.02) (xy 102.87 34.29)) + (stroke (width 0) (type default)) + (uuid 98766a9d-b9dd-412d-b74a-f0beead20553) + ) + (wire (pts (xy 93.98 39.37) (xy 93.98 29.21)) + (stroke (width 0) (type default)) + (uuid a204906c-e9c4-4185-a02a-2c2889205bfd) + ) + (wire (pts (xy 97.79 41.91) (xy 91.44 41.91)) + (stroke (width 0) (type default)) + (uuid a649ae75-fd1f-433b-b43a-653faca99d7f) + ) + (wire (pts (xy 67.31 91.44) (xy 67.31 64.77)) + (stroke (width 0) (type default)) + (uuid b58a09ee-b31f-475e-8129-8248cd657a69) + ) + (wire (pts (xy 68.58 77.47) (xy 62.23 77.47)) + (stroke (width 0) (type default)) + (uuid bdb0a224-d5bb-4427-87b3-02a16223a451) + ) + (wire (pts (xy 67.31 64.77) (xy 68.58 64.77)) + (stroke (width 0) (type default)) + (uuid c1629db0-e750-4c5b-b275-4586be473ea5) + ) + (wire (pts (xy 63.5 46.99) (xy 63.5 72.39)) + (stroke (width 0) (type default)) + (uuid c38cd48d-caf3-445e-aad2-61940ae6a099) + ) + (wire (pts (xy 68.58 83.82) (xy 63.5 83.82)) + (stroke (width 0) (type default)) + (uuid c6fd0df9-e76c-4f64-99cb-918dfc7ac864) + ) + (wire (pts (xy 62.23 77.47) (xy 62.23 44.45)) + (stroke (width 0) (type default)) + (uuid d3e92c1c-2f4b-4c7c-ab24-4f95b197a89f) + ) + (wire (pts (xy 120.65 41.91) (xy 120.65 34.29)) + (stroke (width 0) (type default)) + (uuid dac0208a-c7e9-41b2-83e4-3be90de15095) + ) + (wire (pts (xy 64.77 69.85) (xy 64.77 49.53)) + (stroke (width 0) (type default)) + (uuid ddf9bbb8-3c60-4755-9e6c-bac13d1731b2) + ) + (wire (pts (xy 64.77 69.85) (xy 64.77 96.52)) + (stroke (width 0) (type default)) + (uuid e584f691-516a-4f54-8ba9-6630d4aa00d7) + ) + (wire (pts (xy 62.23 44.45) (xy 69.85 44.45)) + (stroke (width 0) (type default)) + (uuid ec195219-13b5-40e1-9bb2-dd4de7bb607b) + ) + (wire (pts (xy 91.44 49.53) (xy 113.03 49.53)) + (stroke (width 0) (type default)) + (uuid f514a536-b365-4e94-9b67-0ce3f5ff5b61) + ) + (wire (pts (xy 69.85 41.91) (xy 66.04 41.91)) + (stroke (width 0) (type default)) + (uuid fab8da63-01ec-4c22-8f42-ec5bbeb544ab) + ) + (wire (pts (xy 97.79 33.02) (xy 97.79 41.91)) + (stroke (width 0) (type default)) + (uuid fde08864-6062-47c2-8412-8fad86f23fd8) + ) + + (global_label "LoRa_CS" (shape input) (at 62.23 99.06 180) (fields_autoplaced) + (effects (font (size 1.27 1.27)) (justify right)) + (uuid 5b37f104-c178-4d2d-a81b-d89e72618a15) + (property "Intersheetrefs" "${INTERSHEET_REFS}" (at 51.2016 99.06 0) + (effects (font (size 1.27 1.27)) (justify right) hide) + ) + ) + (global_label "LoRa_IO0" (shape input) (at 54.61 93.98 180) (fields_autoplaced) + (effects (font (size 1.27 1.27)) (justify right)) + (uuid 86b8f348-d6de-40ae-8cfa-90822fd382d6) + (property "Intersheetrefs" "${INTERSHEET_REFS}" (at 42.9163 93.98 0) + (effects (font (size 1.27 1.27)) (justify right) hide) + ) + ) + (global_label "LoRa_IO0" (shape input) (at 93.98 29.21 90) (fields_autoplaced) + (effects (font (size 1.27 1.27)) (justify left)) + (uuid b810c0f9-0f54-4d4f-870c-873c6826173e) + (property "Intersheetrefs" "${INTERSHEET_REFS}" (at 93.98 17.5163 90) + (effects (font (size 1.27 1.27)) (justify left) hide) + ) + ) + (global_label "Lora_CS" (shape input) (at 91.44 46.99 0) (fields_autoplaced) + (effects (font (size 1.27 1.27)) (justify left)) + (uuid cb7ae959-e3f1-4159-b7c8-75d6a0baebe6) + (property "Intersheetrefs" "${INTERSHEET_REFS}" (at 101.9846 46.99 0) + (effects (font (size 1.27 1.27)) (justify left) hide) + ) + ) + + (symbol (lib_id "Schématics_lib:LORA_emitter") (at 81.28 82.55 270) (unit 1) + (in_bom yes) (on_board yes) (dnp no) (fields_autoplaced) + (uuid 1ec728a4-9ba2-43eb-beb9-1fe8db96f421) + (property "Reference" "LoRa1" (at 82.55 92.71 90) + (effects (font (size 1.27 1.27)) (justify left)) + ) + (property "Value" "~" (at 81.28 82.55 0) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "" (at 81.28 82.55 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "" (at 81.28 82.55 0) + (effects (font (size 1.27 1.27)) hide) + ) + (pin "" (uuid 4f8f88ac-afec-41db-afff-154056e59da9)) + (pin "" (uuid 4f8f88ac-afec-41db-afff-154056e59da9)) + (pin "" (uuid 4f8f88ac-afec-41db-afff-154056e59da9)) + (pin "" (uuid 4f8f88ac-afec-41db-afff-154056e59da9)) + (pin "" (uuid 4f8f88ac-afec-41db-afff-154056e59da9)) + (pin "" (uuid 4f8f88ac-afec-41db-afff-154056e59da9)) + (pin "" (uuid 4f8f88ac-afec-41db-afff-154056e59da9)) + (pin "" (uuid 4f8f88ac-afec-41db-afff-154056e59da9)) + (instances + (project "Schématics" + (path "/fd3f9336-dfc5-4b09-a9e1-948dbf38d050" + (reference "LoRa1") (unit 1) + ) + ) + ) + ) + + (symbol (lib_id "power:GND") (at 105.41 57.15 0) (unit 1) + (in_bom yes) (on_board yes) (dnp no) (fields_autoplaced) + (uuid 34618810-f3b8-42bc-92d4-a9d7fbeee5d7) + (property "Reference" "#PWR03" (at 105.41 63.5 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Value" "GND" (at 105.41 62.23 0) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "" (at 105.41 57.15 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "" (at 105.41 57.15 0) + (effects (font (size 1.27 1.27)) hide) + ) + (pin "1" (uuid 03985145-4756-4ee7-b8a7-8bf516c94fc7)) + (instances + (project "Schématics" + (path "/fd3f9336-dfc5-4b09-a9e1-948dbf38d050" + (reference "#PWR03") (unit 1) + ) + ) + ) + ) + + (symbol (lib_id "Schématics_lib:micro_SD") (at 82.55 63.5 270) (unit 1) + (in_bom yes) (on_board yes) (dnp no) (fields_autoplaced) + (uuid 37a67363-9cf1-4eaf-81e6-c9eed2cec542) + (property "Reference" "SD1" (at 83.82 71.12 90) + (effects (font (size 1.27 1.27)) (justify left)) + ) + (property "Value" "~" (at 82.55 63.5 0) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "" (at 82.55 63.5 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "" (at 82.55 63.5 0) + (effects (font (size 1.27 1.27)) hide) + ) + (pin "" (uuid 1dadb250-3278-4c98-84ee-bd5a05bd6c76)) + (pin "" (uuid 11422c73-5bdd-4cfb-a5a2-246807a5b471)) + (pin "" (uuid 4174b2f4-1d76-4008-bb8d-d092a277bb53)) + (pin "" (uuid 89f60d9c-07b5-437f-9c11-e8b9b9e065c7)) + (pin "" (uuid e8ea3e29-9f36-4ea9-9b6d-529281f33813)) + (pin "" (uuid 0e15ee1c-6589-44f1-97c6-71334899fc3c)) + (instances + (project "Schématics" + (path "/fd3f9336-dfc5-4b09-a9e1-948dbf38d050" + (reference "SD1") (unit 1) + ) + ) + ) + ) + + (symbol (lib_id "Sensor:DHT11") (at 120.65 49.53 0) (mirror y) (unit 1) + (in_bom yes) (on_board yes) (dnp no) + (uuid 3baf3ef7-e0ce-4505-9935-aec8bdcfe00a) + (property "Reference" "U1" (at 127 50.8 0) + (effects (font (size 1.27 1.27)) (justify right)) + ) + (property "Value" "DHT11" (at 127 48.26 0) + (effects (font (size 1.27 1.27)) (justify right)) + ) + (property "Footprint" "Sensor:Aosong_DHT11_5.5x12.0_P2.54mm" (at 120.65 59.69 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "http://akizukidenshi.com/download/ds/aosong/DHT11.pdf" (at 116.84 43.18 0) + (effects (font (size 1.27 1.27)) hide) + ) + (pin "1" (uuid e7341031-2a1c-49f6-9fd2-dedf04519b02)) + (pin "2" (uuid 7759f151-4f93-4b27-8e56-2540b0ad303d)) + (pin "3" (uuid d7a5d82d-758f-4ce0-aada-4d1438d6ccab)) + (pin "4" (uuid 4ebe485c-aac6-4fcf-a683-ac4cbb4714aa)) + (instances + (project "Schématics" + (path "/fd3f9336-dfc5-4b09-a9e1-948dbf38d050" + (reference "U1") (unit 1) + ) + ) + ) + ) + + (symbol (lib_id "power:GND") (at 53.34 64.77 270) (unit 1) + (in_bom yes) (on_board yes) (dnp no) (fields_autoplaced) + (uuid 6ea5a4eb-7c04-45b2-84fc-8531af75860c) + (property "Reference" "#PWR04" (at 46.99 64.77 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Value" "GND" (at 49.53 64.77 90) + (effects (font (size 1.27 1.27)) (justify right)) + ) + (property "Footprint" "" (at 53.34 64.77 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "" (at 53.34 64.77 0) + (effects (font (size 1.27 1.27)) hide) + ) + (pin "1" (uuid eb65a8ee-2c68-48a6-921e-1584cf18907e)) + (instances + (project "Schématics" + (path "/fd3f9336-dfc5-4b09-a9e1-948dbf38d050" + (reference "#PWR04") (unit 1) + ) + ) + ) + ) + + (symbol (lib_id "Schématics_lib:BMP180") (at 96.52 25.4 0) (unit 1) + (in_bom yes) (on_board yes) (dnp no) (fields_autoplaced) + (uuid 78ac6cf9-f138-4523-ae94-20c9b8f51d71) + (property "Reference" "BMP1" (at 107.95 27.94 0) + (effects (font (size 1.27 1.27)) (justify left)) + ) + (property "Value" "~" (at 96.52 25.4 0) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "" (at 96.52 25.4 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "" (at 96.52 25.4 0) + (effects (font (size 1.27 1.27)) hide) + ) + (pin "" (uuid 23569266-1a43-4fb2-bfc3-7f42c280cece)) + (pin "" (uuid 55520409-1a3f-4c43-94b4-570545576637)) + (pin "" (uuid 6e1d50ac-472f-490f-ae1a-e9c501a198f0)) + (pin "" (uuid 6c818790-87d8-4c27-9261-c778d8438251)) + (instances + (project "Schématics" + (path "/fd3f9336-dfc5-4b09-a9e1-948dbf38d050" + (reference "BMP1") (unit 1) + ) + ) + ) + ) + + (symbol (lib_id "Schématics_lib:Wemos_D1_mini") (at 72.39 35.56 0) (unit 1) + (in_bom yes) (on_board yes) (dnp no) (fields_autoplaced) + (uuid 7d608ee8-42c6-4c6e-873f-1b3caf1c63e2) + (property "Reference" "ESP1" (at 80.645 29.21 0) + (effects (font (size 1.27 1.27))) + ) + (property "Value" "~" (at 72.39 35.56 0) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "" (at 72.39 35.56 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "" (at 72.39 35.56 0) + (effects (font (size 1.27 1.27)) hide) + ) + (pin "1" (uuid d0f96fbc-c770-4b35-8299-85da43c481cd)) + (pin "15" (uuid 7ede5330-358c-49d2-8620-589709258247)) + (pin "16" (uuid 23398b62-bbb8-48c4-938b-ed296afc3b68)) + (pin "17" (uuid a59838aa-4289-4c2f-8737-7dadb54907b7)) + (pin "18" (uuid 7dfed0b9-2c89-46a0-a78d-477f3befa642)) + (pin "19" (uuid 40f15062-4898-4233-943b-fe9e79283dfd)) + (pin "2" (uuid 274fd946-4ee2-40ea-8adb-13dcdcdbdbf2)) + (pin "20" (uuid e68796ca-53ba-4c9f-a05d-f093001add4c)) + (pin "21" (uuid 168f2bf3-146c-485a-a4ec-2ea0de07b83f)) + (pin "22" (uuid 7e1bde35-9875-4068-b676-32488cc7b943)) + (pin "4" (uuid 8bff9ac6-de5d-43dc-bea9-6aef4f27fe15)) + (pin "5" (uuid df10f25e-8f07-4a70-9b5a-6e39bcb13994)) + (pin "6" (uuid a9e34f9e-d3eb-4056-a286-2c9bc6db166c)) + (pin "7" (uuid 9cb7bf4d-efc5-43fa-acb2-0f3e4803ea8f)) + (pin "8" (uuid 5332355e-5bc9-4d58-b5ca-b7aee2ac7154)) + (pin "USB" (uuid 8509051b-a804-4eb5-a5a0-55e721d77615)) + (instances + (project "Schématics" + (path "/fd3f9336-dfc5-4b09-a9e1-948dbf38d050" + (reference "ESP1") (unit 1) + ) + ) + ) + ) + + (symbol (lib_id "power:+3V3") (at 53.34 54.61 90) (unit 1) + (in_bom yes) (on_board yes) (dnp no) (fields_autoplaced) + (uuid b497bff9-d8ca-4d62-9cb5-4e5755b8c135) + (property "Reference" "#PWR02" (at 57.15 54.61 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Value" "+3V3" (at 49.53 54.61 90) + (effects (font (size 1.27 1.27)) (justify left)) + ) + (property "Footprint" "" (at 53.34 54.61 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "" (at 53.34 54.61 0) + (effects (font (size 1.27 1.27)) hide) + ) + (pin "1" (uuid 0598507c-f7d9-4720-92f8-2180c6802bcc)) + (instances + (project "Schématics" + (path "/fd3f9336-dfc5-4b09-a9e1-948dbf38d050" + (reference "#PWR02") (unit 1) + ) + ) + ) + ) + + (symbol (lib_id "power:+3V3") (at 118.11 31.75 0) (unit 1) + (in_bom yes) (on_board yes) (dnp no) (fields_autoplaced) + (uuid bf4857c2-8d19-4db3-a0b3-98b767c4614e) + (property "Reference" "#PWR01" (at 118.11 35.56 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Value" "+3V3" (at 118.11 26.67 0) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "" (at 118.11 31.75 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "" (at 118.11 31.75 0) + (effects (font (size 1.27 1.27)) hide) + ) + (pin "1" (uuid e5dbc628-94bd-4507-b827-a1ac627ac176)) + (instances + (project "Schématics" + (path "/fd3f9336-dfc5-4b09-a9e1-948dbf38d050" + (reference "#PWR01") (unit 1) + ) + ) + ) + ) + + (sheet_instances + (path "/" (page "1")) + ) +) diff --git a/IOT/Capteur/docs/Schématics/Schématics_lib.kicad_sym b/IOT/Capteur/docs/Schématics/Schématics_lib.kicad_sym new file mode 100644 index 0000000..ce6bd0b --- /dev/null +++ b/IOT/Capteur/docs/Schématics/Schématics_lib.kicad_sym @@ -0,0 +1,272 @@ +(kicad_symbol_lib (version 20220914) (generator kicad_symbol_editor) + (symbol "BMP180" (in_bom yes) (on_board yes) + (property "Reference" "BMP" (at 2.54 1.27 0) + (effects (font (size 1.27 1.27))) + ) + (property "Value" "" (at 0 0 0) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (symbol "BMP180_0_1" + (rectangle (start 0 0) (end 10.16 -5.08) + (stroke (width 0) (type default)) + (fill (type none)) + ) + ) + (symbol "BMP180_1_1" + (pin bidirectional line (at 6.35 -7.62 90) (length 2.54) + (name "3V3" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 8.89 -7.62 90) (length 2.54) + (name "GND" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 3.81 -7.62 90) (length 2.54) + (name "SCL" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 1.27 -7.62 90) (length 2.54) + (name "SDA" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + ) + ) + (symbol "LORA_emitter" (in_bom yes) (on_board yes) + (property "Reference" "LoRa" (at 2.54 1.27 0) + (effects (font (size 1.27 1.27))) + ) + (property "Value" "" (at 0 0 0) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (symbol "LORA_emitter_0_1" + (rectangle (start 0 0) (end 20.32 -10.16) + (stroke (width 0) (type default)) + (fill (type none)) + ) + ) + (symbol "LORA_emitter_1_1" + (pin bidirectional line (at 19.05 -12.7 90) (length 2.54) + (name "3V3" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 8.89 -12.7 90) (length 2.54) + (name "GND" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 11.43 -12.7 90) (length 2.54) + (name "IO0" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 1.27 -12.7 90) (length 2.54) + (name "MISO" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 13.97 -12.7 90) (length 2.54) + (name "MOSI" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 16.51 -12.7 90) (length 2.54) + (name "NSS" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 6.35 -12.7 90) (length 2.54) + (name "RST" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 3.81 -12.7 90) (length 2.54) + (name "SCK" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + ) + ) + (symbol "Wemos_D1_mini" (in_bom yes) (on_board yes) + (property "Reference" "ESP" (at -7.62 5.08 0) + (effects (font (size 1.27 1.27))) + ) + (property "Value" "" (at 0 0 0) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (symbol "Wemos_D1_mini_0_1" + (polyline + (pts + (xy 3.81 2.54) + (xy 3.81 1.27) + ) + (stroke (width 0) (type default)) + (fill (type none)) + ) + (polyline + (pts + (xy 3.81 3.81) + (xy 12.7 3.81) + ) + (stroke (width 0) (type default)) + (fill (type none)) + ) + (polyline + (pts + (xy 12.7 0) + (xy 12.7 2.54) + (xy 10.16 2.54) + (xy 10.16 1.27) + (xy 8.89 1.27) + (xy 8.89 2.54) + (xy 7.62 2.54) + (xy 7.62 1.27) + (xy 6.35 1.27) + (xy 6.35 2.54) + (xy 2.54 2.54) + (xy 2.54 1.27) + ) + (stroke (width 0) (type default)) + (fill (type none)) + ) + (rectangle (start 0 0) (end 16.51 -20.32) + (stroke (width 0) (type default)) + (fill (type none)) + ) + (arc (start 3.81 3.81) (mid 1.1258 2.6842) (end 0 0) + (stroke (width 0) (type default)) + (fill (type none)) + ) + (rectangle (start 5.08 -17.78) (end 11.43 -21.59) + (stroke (width 0) (type default)) + (fill (type none)) + ) + (arc (start 16.51 0) (mid 15.3926 2.6926) (end 12.7 3.81) + (stroke (width 0) (type default)) + (fill (type none)) + ) + ) + (symbol "Wemos_D1_mini_1_1" + (pin input line (at -2.54 -1.27 0) (length 2.54) + (name "RST" (effects (font (size 1.27 1.27)))) + (number "1" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 19.05 -16.51 180) (length 2.54) + (name "GND" (effects (font (size 1.27 1.27)))) + (number "15" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -2.54 -16.51 0) (length 2.54) + (name "D8" (effects (font (size 1.27 1.27)))) + (number "16" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 19.05 -13.97 180) (length 2.54) + (name "D4" (effects (font (size 1.27 1.27)))) + (number "17" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 19.05 -11.43 180) (length 2.54) + (name "D3" (effects (font (size 1.27 1.27)))) + (number "18" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 19.05 -8.89 180) (length 2.54) + (name "D2(sdl)" (effects (font (size 1.27 1.27)))) + (number "19" (effects (font (size 1.27 1.27)))) + ) + (pin input line (at -2.54 -3.81 0) (length 2.54) + (name "A0" (effects (font (size 1.27 1.27)))) + (number "2" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 19.05 -6.35 180) (length 2.54) + (name "D1(sda)" (effects (font (size 1.27 1.27)))) + (number "20" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 19.05 -3.81 180) (length 2.54) + (name "RX" (effects (font (size 1.27 1.27)))) + (number "21" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 19.05 -1.27 180) (length 2.54) + (name "TX" (effects (font (size 1.27 1.27)))) + (number "22" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -2.54 -6.35 0) (length 2.54) + (name "D0" (effects (font (size 1.27 1.27)))) + (number "4" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -2.54 -8.89 0) (length 2.54) + (name "D5" (effects (font (size 1.27 1.27)))) + (number "5" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -2.54 -11.43 0) (length 2.54) + (name "D6" (effects (font (size 1.27 1.27)))) + (number "6" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -2.54 -13.97 0) (length 2.54) + (name "D7" (effects (font (size 1.27 1.27)))) + (number "7" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -2.54 -19.05 0) (length 2.54) + (name "3V3" (effects (font (size 1.27 1.27)))) + (number "8" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 19.05 -19.05 180) (length 2.54) + (name "5V" (effects (font (size 1.27 1.27)))) + (number "USB" (effects (font (size 1.27 1.27)))) + ) + ) + ) + (symbol "micro_SD" (in_bom yes) (on_board yes) + (property "Reference" "SD" (at 1.27 1.27 0) + (effects (font (size 1.27 1.27))) + ) + (property "Value" "" (at 0 0 0) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (symbol "micro_SD_0_1" + (rectangle (start 0 0) (end 15.24 -11.43) + (stroke (width 0) (type default)) + (fill (type none)) + ) + ) + (symbol "micro_SD_1_1" + (pin bidirectional line (at 3.81 -13.97 90) (length 2.54) + (name "3V3" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 13.97 -13.97 90) (length 2.54) + (name "CLK" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 11.43 -13.97 90) (length 2.54) + (name "CS" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 1.27 -13.97 90) (length 2.54) + (name "GND" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 8.89 -13.97 90) (length 2.54) + (name "MISO" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 6.35 -13.97 90) (length 2.54) + (name "MOSI" (effects (font (size 1.27 1.27)))) + (number "" (effects (font (size 1.27 1.27)))) + ) + ) + ) +) diff --git a/IOT/Capteur/docs/Schématics/sym-lib-table b/IOT/Capteur/docs/Schématics/sym-lib-table new file mode 100644 index 0000000..d0d99af --- /dev/null +++ b/IOT/Capteur/docs/Schématics/sym-lib-table @@ -0,0 +1,4 @@ +(sym_lib_table + (version 7) + (lib (name "Schématics_lib")(type "KiCad")(uri "${KIPRJMOD}/Schématics_lib.kicad_sym")(options "")(descr "")) +) From cf9695c53477ae46752ca911586f39f7b1889123 Mon Sep 17 00:00:00 2001 From: Clement Date: Tue, 11 Jul 2023 15:19:25 +0200 Subject: [PATCH 13/27] update gitignore --- IOT/Capteur/.gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/IOT/Capteur/.gitignore b/IOT/Capteur/.gitignore index 53072ca..6730019 100644 --- a/IOT/Capteur/.gitignore +++ b/IOT/Capteur/.gitignore @@ -10,3 +10,8 @@ # Aptatio/Platformio specifics secrets.ini + + +*.lck + +*-backups \ No newline at end of file From afdb1399e2e676d1ba43e326228453f9119de686 Mon Sep 17 00:00:00 2001 From: Clement Date: Tue, 11 Jul 2023 15:21:59 +0200 Subject: [PATCH 14/27] update pinoute config --- IOT/Capteur/config.ini | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/IOT/Capteur/config.ini b/IOT/Capteur/config.ini index b1bd465..c81639d 100644 --- a/IOT/Capteur/config.ini +++ b/IOT/Capteur/config.ini @@ -20,13 +20,18 @@ build_flags = -D DHT_PIN=\"D4\" - -D DHT_TYPE=\"DHT22\" + -D DHT_TYPE=\"DHT11\" -D BMS180_SDA=\"D2\" -D BMS180_SCL=\"D1\" - -D SD_CLK=\"D5\" - -D SD_MISO=\"D6\" - -D SD_MOSI=\"D7\" - -D SD_CS=\"D4\" + -D CLK=\"D5\" + -D MISO=\"D6\" + -D MOSI=\"D7\" + + -D SD_CS=\"D8\" + + -D LORA_CS=\"D3\" + + -D LORA_IO0=\"RX\" From fd58c50f7792e18fad978f0f938388091653561e Mon Sep 17 00:00:00 2001 From: Clement Date: Tue, 11 Jul 2023 16:22:10 +0200 Subject: [PATCH 15/27] add farm data lib --- IOT/Capteur/platformio.ini | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/IOT/Capteur/platformio.ini b/IOT/Capteur/platformio.ini index c13d96b..4dbbb35 100644 --- a/IOT/Capteur/platformio.ini +++ b/IOT/Capteur/platformio.ini @@ -50,11 +50,11 @@ upload_speed = 921600 ; librairies (make sure to fix versions where possible!) lib_deps = -; example: -; erropix/ESP32 AnalogWrite@0.2 - adafruit/DHT sensor library@^1.4.4 - adafruit/Adafruit Unified Sensor@^1.1.9 ; required by DHT - sparkfun/Sparkfun BMP180@^1.1.2 + https://github.com/timmbogner/Farm-Data-Relay-System.git ;lib for global system architecture + adafruit/DHT sensor library@^1.4.4 ;lib for humi and temp capteur + adafruit/Adafruit Unified Sensor@^1.1.9 ;required by DHT + sparkfun/Sparkfun BMP180@^1.1.2 ;lib for barometer capteur + jgromes/RadioLib@^6.1.0 ;lib for comunication ; Checker settings check_tool = clangtidy, cppcheck From 71401ca660261544fb02ddda1255e428aa5d44cf Mon Sep 17 00:00:00 2001 From: Clement Date: Tue, 11 Jul 2023 16:22:28 +0200 Subject: [PATCH 16/27] add farm data config --- IOT/Capteur/config.ini | 53 +++++++++++++++++++++++++++++++++--------- 1 file changed, 42 insertions(+), 11 deletions(-) diff --git a/IOT/Capteur/config.ini b/IOT/Capteur/config.ini index c81639d..8a78241 100644 --- a/IOT/Capteur/config.ini +++ b/IOT/Capteur/config.ini @@ -16,22 +16,53 @@ build_flags = -D EXAMPLE_NUMBER=69 - -D EXAMPLE_STRING=\"Pouet\" + -D DHT_PIN=D4 + -D DHT_TYPE=DHT11 + -D BMS180_SDA=D2 + -D BMS180_SCL=D1 - -D DHT_PIN=\"D4\" - -D DHT_TYPE=\"DHT11\" + -D G_CLK=D5 + -D G_MISO=D6 + -D G_MOSI=D7 - -D BMS180_SDA=\"D2\" - -D BMS180_SCL=\"D1\" + -D SD_CS=D8 - -D CLK=\"D5\" - -D MISO=\"D6\" - -D MOSI=\"D7\" + -D LORA_CS=D3 - -D SD_CS=\"D8\" + -D LORA_IO0=RX - -D LORA_CS=\"D3\" +; FARM DATA RELAY SYSTEM +; Sensor Configuration - -D LORA_IO0=\"RX\" + -D FDRS_DEBUG ; allow FARM DATA serial debuging + -D RADIOLIB_DEBUG ; allow Radio serial debuging + ; sensor ID + -D READING_ID=2 + + ; Address of the gateway + -D GTWY_MAC=0x01 + + ; uncomment to use + ; -D USE_ESPNOW ; comunicate with ESPNow + -D USE_LORA ; communicate with LoRa + -D DEEP_SLEEP ; use deep sleep + ; -D POWER_CTRL=14 + + ; LoRa Configuration + -D RADIOLIB_MODULE=SX1278 + -D LORA_SS=LORA_CS + -D LORA_RST=17 + -D LORA_DIO=RX + -D LORA_BUSY=RADIOLIB_NC + ; -D USE_SX126X + + -D LORA_TXPWR=20 ; LoRa TX power in dBm (: +2dBm - +17dBm (for SX1276-7) +20dBm (for SX1278)) + -D LORA_ACK ; Request LoRa acknowledgment. + + -D LORA_SPI_SCK=G_CLK + -D LORA_SPI_MISO=G_MISO + -D LORA_SPI_MOSI=G_MOSI + + -D LORA_FREQUENCY=433 \ No newline at end of file From aab799fbdae56ec7757bdadf4ad36c5a7b7b7e56 Mon Sep 17 00:00:00 2001 From: Clement Date: Tue, 11 Jul 2023 16:23:35 +0200 Subject: [PATCH 17/27] add main of farm data test --- IOT/Capteur/src/main.cpp | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/IOT/Capteur/src/main.cpp b/IOT/Capteur/src/main.cpp index 74bf5a7..840ade5 100644 --- a/IOT/Capteur/src/main.cpp +++ b/IOT/Capteur/src/main.cpp @@ -1,11 +1,40 @@ -#include "Program.h" +#include +// #include +#include +#include +// FARM DATA RELAY SYSTEM +// +// LoRa Sensor Example +// +// Developed by Timm Bogner (timmbogner@gmail.com) in Urbana, Illinois, USA. +// An example of how to send data via LoRa using FDRS. +// -Program* program; +// #include "fdrs_node_config.h" +#include +#include + +float readTemp() { + return 21.0; +} + +float readHum() { + return random(0,100); +} + + + +float data1; +float data2; void setup() { - program = new Program(); + beginFDRS(); } - void loop() { - program->loop(); + data1 = readHum(); + loadFDRS(data1, HUMIDITY_T); + data2 = readTemp(); + loadFDRS(data2, TEMP_T); + sendFDRS(); + sleepFDRS(10); //Sleep time in seconds } From b454c04c4814d9f1d4ee476809551cd556a792b2 Mon Sep 17 00:00:00 2001 From: Clement Date: Tue, 11 Jul 2023 16:24:04 +0200 Subject: [PATCH 18/27] ex lora lib backup --- IOT/receiver LoRa/include/boards.h | 70 +++++++++ IOT/receiver LoRa/include/utilities.h | 195 ++++++++++++++++++++++++++ 2 files changed, 265 insertions(+) create mode 100644 IOT/receiver LoRa/include/boards.h create mode 100644 IOT/receiver LoRa/include/utilities.h diff --git a/IOT/receiver LoRa/include/boards.h b/IOT/receiver LoRa/include/boards.h new file mode 100644 index 0000000..75fd8db --- /dev/null +++ b/IOT/receiver LoRa/include/boards.h @@ -0,0 +1,70 @@ +#include +#include +#include +//#include "utilities.h" + +#ifdef HAS_DISPLAY +#include + +#ifndef DISPLAY_MODEL +#define DISPLAY_MODEL U8G2_SSD1306_128X64_NONAME_F_HW_I2C +#endif + +DISPLAY_MODEL *u8g2; +#endif + +#ifndef OLED_WIRE_PORT +#define OLED_WIRE_PORT Wire +#endif + +SPIClass SDSPI(HSPI); + + +void initBoard() +{ + Serial.begin(115200); + Serial.println("initBoard"); + SPI.begin(RADIO_SCLK_PIN, RADIO_MISO_PIN, RADIO_MOSI_PIN); + Wire.begin(I2C_SDA, I2C_SCL); + +#ifdef HAS_DISPLAY + Wire.beginTransmission(0x3C); + if (Wire.endTransmission() == 0) { + Serial.println("Started OLED"); + u8g2 = new DISPLAY_MODEL(U8G2_R0, U8X8_PIN_NONE); + u8g2->begin(); + u8g2->clearBuffer(); + u8g2->setFlipMode(0); + u8g2->setFontMode(1); // Transparent + u8g2->setDrawColor(1); + u8g2->setFontDirection(0); + u8g2->firstPage(); + do { + u8g2->setFont(u8g2_font_inb19_mr); + u8g2->drawStr(0, 30, "LilyGo"); + u8g2->drawHLine(2, 35, 47); + u8g2->drawHLine(3, 36, 47); + u8g2->drawVLine(45, 32, 12); + u8g2->drawVLine(46, 33, 12); + u8g2->setFont(u8g2_font_inb19_mf); + u8g2->drawStr(58, 60, "LoRa"); + } while ( u8g2->nextPage() ); + u8g2->sendBuffer(); + u8g2->setFont(u8g2_font_fur11_tf); + delay(3000); + } +#endif + + +#ifdef HAS_DISPLAY + if (u8g2) { + u8g2->clearBuffer(); + do { + u8g2->setCursor(0, 16); + u8g2->println( "Waiting to receive data");; + } while ( u8g2->nextPage() ); + } +#endif + +} + diff --git a/IOT/receiver LoRa/include/utilities.h b/IOT/receiver LoRa/include/utilities.h new file mode 100644 index 0000000..deb0968 --- /dev/null +++ b/IOT/receiver LoRa/include/utilities.h @@ -0,0 +1,195 @@ + +#pragma once + +/* +* arduinoLoRa Library just only support SX1276/Sx1278,Not support SX1262 +* RadioLib Library supports also SX1262/SX1268 see https://github.com/Xinyuan-LilyGO/LilyGo-LoRa-Series/tree/master/examples/RadioLibExamples +* */ +// #define LILYGO_TBeam_V0_7 +// #define LILYGO_TBeam_V1_X +// #define LILYGO_T3_V1_0 +#define LILYGO_T3_V1_3 +// #define LILYGO_T3_V1_6 +// #define LILYGO_T3_V2_0 +// #define LILYGO_T95_V1_0 + +/* +* if you need to change it, +* please open this note and change to the frequency you need to test +* Option: 433E6,470E6,868E6,915E6 +* */ + +#define LoRa_frequency 433E6 + + +#define UNUSE_PIN (0) + +#if defined(LILYGO_TBeam_V0_7) +#define GPS_RX_PIN 12 +#define GPS_TX_PIN 15 +#define BUTTON_PIN 39 +#define BUTTON_PIN_MASK GPIO_SEL_39 +#define I2C_SDA 21 +#define I2C_SCL 22 + +#define RADIO_SCLK_PIN 5 +#define RADIO_MISO_PIN 19 +#define RADIO_MOSI_PIN 27 +#define RADIO_CS_PIN 18 +#define RADIO_DIO0_PIN 26 +#define RADIO_RST_PIN 23 +#define RADIO_DIO1_PIN 33 +#define RADIO_BUSY_PIN 32 + +#define BOARD_LED 14 +#define LED_ON HIGH +#define LED_OFF LOW + +#define GPS_BAUD_RATE 9600 +#define HAS_GPS +#define HAS_DISPLAY //Optional, bring your own board, no OLED !! + +#elif defined(LILYGO_TBeam_V1_X) + +#define GPS_RX_PIN 34 +#define GPS_TX_PIN 12 +#define BUTTON_PIN 38 +#define BUTTON_PIN_MASK GPIO_SEL_38 +#define I2C_SDA 21 +#define I2C_SCL 22 +#define PMU_IRQ 35 + +#define RADIO_SCLK_PIN 5 +#define RADIO_MISO_PIN 19 +#define RADIO_MOSI_PIN 27 +#define RADIO_CS_PIN 18 +#define RADIO_DIO0_PIN 26 +#define RADIO_RST_PIN 23 +#define RADIO_DIO1_PIN 33 +#define RADIO_BUSY_PIN 32 + +#define BOARD_LED 4 +#define LED_ON LOW +#define LED_OFF HIGH + +#define GPS_BAUD_RATE 9600 +#define HAS_GPS +#define HAS_DISPLAY //Optional, bring your own board, no OLED !! + +#elif defined(LILYGO_T3_V1_0) +#define I2C_SDA 4 +#define I2C_SCL 15 +#define OLED_RST 16 + +#define RADIO_SCLK_PIN 5 +#define RADIO_MISO_PIN 19 +#define RADIO_MOSI_PIN 27 +#define RADIO_CS_PIN 18 +#define RADIO_DIO0_PIN 26 +#define RADIO_RST_PIN 14 +#define RADIO_DIO1_PIN 33 +#define RADIO_BUSY_PIN 32 + +#define HAS_DISPLAY + +#elif defined(LILYGO_T3_V1_3) + +#define I2C_SDA 21 +#define I2C_SCL 22 +#define OLED_RST UNUSE_PIN + +#define RADIO_SCLK_PIN 5 +#define RADIO_MISO_PIN 19 +#define RADIO_MOSI_PIN 27 +#define RADIO_CS_PIN 18 +#define RADIO_DIO0_PIN 26 +#define RADIO_RST_PIN 14 +#define RADIO_DIO1_PIN 33 +#define RADIO_BUSY_PIN 32 + +#define ADC_PIN 35 + +#define HAS_DISPLAY + +#elif defined(LILYGO_T3_V1_6) +#define I2C_SDA 21 +#define I2C_SCL 22 +#define OLED_RST UNUSE_PIN + +#define RADIO_SCLK_PIN 5 +#define RADIO_MISO_PIN 19 +#define RADIO_MOSI_PIN 27 +#define RADIO_CS_PIN 18 +#define RADIO_DIO0_PIN 26 +#define RADIO_RST_PIN 23 +#define RADIO_DIO1_PIN 33 +#define RADIO_BUSY_PIN 32 + +#define SDCARD_MOSI 15 +#define SDCARD_MISO 2 +#define SDCARD_SCLK 14 +#define SDCARD_CS 13 + +#define BOARD_LED 25 +#define LED_ON HIGH + +#define ADC_PIN 35 + +#define HAS_SDCARD +#define HAS_DISPLAY + +#elif defined(LILYGO_T3_V2_0) +#define I2C_SDA 21 +#define I2C_SCL 22 +#define OLED_RST UNUSE_PIN + +#define RADIO_SCLK_PIN 5 +#define RADIO_MISO_PIN 19 +#define RADIO_MOSI_PIN 27 +#define RADIO_CS_PIN 18 +#define RADIO_DIO0_PIN 26 +#define RADIO_RST_PIN 14 +#define RADIO_DIO1_PIN UNUSE_PIN +#define RADIO_BUSY_PIN UNUSE_PIN + +#define SDCARD_MOSI 15 +#define SDCARD_MISO 2 +#define SDCARD_SCLK 14 +#define SDCARD_CS 13 + +#define BOARD_LED 0 +#define LED_ON LOW + +#define HAS_DISPLAY +#define HAS_SDCARD + +#elif defined(LILYGO_T95_V1_0) + +#define I2C_SDA 21 +#define I2C_SCL 22 +#define OLED_RST UNUSE_PIN + +#define RADIO_SCLK_PIN 18 +#define RADIO_MISO_PIN 19 +#define RADIO_MOSI_PIN 23 +#define RADIO_CS_PIN 5 +#define RADIO_DIO0_PIN 26 +#define RADIO_RST_PIN 4 +#define RADIO_DIO1_PIN 33 +#define RADIO_DIO2_PIN 32 +#define RADIO_BUSY_PIN UNUSE_PIN + +#define ADC_PIN 35 +#define HAS_DISPLAY + +#else +#error "For the first use, please define the board version and model in " +#endif + + + + + + + + From 1d1b20e5c32a8597c751f30ec2f8774c01c34c97 Mon Sep 17 00:00:00 2001 From: Clement Date: Mon, 17 Jul 2023 17:09:50 +0200 Subject: [PATCH 19/27] add SD support for capteur --- IOT/Capteur/.vscode/settings.json | 11 ++++++- IOT/Capteur/config.ini | 6 +++- IOT/Capteur/src/main.cpp | 52 +++++++++++++++++++++---------- 3 files changed, 51 insertions(+), 18 deletions(-) diff --git a/IOT/Capteur/.vscode/settings.json b/IOT/Capteur/.vscode/settings.json index d01027a..19b7dc3 100644 --- a/IOT/Capteur/.vscode/settings.json +++ b/IOT/Capteur/.vscode/settings.json @@ -1,6 +1,15 @@ { "files.associations": { "*.html": "html", - "cmath": "cpp" + "cmath": "cpp", + "array": "cpp", + "deque": "cpp", + "list": "cpp", + "string": "cpp", + "unordered_map": "cpp", + "vector": "cpp", + "string_view": "cpp", + "initializer_list": "cpp", + "ranges": "cpp" } } \ No newline at end of file diff --git a/IOT/Capteur/config.ini b/IOT/Capteur/config.ini index 8a78241..6fa26b2 100644 --- a/IOT/Capteur/config.ini +++ b/IOT/Capteur/config.ini @@ -65,4 +65,8 @@ build_flags = -D LORA_SPI_MISO=G_MISO -D LORA_SPI_MOSI=G_MOSI - -D LORA_FREQUENCY=433 \ No newline at end of file + -D LORA_FREQUENCY=433 + + -D USE_SD_LOG + -D SD_SS=SD_CS + -D LOG_FILENAME=\"log_capteur_01.txt\" \ No newline at end of file diff --git a/IOT/Capteur/src/main.cpp b/IOT/Capteur/src/main.cpp index 840ade5..967dae4 100644 --- a/IOT/Capteur/src/main.cpp +++ b/IOT/Capteur/src/main.cpp @@ -2,17 +2,9 @@ // #include #include #include -// FARM DATA RELAY SYSTEM -// -// LoRa Sensor Example -// -// Developed by Timm Bogner (timmbogner@gmail.com) in Urbana, Illinois, USA. -// An example of how to send data via LoRa using FDRS. -// - -// #include "fdrs_node_config.h" #include #include +#include float readTemp() { return 21.0; @@ -28,13 +20,41 @@ float data1; float data2; void setup() { - beginFDRS(); + beginFDRS(); + if (!SD.begin(SD_CS)) { + Serial.println("Fail, verifier que la carte SD est presente."); + return; + } } + void loop() { - data1 = readHum(); - loadFDRS(data1, HUMIDITY_T); - data2 = readTemp(); - loadFDRS(data2, TEMP_T); - sendFDRS(); - sleepFDRS(10); //Sleep time in seconds + data1 = readHum(); + loadFDRS(data1, HUMIDITY_T); + data2 = readTemp(); + loadFDRS(data2, TEMP_T); + sendFDRS(); + + File dataFile = SD.open(LOG_FILENAME, FILE_WRITE); + if (dataFile) { + DBG("SD OK"); + dataFile.print("[{\"id\":"); + dataFile.print(READING_ID); + dataFile.print(",\"type\":"); + dataFile.print(HUMIDITY_T); + dataFile.print(",\"data\":"); + dataFile.print(data1); + dataFile.print("},{\"id\":"); + dataFile.print(READING_ID); + dataFile.print(",\"type\":"); + dataFile.print(TEMP_T); + dataFile.print(",\"data\":"); + dataFile.print(data2); + dataFile.println("}]"); + dataFile.close(); + }else{ + DBG("SD fail"); + } + + // [{"id":2,"type":3,"data":66},{"id":2,"type":1,"data":21}] + sleepFDRS(10); //Sleep time in seconds } From 4f8cca9b61a0cc8534a0f419cf75f670959692f2 Mon Sep 17 00:00:00 2001 From: Clement Date: Mon, 17 Jul 2023 18:12:10 +0200 Subject: [PATCH 20/27] add real capteur value --- IOT/Capteur/src/main.cpp | 60 ++++++++++++++++++++++++++++++---------- 1 file changed, 46 insertions(+), 14 deletions(-) diff --git a/IOT/Capteur/src/main.cpp b/IOT/Capteur/src/main.cpp index 967dae4..79903bf 100644 --- a/IOT/Capteur/src/main.cpp +++ b/IOT/Capteur/src/main.cpp @@ -5,22 +5,17 @@ #include #include #include +#include +#include -float readTemp() { - return 21.0; -} +DHT dht(DHT_PIN, DHT_TYPE);// pour capteur dht11 humi/temp +SFE_BMP180 pressure;// pour capteur BMP180 pression/temp -float readHum() { - return random(0,100); -} - - - -float data1; -float data2; void setup() { beginFDRS(); + dht.begin(); + pressure.begin(); if (!SD.begin(SD_CS)) { Serial.println("Fail, verifier que la carte SD est presente."); return; @@ -28,10 +23,35 @@ void setup() { } void loop() { - data1 = readHum(); + + // mesure DHT11 + float data1 = dht.readHumidity(); + float data2 = dht.readTemperature(); + + if (isnan(data1) || isnan(data2)) { + DBG("Failed to read from DHT sensor!"); + return; + } + + // mesure BMP180 + double data3; + double data4; + + char status = pressure.startTemperature(); + + if (status != 0){ + delay(status); + status = pressure.getPressure(data3,data4); + } + if(status == 0){ + DBG("failed to read BMP sensor!") + return; + } + loadFDRS(data1, HUMIDITY_T); - data2 = readTemp(); loadFDRS(data2, TEMP_T); + loadFDRS(data3, PRESSURE_T); + loadFDRS(data4, TEMP2_T); sendFDRS(); File dataFile = SD.open(LOG_FILENAME, FILE_WRITE); @@ -49,12 +69,24 @@ void loop() { dataFile.print(TEMP_T); dataFile.print(",\"data\":"); dataFile.print(data2); + dataFile.print("},{\"id\":"); + dataFile.print(READING_ID); + dataFile.print(",\"type\":"); + dataFile.print(PRESSURE_T); + dataFile.print(",\"data\":"); + dataFile.print(data3); + dataFile.print("},{\"id\":"); + dataFile.print(READING_ID); + dataFile.print(",\"type\":"); + dataFile.print(TEMP2_T); + dataFile.print(",\"data\":"); + dataFile.print(data4); dataFile.println("}]"); dataFile.close(); }else{ DBG("SD fail"); } - // [{"id":2,"type":3,"data":66},{"id":2,"type":1,"data":21}] + // [{"id":2,"type":3,"data":66},{"id":2,"type":1,"data":21},{"id":2,"type":1,"data":21},{"id":2,"type":1,"data":21}] sleepFDRS(10); //Sleep time in seconds } From 08bdbd3d1a2081a0db43c44fe13a323ce7a7073b Mon Sep 17 00:00:00 2001 From: Clement Date: Mon, 17 Jul 2023 18:24:18 +0200 Subject: [PATCH 21/27] rm capteur temp qui dit de la merde --- IOT/Capteur/src/main.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/IOT/Capteur/src/main.cpp b/IOT/Capteur/src/main.cpp index 79903bf..574b465 100644 --- a/IOT/Capteur/src/main.cpp +++ b/IOT/Capteur/src/main.cpp @@ -51,7 +51,6 @@ void loop() { loadFDRS(data1, HUMIDITY_T); loadFDRS(data2, TEMP_T); loadFDRS(data3, PRESSURE_T); - loadFDRS(data4, TEMP2_T); sendFDRS(); File dataFile = SD.open(LOG_FILENAME, FILE_WRITE); @@ -75,18 +74,10 @@ void loop() { dataFile.print(PRESSURE_T); dataFile.print(",\"data\":"); dataFile.print(data3); - dataFile.print("},{\"id\":"); - dataFile.print(READING_ID); - dataFile.print(",\"type\":"); - dataFile.print(TEMP2_T); - dataFile.print(",\"data\":"); - dataFile.print(data4); dataFile.println("}]"); dataFile.close(); }else{ DBG("SD fail"); } - - // [{"id":2,"type":3,"data":66},{"id":2,"type":1,"data":21},{"id":2,"type":1,"data":21},{"id":2,"type":1,"data":21}] sleepFDRS(10); //Sleep time in seconds } From 7aab4db279921e5f39a8cad10766710618d63e2e Mon Sep 17 00:00:00 2001 From: Clement Date: Mon, 17 Jul 2023 18:27:28 +0200 Subject: [PATCH 22/27] rm debug --- IOT/Capteur/config.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IOT/Capteur/config.ini b/IOT/Capteur/config.ini index 6fa26b2..2d8c20d 100644 --- a/IOT/Capteur/config.ini +++ b/IOT/Capteur/config.ini @@ -35,8 +35,8 @@ build_flags = ; FARM DATA RELAY SYSTEM ; Sensor Configuration - -D FDRS_DEBUG ; allow FARM DATA serial debuging - -D RADIOLIB_DEBUG ; allow Radio serial debuging + ;-D FDRS_DEBUG ; allow FARM DATA serial debuging + ;-D RADIOLIB_DEBUG ; allow Radio serial debuging ; sensor ID -D READING_ID=2 From 2824c4da048d3fa1e6175fc155ec8476c697e643 Mon Sep 17 00:00:00 2001 From: Clement Date: Mon, 17 Jul 2023 18:30:27 +0200 Subject: [PATCH 23/27] typo --- IOT/Capteur/src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IOT/Capteur/src/main.cpp b/IOT/Capteur/src/main.cpp index 574b465..f244b32 100644 --- a/IOT/Capteur/src/main.cpp +++ b/IOT/Capteur/src/main.cpp @@ -74,7 +74,7 @@ void loop() { dataFile.print(PRESSURE_T); dataFile.print(",\"data\":"); dataFile.print(data3); - dataFile.println("}]"); + dataFile.println("}],"); dataFile.close(); }else{ DBG("SD fail"); From 95f252768f5b6725bb640feb11e3f9f15f7a664c Mon Sep 17 00:00:00 2001 From: Clement Date: Tue, 18 Jul 2023 10:29:52 +0200 Subject: [PATCH 24/27] gatway WIP --- IOT/receiver LoRa/config.ini | 59 ++++++++ IOT/receiver LoRa/include/Program.h | 22 --- IOT/receiver LoRa/include/boards.h | 70 --------- IOT/receiver LoRa/include/utilities.h | 195 -------------------------- IOT/receiver LoRa/platformio.ini | 5 +- IOT/receiver LoRa/src/Program.cpp | 22 --- IOT/receiver LoRa/src/main.cpp | 125 +++-------------- 7 files changed, 79 insertions(+), 419 deletions(-) delete mode 100644 IOT/receiver LoRa/include/Program.h delete mode 100644 IOT/receiver LoRa/include/boards.h delete mode 100644 IOT/receiver LoRa/include/utilities.h delete mode 100644 IOT/receiver LoRa/src/Program.cpp diff --git a/IOT/receiver LoRa/config.ini b/IOT/receiver LoRa/config.ini index 7ba9ac2..da67e06 100644 --- a/IOT/receiver LoRa/config.ini +++ b/IOT/receiver LoRa/config.ini @@ -14,6 +14,65 @@ build_flags = -D MONITOR_SPEED=${config.monitor_speed} ; DO NOT TOUCH --- END +;;; FDRS config + + -D FDRS_DEBUG ; Enable USB-Serial debugging + + + +; Addresses + -D UNIT_MAC=0x01 + -D ESPNOW_NEIGHBOR_1=0x00 + -D ESPNOW_NEIGHBOR_2=0x02 + -D LORA_NEIGHBOR_1=0x00 + -D LORA_NEIGHBOR_2=0x03 + +; Interfaces +; -D USE_ESPNOW + -D USE_LORA +; -D USE_WIFI +; -D USE_ETHERNET + +; Routing is in main.cpp + +; LoRa Configuration + -D RADIOLIB_MODULE=SX1276 + -D LORA_SS=18 + -D LORA_RST=14 + -D LORA_DIO=26 + -D LORA_BUSY=RADIOLIB_NC +; -D USE_SX126X + + -D LORA_TXPWR=17 ; LoRa TX power in dBm (: +2dBm - +17dBm (for SX1276-7) +20dBm (for SX1278)) + + -D CUSTOM_SPI + -D LORA_SPI_SCK=5 + -D LORA_SPI_MISO=19 + -D LORA_SPI_MOSI=27 + + -D LORA_FREQUENCY=433.0 + + +; OLED -- Displays console debugging messages on an SSD1306 I²C OLED +; -D USE_OLED + -D OLED_HEADER=\"FDRS\" + -D OLED_PAGE_SECS=30 + -D OLED_SDA=4 + -D OLED_SCL=15 + -D OLED_RST=16 + +; UART data interface pins (if available) + -D RXD2=13 + -D TXD2=12 + + +; -D USE_LR ; Use ESP-NOW LR mode (ESP32 only) + +; WiFi Credentials +; -D WIFI_SSID=\"Your SSID\" +; -D WIFI_PASS=\"Your Password\" + + ; LoRa pinout -D RADIO_MOSI_PIN=27 -D RADIO_MISO_PIN=19 diff --git a/IOT/receiver LoRa/include/Program.h b/IOT/receiver LoRa/include/Program.h deleted file mode 100644 index c840657..0000000 --- a/IOT/receiver LoRa/include/Program.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef PROGRAM_H -#define PROGRAM_H - -#include -#include -#include -#include - -class Program { -public: - /** - * Program startup - */ - Program(); - - /** - * Program main loop - */ - void loop(); -}; - -#endif diff --git a/IOT/receiver LoRa/include/boards.h b/IOT/receiver LoRa/include/boards.h deleted file mode 100644 index 75fd8db..0000000 --- a/IOT/receiver LoRa/include/boards.h +++ /dev/null @@ -1,70 +0,0 @@ -#include -#include -#include -//#include "utilities.h" - -#ifdef HAS_DISPLAY -#include - -#ifndef DISPLAY_MODEL -#define DISPLAY_MODEL U8G2_SSD1306_128X64_NONAME_F_HW_I2C -#endif - -DISPLAY_MODEL *u8g2; -#endif - -#ifndef OLED_WIRE_PORT -#define OLED_WIRE_PORT Wire -#endif - -SPIClass SDSPI(HSPI); - - -void initBoard() -{ - Serial.begin(115200); - Serial.println("initBoard"); - SPI.begin(RADIO_SCLK_PIN, RADIO_MISO_PIN, RADIO_MOSI_PIN); - Wire.begin(I2C_SDA, I2C_SCL); - -#ifdef HAS_DISPLAY - Wire.beginTransmission(0x3C); - if (Wire.endTransmission() == 0) { - Serial.println("Started OLED"); - u8g2 = new DISPLAY_MODEL(U8G2_R0, U8X8_PIN_NONE); - u8g2->begin(); - u8g2->clearBuffer(); - u8g2->setFlipMode(0); - u8g2->setFontMode(1); // Transparent - u8g2->setDrawColor(1); - u8g2->setFontDirection(0); - u8g2->firstPage(); - do { - u8g2->setFont(u8g2_font_inb19_mr); - u8g2->drawStr(0, 30, "LilyGo"); - u8g2->drawHLine(2, 35, 47); - u8g2->drawHLine(3, 36, 47); - u8g2->drawVLine(45, 32, 12); - u8g2->drawVLine(46, 33, 12); - u8g2->setFont(u8g2_font_inb19_mf); - u8g2->drawStr(58, 60, "LoRa"); - } while ( u8g2->nextPage() ); - u8g2->sendBuffer(); - u8g2->setFont(u8g2_font_fur11_tf); - delay(3000); - } -#endif - - -#ifdef HAS_DISPLAY - if (u8g2) { - u8g2->clearBuffer(); - do { - u8g2->setCursor(0, 16); - u8g2->println( "Waiting to receive data");; - } while ( u8g2->nextPage() ); - } -#endif - -} - diff --git a/IOT/receiver LoRa/include/utilities.h b/IOT/receiver LoRa/include/utilities.h deleted file mode 100644 index deb0968..0000000 --- a/IOT/receiver LoRa/include/utilities.h +++ /dev/null @@ -1,195 +0,0 @@ - -#pragma once - -/* -* arduinoLoRa Library just only support SX1276/Sx1278,Not support SX1262 -* RadioLib Library supports also SX1262/SX1268 see https://github.com/Xinyuan-LilyGO/LilyGo-LoRa-Series/tree/master/examples/RadioLibExamples -* */ -// #define LILYGO_TBeam_V0_7 -// #define LILYGO_TBeam_V1_X -// #define LILYGO_T3_V1_0 -#define LILYGO_T3_V1_3 -// #define LILYGO_T3_V1_6 -// #define LILYGO_T3_V2_0 -// #define LILYGO_T95_V1_0 - -/* -* if you need to change it, -* please open this note and change to the frequency you need to test -* Option: 433E6,470E6,868E6,915E6 -* */ - -#define LoRa_frequency 433E6 - - -#define UNUSE_PIN (0) - -#if defined(LILYGO_TBeam_V0_7) -#define GPS_RX_PIN 12 -#define GPS_TX_PIN 15 -#define BUTTON_PIN 39 -#define BUTTON_PIN_MASK GPIO_SEL_39 -#define I2C_SDA 21 -#define I2C_SCL 22 - -#define RADIO_SCLK_PIN 5 -#define RADIO_MISO_PIN 19 -#define RADIO_MOSI_PIN 27 -#define RADIO_CS_PIN 18 -#define RADIO_DIO0_PIN 26 -#define RADIO_RST_PIN 23 -#define RADIO_DIO1_PIN 33 -#define RADIO_BUSY_PIN 32 - -#define BOARD_LED 14 -#define LED_ON HIGH -#define LED_OFF LOW - -#define GPS_BAUD_RATE 9600 -#define HAS_GPS -#define HAS_DISPLAY //Optional, bring your own board, no OLED !! - -#elif defined(LILYGO_TBeam_V1_X) - -#define GPS_RX_PIN 34 -#define GPS_TX_PIN 12 -#define BUTTON_PIN 38 -#define BUTTON_PIN_MASK GPIO_SEL_38 -#define I2C_SDA 21 -#define I2C_SCL 22 -#define PMU_IRQ 35 - -#define RADIO_SCLK_PIN 5 -#define RADIO_MISO_PIN 19 -#define RADIO_MOSI_PIN 27 -#define RADIO_CS_PIN 18 -#define RADIO_DIO0_PIN 26 -#define RADIO_RST_PIN 23 -#define RADIO_DIO1_PIN 33 -#define RADIO_BUSY_PIN 32 - -#define BOARD_LED 4 -#define LED_ON LOW -#define LED_OFF HIGH - -#define GPS_BAUD_RATE 9600 -#define HAS_GPS -#define HAS_DISPLAY //Optional, bring your own board, no OLED !! - -#elif defined(LILYGO_T3_V1_0) -#define I2C_SDA 4 -#define I2C_SCL 15 -#define OLED_RST 16 - -#define RADIO_SCLK_PIN 5 -#define RADIO_MISO_PIN 19 -#define RADIO_MOSI_PIN 27 -#define RADIO_CS_PIN 18 -#define RADIO_DIO0_PIN 26 -#define RADIO_RST_PIN 14 -#define RADIO_DIO1_PIN 33 -#define RADIO_BUSY_PIN 32 - -#define HAS_DISPLAY - -#elif defined(LILYGO_T3_V1_3) - -#define I2C_SDA 21 -#define I2C_SCL 22 -#define OLED_RST UNUSE_PIN - -#define RADIO_SCLK_PIN 5 -#define RADIO_MISO_PIN 19 -#define RADIO_MOSI_PIN 27 -#define RADIO_CS_PIN 18 -#define RADIO_DIO0_PIN 26 -#define RADIO_RST_PIN 14 -#define RADIO_DIO1_PIN 33 -#define RADIO_BUSY_PIN 32 - -#define ADC_PIN 35 - -#define HAS_DISPLAY - -#elif defined(LILYGO_T3_V1_6) -#define I2C_SDA 21 -#define I2C_SCL 22 -#define OLED_RST UNUSE_PIN - -#define RADIO_SCLK_PIN 5 -#define RADIO_MISO_PIN 19 -#define RADIO_MOSI_PIN 27 -#define RADIO_CS_PIN 18 -#define RADIO_DIO0_PIN 26 -#define RADIO_RST_PIN 23 -#define RADIO_DIO1_PIN 33 -#define RADIO_BUSY_PIN 32 - -#define SDCARD_MOSI 15 -#define SDCARD_MISO 2 -#define SDCARD_SCLK 14 -#define SDCARD_CS 13 - -#define BOARD_LED 25 -#define LED_ON HIGH - -#define ADC_PIN 35 - -#define HAS_SDCARD -#define HAS_DISPLAY - -#elif defined(LILYGO_T3_V2_0) -#define I2C_SDA 21 -#define I2C_SCL 22 -#define OLED_RST UNUSE_PIN - -#define RADIO_SCLK_PIN 5 -#define RADIO_MISO_PIN 19 -#define RADIO_MOSI_PIN 27 -#define RADIO_CS_PIN 18 -#define RADIO_DIO0_PIN 26 -#define RADIO_RST_PIN 14 -#define RADIO_DIO1_PIN UNUSE_PIN -#define RADIO_BUSY_PIN UNUSE_PIN - -#define SDCARD_MOSI 15 -#define SDCARD_MISO 2 -#define SDCARD_SCLK 14 -#define SDCARD_CS 13 - -#define BOARD_LED 0 -#define LED_ON LOW - -#define HAS_DISPLAY -#define HAS_SDCARD - -#elif defined(LILYGO_T95_V1_0) - -#define I2C_SDA 21 -#define I2C_SCL 22 -#define OLED_RST UNUSE_PIN - -#define RADIO_SCLK_PIN 18 -#define RADIO_MISO_PIN 19 -#define RADIO_MOSI_PIN 23 -#define RADIO_CS_PIN 5 -#define RADIO_DIO0_PIN 26 -#define RADIO_RST_PIN 4 -#define RADIO_DIO1_PIN 33 -#define RADIO_DIO2_PIN 32 -#define RADIO_BUSY_PIN UNUSE_PIN - -#define ADC_PIN 35 -#define HAS_DISPLAY - -#else -#error "For the first use, please define the board version and model in " -#endif - - - - - - - - diff --git a/IOT/receiver LoRa/platformio.ini b/IOT/receiver LoRa/platformio.ini index 0aa4ecc..a8d99e9 100644 --- a/IOT/receiver LoRa/platformio.ini +++ b/IOT/receiver LoRa/platformio.ini @@ -52,8 +52,9 @@ upload_speed = 921600 lib_deps = ; example: ; erropix/ESP32 AnalogWrite@0.2 - sandeepmistry/LoRa@^0.8.0 ;LoRa lib - olikraus/U8g2@^2.34.22 ;Oled Lib + https://github.com/timmbogner/Farm-Data-Relay-System.git ;lib for global system architecture + jgromes/RadioLib@^6.1.0 ;lib for comunication + ; Checker settings check_tool = clangtidy, cppcheck diff --git a/IOT/receiver LoRa/src/Program.cpp b/IOT/receiver LoRa/src/Program.cpp deleted file mode 100644 index 82ff6d8..0000000 --- a/IOT/receiver LoRa/src/Program.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include "Program.h" - -Program::Program() { - // Startup - Serial.begin(MONITOR_SPEED); - Serial.println("initBoard"); - SPI.begin(RADIO_SCLK_PIN, RADIO_MISO_PIN, RADIO_MOSI_PIN); //for LoRa module - Wire.begin(I2C_SDA, I2C_SCL);//for oled screen - // When the power is turned on, a delay is required. - delay(1500); - - //init LoRa - LoRa.setPins(RADIO_CS_PIN, RADIO_RST_PIN, RADIO_DIO0_PIN); - if (!LoRa.begin(LoRa_frequency)) { - Serial.println("Starting LoRa failed!"); - while (1); - } -} - -void Program::loop() { - // Loop -} diff --git a/IOT/receiver LoRa/src/main.cpp b/IOT/receiver LoRa/src/main.cpp index 70fe082..a2da022 100644 --- a/IOT/receiver LoRa/src/main.cpp +++ b/IOT/receiver LoRa/src/main.cpp @@ -1,115 +1,24 @@ -// #include "Program.h" - -// Program* program; - -// void setup() { -// program = new Program(); -// } - -// void loop() { -// program->loop(); -// } - - -#include -#include "boards.h" +// FARM DATA RELAY SYSTEM +// +// GATEWAY 2.000 +// +// Developed by Timm Bogner (timmbogner@gmail.com) in Urbana, Illinois, USA. +// #include +#include +#include -void setup() -{ - initBoard(); - // When the power is turned on, a delay is required. - delay(1500); +// Routing +// Options: sendESPNowNbr(1 or 2); sendESPNowPeers(); sendLoRaNbr(1 or 2); broadcastLoRa(); sendSerial(); sendMQTT(); +#define ESPNOWG_ACT sendSerial(); +#define LORAG_ACT sendSerial(); - Serial.println("LoRa Receiver"); - LoRa.setPins(RADIO_CS_PIN, RADIO_RST_PIN, RADIO_DIO0_PIN); - if (!LoRa.begin(LoRa_frequency)) { - Serial.println("Starting LoRa failed!"); - while (1); - } +void setup() { +beginFDRS(); } -void loop() -{ - // try to parse packet - int packetSize = LoRa.parsePacket(); - if (packetSize) { - // received a packet - Serial.print("Received packet '"); - - String recv = ""; - // read packet - while (LoRa.available()) { - recv += (char)LoRa.read(); - } - - Serial.println(recv); - - // print RSSI of packet - Serial.print("' with RSSI "); - Serial.println(LoRa.packetRssi()); -#ifdef HAS_DISPLAY - if (u8g2) { - u8g2->clearBuffer(); - char buf[256]; - u8g2->drawStr(0, 12, "Received OK!"); - u8g2->drawStr(0, 26, recv.c_str()); - snprintf(buf, sizeof(buf), "RSSI:%i", LoRa.packetRssi()); - u8g2->drawStr(0, 40, buf); - snprintf(buf, sizeof(buf), "SNR:%.1f", LoRa.packetSnr()); - u8g2->drawStr(0, 56, buf); - u8g2->sendBuffer(); - } -#endif - } -} - - - -// #define HAS_DISPLAY - -// #include -// #include "boards.h" - -// int counter = 0; - -// void setup() -// { -// initBoard(); -// // When the power is turned on, a delay is required. -// delay(1500); - -// Serial.println("LoRa Sender"); -// LoRa.setPins(RADIO_CS_PIN, RADIO_RST_PIN, RADIO_DIO0_PIN); -// if (!LoRa.begin(LoRa_frequency)) { -// Serial.println("Starting LoRa failed!"); -// while (1); -// } -// } - -// void loop() -// { -// Serial.print("Sending packet: "); -// Serial.println(counter); - -// // send packet -// LoRa.beginPacket(); -// LoRa.print("hello "); -// LoRa.print(counter); -// LoRa.endPacket(); - -// #ifdef HAS_DISPLAY -// if (u8g2) { -// char buf[256]; -// u8g2->clearBuffer(); -// u8g2->drawStr(0, 12, "Transmitting: OK!"); -// snprintf(buf, sizeof(buf), "Sending: %d", counter); -// u8g2->drawStr(0, 30, buf); -// u8g2->sendBuffer(); -// } -// #endif -// counter++; -// delay(10000); -// } +void loop() { +loopFDRS(); +} \ No newline at end of file From 60c06d65e2184b3733f491b3707f706fb1293cb8 Mon Sep 17 00:00:00 2001 From: Clement Date: Tue, 18 Jul 2023 14:50:18 +0200 Subject: [PATCH 25/27] rm debug --- IOT/receiver LoRa/config.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IOT/receiver LoRa/config.ini b/IOT/receiver LoRa/config.ini index da67e06..fe4f51a 100644 --- a/IOT/receiver LoRa/config.ini +++ b/IOT/receiver LoRa/config.ini @@ -16,7 +16,7 @@ build_flags = ;;; FDRS config - -D FDRS_DEBUG ; Enable USB-Serial debugging +; -D FDRS_DEBUG ; Enable USB-Serial debugging From 7fa775546629bc0eb4ba548543f905377f7f5cd4 Mon Sep 17 00:00:00 2001 From: Clement Date: Tue, 18 Jul 2023 14:50:58 +0200 Subject: [PATCH 26/27] rm useless config --- IOT/receiver LoRa/src/main.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/IOT/receiver LoRa/src/main.cpp b/IOT/receiver LoRa/src/main.cpp index a2da022..36d2d44 100644 --- a/IOT/receiver LoRa/src/main.cpp +++ b/IOT/receiver LoRa/src/main.cpp @@ -8,13 +8,6 @@ #include #include #include - -// Routing -// Options: sendESPNowNbr(1 or 2); sendESPNowPeers(); sendLoRaNbr(1 or 2); broadcastLoRa(); sendSerial(); sendMQTT(); -#define ESPNOWG_ACT sendSerial(); -#define LORAG_ACT sendSerial(); - - void setup() { beginFDRS(); } From bf9e6c3ebee0a2cb1c7d1dccef8700062fb8ffb8 Mon Sep 17 00:00:00 2001 From: Clement Date: Tue, 18 Jul 2023 15:08:58 +0200 Subject: [PATCH 27/27] add docs --- IOT/archi global.puml | 39 +++++++++++++++++++++++++++++++++++++++ chiffrage IOT.xlsx | Bin 0 -> 9469 bytes 2 files changed, 39 insertions(+) create mode 100644 IOT/archi global.puml create mode 100644 chiffrage IOT.xlsx diff --git a/IOT/archi global.puml b/IOT/archi global.puml new file mode 100644 index 0000000..0159af6 --- /dev/null +++ b/IOT/archi global.puml @@ -0,0 +1,39 @@ +@startuml +cloud { + [Serveur de donnée] +} + +database "infrastructure vigneron" { + [gateway principale] + + [relay] as R + + [station météo1] as SM1 + [station météo2] as SM2 + [station météo...] as SMX + + + circle "capteur sol" as CS1 + circle "capteur sol" as CS2 + circle "capteur sol" as CS3 + circle "capteur sol" as CS4 + circle "capteur sol" as CS5 + circle "capteur sol" as CS6 + + SM1 <.. CS1 : LORA (or espNow) + SM1 <.. CS2 + SM1 <.. CS3 + R <.. SM1 + R <.. CS6 + SM2 <.. CS4 + SM2 <.. CS5 +} + +[Serveur de donnée] <-- [gateway principale] : WiFi (api) +[gateway principale] <.. SM1 : LORA (or espNow) +[gateway principale] <.. SM2 : LORA (or espNow) +[gateway principale] <.. SMX : LORA (or espNow) +[gateway principale] <.. R + + +@enduml \ No newline at end of file diff --git a/chiffrage IOT.xlsx b/chiffrage IOT.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..682707b1362957637d7b16257433029095f2c56a GIT binary patch literal 9469 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 literal 0 HcmV?d00001