Init v1.0

This commit is contained in:
2023-04-30 20:16:33 +02:00
parent 69ed0d5e65
commit 048198ccbe
15 changed files with 923 additions and 58 deletions
Regular → Executable
+215 -58
View File
@@ -1,92 +1,249 @@
# Banc-ECS-Diehl
# Banc ECS Diehl
Banc d'enregistrement des mesures faites avec un "[Compteur Energie Thermique DIEHL SHARKY 774 compact](https://www.compteur-energie.com/compteur-energie-thermique-clim-sharky-775.htm)" (Diehl - SHARKY 774 BI)
Ce banc est plus qu'inspiré du [banc-tempsurf-ds18b20](https://gitlab.lowtech.fr/pdm/projets/labo/pub/banc-tempsurf-ds18b20/) lui même plus qu'inspiré de [PvMonit](https://pvmonit.zici.fr/)
## Getting started
* [Mode d'emploi](doc/Mode d'emploi banc ECS.pdf) pour ce banc ECS Diehl
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
## Pré-requis
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
* Un raspberry pi (0 ici mais un 2, 3, 4 fonctionnera) avec :
* [Raspbian](https://raspberry-pi.fr/telechargements/) installé
* Interface 1 Wire active (raspi-config) pour les sondes ds18b20
* Interface SPI active (raspi-config) pour les amplificateurs thermocouples
* [Compteur Energie Thermique DIEHL SHARKY 774 compact](https://www.compteur-energie.com/compteur-energie-thermique-clim-sharky-775.htm)"
* [M-Bus Master Hat](https://www.packom.net/m-bus-master-hat/) (pour la communication entre le raspberry pi et le compteur d'énergie)
## Add your files
## Carte SD prêt à l'emploi
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
Une carte SD prêt à l'emploi [contactez nous](https://www.afpma.pro/contacts/).
```
cd existing_repo
git remote add origin https://gitlab.afpma.pro/tech/labomobile/banc-ecs-diehl.git
git branch -M main
git push -uf origin main
La notice pour l'usage de cette carte SD est dans le fichier **[doc/Deployer_image_carte_SD.md](doc/Deployer_image_carte_SD.md)**
## Sinon : installation
### Dépendance
```bash
apt install python3 python3-pip
```
## Integrate with your tools
Lib Python ds18b20 : https://github.com/rgbkrk/ds18b20
- [ ] [Set up project integrations](https://gitlab.afpma.pro/tech/labomobile/banc-ecs-diehl/-/settings/integrations)
```bash
pip3 install ds18b20 ConfigParser
```
## Collaborate with your team
Lib Python pour thermocouple MAX31855 : https://github.com/adafruit/Adafruit_CircuitPython_MAX31855
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
```bash
pip3 install adafruit-circuitpython-max31855
```
## Test and Deploy
### Récupération des sources
Use the built-in continuous integration in GitLab.
Récupération du code source :
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
```bash
cd /opt/
git clone https://gitlab.lowtech.fr/pdm/projets/labo/bancs-acqusition/banc-mesure-temp-surface-DS18B20.git
cd banc-mesure-temp-surface-DS18B20
```
***
### Installation de l'interface web (option)
# Editing this README
Option pratique pour les "non geek"
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
![doc/screenshot-interface.png](README.assets/screenshot-interface.png "Screenshot")
## Suggestions for a good README
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
Rendre le fichier de configuration accessible en écriture pour l'interface web :
## Name
Choose a self-explaining name for your project.
```bash
chmod 777 /opt/banc/config.ini
chmod 777 /opt/banc/releves -R
# ou
chown www-data:www-data /opt/banc/config.ini
chown www-data:www-data /opt/banc/releves -R
```
## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
Installation des dépendances :
## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
```
aptitude install lighttpd php-cgi php-xml php7.3-json
lighttpd-enable-mod fastcgi
lighttpd-enable-mod fastcgi-php
```
## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
On change la configuration de lighttpd :
## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
```
service lighttpd stop
```
## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
Configuration du serveur http, avec le fichier /etc/lighttpd/lighttpd.conf :
## Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
```diff
- server.document-root = "/var/www/html/"
+ server.document-root = "/opt/banc/"
```
## Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.
On applique la configuration :
## Contributing
State if you are open to contributions and what your requirements are for accepting them.
```
service lighttpd start
```
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
Télécharger la dernière version de [ttyd](https://github.com/tsl0922/ttyd/releases) (pour un raspberry pi c'est la version ARM) pour la placer dans le /opt :
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
```bash
wget -O /opt/ttyd https://github.com/tsl0922/ttyd/releases/download/1.7.2/ttyd.arm
chmod +x /opt/ttyd
```
## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.
Dans le fichier rc.local il faut ensuite ajouter le ttyd au démarrage du raspberry pi. Ajouter ceci avant "exit 0" :
## License
For open source projects, say how it is licensed.
```
/opt/ttyd -p 8022 /opt/banc/start-menu.sh > /tmp/ttyd.log 2>/tmp/ttyd-error.log &
```
## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
C'est prêt, rdv sur http://IPdeVotrePi ou http://pi.local
## Configuration
Toute la configuration se trouve dans le fichier config.ini
### Général
Configuration général dans le fichier config.ini :
```ini
[general]
# Répertoire de stockage des relevés (en csv)
csv_dir="releves"
# Temps entre 2 mesures (en minute)
delai=5
# Nombre de messure
nb_mesure=500
# Note : la durée du test est donc = delai * nb_mesure
```
## Test des sondes
Des scripts de tests se trouve dans le répertoire "tools" vous pouvez lancer :
* ds18b20-list.sh : pour lister les sondes avec leur ID + affichage de la température
* test-max31855.py : pour tester la présence de thermocouple (attention il faut éditer le script et le code n'est plus identique à celui de lacquisition, a prendre donc avec de la distance...)
## Lancement de lacquisition
### Depuis l'interface web
/!\ il y a certaine difficulté sur Firefox, vous pouvez essayer sur Chromium ou Chrome si la mention "press < to reconnect" persiste...
Choix 1
Pour stopper : CTRL + C
### En ligne de commande
Pour lancer lacquisition :
```
python3 aquisition.py
```
On peut stopper lacquisition par un CTRL + C au besoin
Les résultats (sauf modification) sont à récupérer dans le dossier "releves"
Exemple :
```
#############################################################################
######## Banc de test / Aquisition des mesures
#############################################################################
La configuration (config.ini) détermine :
* que le fichier csv de relevé est : releves/2021-02-15_11-26.csv
* qu'il y aura 500 messures
* que l'interval entre 2 mesures sera de 5 minutes
Le script d'aquisition est donc partie pour tourner 41.666666666666664 heures
Messure N° 0
"tparoi 1" = 20.1
t1 = 31.937
t2 = 29.312
"Vitre" = 33.0
t4 = 30.187
t5 = 27.375
t6 = 30.125
t7 = 32.0
t8 = 29.562
t9 = 30.187
t10 = 31.312
t11 = 29.375
t12 = 28.875
t13 = 30.187
t14 = 27.062
t15 = 30.0
t16 = 31.375
t17 = 30.375
t18 = 31.125
t19 = 28.562
t20 = 29.687
"Plancha" = 33.75
"Foyer" = 45.75
"Evac" = 32.75
"tparoi 2" = 19.9
"tair" = 20.4
Fin de la mesure, on patiente 300 s
-
```
Vous devriez obtenir un fichier CSV de ce type :
> "temps_min",0,5
>
> "temps_sec",0,319
>
> "tparoi 1",20.1,20.1
>
> "t1",31.937,31.812
>
> "t2",29.312,29.187
>
> "t3",33.0,33.0
>
> "t4",30.187,30.062
>
> "t5",27.375,27.25
>
> "t6",30.125,30.062
>
> "t7",32.0,31.937
>
> "t8",29.562,29.437
>
> "t9",30.187,30.125
>
> "t10",31.312,31.187
>
> "t11",29.375,29.312
>
> "t12",28.875,28.812
>
> "t13",30.187,30.062
>
> ...
## Auteur
Association [AFPMA](https://www.afpma.pro/)
* [David Mercereau](https://david.mercereau.info/contact/) pour la partie développement logiciel
* Damien Lehman pour la conception, test, documentation
## Licence AGPL v3
https://www.gnu.org/licenses/agpl-3.0.fr.htmlgnouse