ajout d'un id unique pour le client mqtt
This commit is contained in:
parent
35df89cc8d
commit
ac71f58e0a
@ -114,7 +114,7 @@ void testConnectMQTT()
|
|||||||
{
|
{
|
||||||
while (!client.connected()) {
|
while (!client.connected()) {
|
||||||
Debug.print("Connexion au serveur MQTT... ");
|
Debug.print("Connexion au serveur MQTT... ");
|
||||||
if (client.connect("ESP8266Client", MQTT_USER, MQTT_PASS)) {
|
if (client.connect(MQTT_CLIENT, MQTT_USER, MQTT_PASS)) {
|
||||||
Debug.print("OK\nSend Current State");
|
Debug.print("OK\nSend Current State");
|
||||||
mqttSendState();
|
mqttSendState();
|
||||||
|
|
||||||
|
|||||||
@ -24,9 +24,9 @@ WiFiClient espClient;
|
|||||||
#define MQTT_USER "XXX"
|
#define MQTT_USER "XXX"
|
||||||
#define MQTT_PASS "XXX"
|
#define MQTT_PASS "XXX"
|
||||||
|
|
||||||
#define MQTT_CLIENT "sonoff_living"
|
#define MQTT_CLIENT "sonoff_entrance"
|
||||||
#define MQTT_COMMAND "sonoff_living/switch"
|
#define MQTT_COMMAND "sonoff_entrance/switch"
|
||||||
#define MQTT_STATE "sonoff_living/status"
|
#define MQTT_STATE "sonoff_entrance/status"
|
||||||
|
|
||||||
char message_buff[100];
|
char message_buff[100];
|
||||||
PubSubClient client(espClient);
|
PubSubClient client(espClient);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user