I am trying to send a message to dynamically created topic (mqtt).
but it is returning this error every time and it reboots.
E (32573) MQTT_CLIENT: mqtt_message_receive: transport_read() error: errno=128
E (32573) MQTT_CLIENT: mqtt_process_receive: mqtt_message_receive() returned -1
this is the code..
Code: Select all
if(strstr(dataf, "check")){
char *token=strtok(dataf,"check_");
char *topic;
topic = (char*)malloc( 50 * sizeof(char) );
strcpy(topic,"vi/ven/vi002/");
strcat(topic,token);
topic = realloc(topic,sizeof(topic) * sizeof(int));
msg_id = esp_mqtt_client_publish(client,topic, "Tr", 0, 1, 0);
}
regards,
richu