added an mqtt config file to change password and client name

This commit is contained in:
Lukian 2025-01-23 16:24:47 +01:00
parent 0c58cfe717
commit 65134cf73b
3 changed files with 9 additions and 2 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
mqtt_config.lua

2
mqtt_config.lua.example Normal file
View file

@ -0,0 +1,2 @@
password=""
client_name=""

View file

@ -1,8 +1,12 @@
dofile("screen.lua") dofile("screen.lua")
attachscreen(18, 19, 0x3C) attachscreen(18, 19, 0x3C)
client = mqtt.client("Player", "mqtt.leizour.fr", 8883, true) dofile("mqtt_config.lua")
client:connect("student", "O99Rq8$F12NXzhL5caya")
client = mqtt.client(client_name, "mqtt.leizour.fr", 8883, true)
client:connect("student", password)
client:publish("pendu/gamestate", "query", mqtt.QOS0)
-- CLK (clock) : D15 -- CLK (clock) : D15
-- DT (data) : D2 -- DT (data) : D2
-- SW (Bouton): D4 -- SW (Bouton): D4