I bought a new Arduino Uno WIFI and want to use MQTT together with a Adafruit motor shield:
Everything looks fine...Wifi is working and motor control is working as well. But: Each time when I download the Sketch or disconnect/connect the DC-Power from Arduino I get 2 MQTT-Messages at startup. Tried also with this example here:
/*
File: MqttPub.ino
This example subscribes a MQTT channel and reads published data, then prints it
into the serial monitor. Please configure the MQTT server address via Uno WiFi
Web Panel. Topics are automatically created (or subscribed) via api calls into
the sketch. You can use a maximum of 3 topics.
Note: works only with Arduino Uno WiFi Developer Edition.
*/
void loop(){
CiaoData data = Ciao.read(CONNECTOR, TOPIC);
if (!data.isEmpty()){
const char* value = data.get(2);
Serial.println(value);
}
}
As soon as I download the sketch and open the serial monitor I see two times the message from "arduino/data" (without sending). At the end I want to control my boiler temperature with a stepper motor and it's not really usable with this initial moving.
Is this a bug or is there anything that I didn't understand? Something like a "restore" function from the mosquittto broker installed on Raspi?
I didn't configure something server-side.
Just installed mosquitto on raspi and sending from openHAB (MQTT Client) the message 1 or 2 to the topic "arduino/data"