Compare commits
No commits in common. "a22e6373cfd0364a830860c58ed9bf456ca2f69b" and "723b6ce9f597fcaf53a9e7e24f44459cf70d9972" have entirely different histories.
a22e6373cf
...
723b6ce9f5
@ -3,7 +3,7 @@ const mqtt = require('mqtt');
|
||||
const fs = require('fs');
|
||||
|
||||
// Lecture du fichier de configuration
|
||||
const config = JSON.parse(fs.readFileSync('\services\\config\\config_network.json', 'utf8'));
|
||||
const config = JSON.parse(fs.readFileSync('\services\\config\\config.json', 'utf8'));
|
||||
|
||||
// Extraction des informations de config
|
||||
const { hosts: { buzzers: { IP: buzzerIPs, MQTTconfig: { mqttHost, mqttTopic } } } } = config;
|
||||
|
@ -217,15 +217,6 @@ client.on('message', (topic, message) => {
|
||||
|
||||
});
|
||||
|
||||
(async () => {
|
||||
while (true) {
|
||||
console.log("Boucle en arrière-plan");
|
||||
|
||||
await new Promise((resolve) => setTimeout(resolve, 2000)); // Pause de 2 secondes
|
||||
client.publish(mqttScoreTopic, JSON.stringify(global.jsonData));
|
||||
}
|
||||
})();
|
||||
|
||||
client.on('error', (error) => {
|
||||
console.error('Erreur de connexion au broker MQTT:', error.message);
|
||||
});
|
||||
|
@ -2,28 +2,28 @@
|
||||
"TEAM": {
|
||||
"Red": {
|
||||
"Name": "XXX",
|
||||
"TotalScore": 22,
|
||||
"TotalScore": 195,
|
||||
"RoundScore": 0,
|
||||
"Penality": 0,
|
||||
"MasterPoint": 0
|
||||
},
|
||||
"Blue": {
|
||||
"Name": "XXX",
|
||||
"TotalScore": 63,
|
||||
"TotalScore": 25,
|
||||
"RoundScore": 0,
|
||||
"Penality": 0,
|
||||
"MasterPoint": 0
|
||||
},
|
||||
"Yellow": {
|
||||
"Name": "XXX",
|
||||
"TotalScore": 26,
|
||||
"TotalScore": 10,
|
||||
"RoundScore": 0,
|
||||
"Penality": 0,
|
||||
"MasterPoint": 0
|
||||
},
|
||||
"Green": {
|
||||
"Name": "XXX",
|
||||
"TotalScore": 15,
|
||||
"TotalScore": 11,
|
||||
"RoundScore": 0,
|
||||
"Penality": 0,
|
||||
"MasterPoint": 0
|
||||
|
Loading…
Reference in New Issue
Block a user