Closed Ajb2k3 closed 1 year ago
did you use the mac address for the publish topic?
No because my server uses home_sensor_data for its topic That a Core2, CM4 and M5Paper use for communication.
This is my config.h file
#ifndef _ATOM_PRINTER_CONFIG_H
#define _ATOM_PRINTER_CONFIG_H
#define DNS_PORT 53
#define BMP_BUFFER_LIMIT 1024 * 50
#define MQTT_BROKER "192.168.0.44"
#define MQTT_PORT 1883
#define MQTT_ID "printer"
#define MQTT_USER "AdamBryant"
#define MQTT_PASSPWD "**********"
#define MQTT_TOPIC "home_sensor_data"
typedef enum {
kInit = 0,
kWiFiConnected,
kWiFiDisconnected,
kMQTTConnected,
kMQTTDisconnected,
} Atom_Printer_State_t;
#endif
refer to this part. if you have not set the mqtt info by the web page. it will use the mac addr for sub-topic. so you could modify this part directly
https://github.com/m5stack/ATOM-PRINTER/blob/master/examples/PRINTER_FW/ATOM_PRINTER_MQTT.cpp#L27
I changed it on the page and the config file, will try that line next.
yes, that is our mistake. it actually does not use the config file define. we will update it later
OK, so how do I fix this line?
already update. now you could use the config file to setting the topic
nope, still defaulting to the MAC address
I changed the line to:
if (mqtt_topic == "") {
mqtt_topic = ("_mqtt_topic" + String(random(65536)));
}
it briefly worked in the serial console then reset back to default.
ok. updated
Thanks, its now connecting to the MQTT topic but not retrieving messages from the server.