From 65134cf73bf8c6ad5dc6b632efe4e78f978e1731 Mon Sep 17 00:00:00 2001 From: Lukian Date: Thu, 23 Jan 2025 16:24:47 +0100 Subject: [PATCH] added an mqtt config file to change password and client name --- .gitignore | 1 + mqtt_config.lua.example | 2 ++ player/letter_display.lua | 8 ++++++-- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .gitignore create mode 100644 mqtt_config.lua.example diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..36a6a82 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +mqtt_config.lua \ No newline at end of file diff --git a/mqtt_config.lua.example b/mqtt_config.lua.example new file mode 100644 index 0000000..cf4507c --- /dev/null +++ b/mqtt_config.lua.example @@ -0,0 +1,2 @@ +password="" +client_name="" diff --git a/player/letter_display.lua b/player/letter_display.lua index bcccb3d..7ae89b5 100644 --- a/player/letter_display.lua +++ b/player/letter_display.lua @@ -1,8 +1,12 @@ dofile("screen.lua") attachscreen(18, 19, 0x3C) -client = mqtt.client("Player", "mqtt.leizour.fr", 8883, true) -client:connect("student", "O99Rq8$F12NXzhL5caya") +dofile("mqtt_config.lua") + +client = mqtt.client(client_name, "mqtt.leizour.fr", 8883, true) +client:connect("student", password) +client:publish("pendu/gamestate", "query", mqtt.QOS0) + -- CLK (clock) : D15 -- DT (data) : D2 -- SW (Bouton): D4