Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
ressources:odroid_n2 [2023/06/14 17:05] – [Premier capteur weather board] jeff | ressources:odroid_n2 [2024/02/08 17:20] (Version actuelle) – modification externe 127.0.0.1 | ||
---|---|---|---|
Ligne 151: | Ligne 151: | ||
de https:// | de https:// | ||
Connexion sur 1-3V 2->SDA 3->SDC 9->GND | Connexion sur 1-3V 2->SDA 3->SDC 9->GND | ||
+ | |||
+ | – Sensors : BME280, Si1132 | ||
< | < | ||
Ligne 183: | Ligne 185: | ||
</ | </ | ||
+ | <code c> | ||
+ | |||
+ | </ | ||
+ | import os | ||
+ | import time | ||
+ | from paho.mqtt import client as mqtt_client | ||
+ | |||
+ | cputemp = float(os.popen(' | ||
+ | 1000 | ||
+ | broker_address = " | ||
+ | broker_port = 1883 | ||
+ | topicbase = " | ||
+ | client_id = " | ||
+ | username = ' | ||
+ | password = ' | ||
+ | |||
+ | client = mqtt_client.Client(client_id) | ||
+ | client.username_pw_set(username, | ||
+ | client.connect(broker_address, | ||
+ | |||
+ | topic = topicbase + "/ | ||
+ | client.publish(topic, | ||
+ | time.sleep(1) | ||
+ | |||
===== Machine sonore ===== | ===== Machine sonore ===== | ||
Serveur son : Jack2 \\ | Serveur son : Jack2 \\ |