Code: Untitled.c Select all
char str_data[5], str_topic[11];
char flag_topic[11] = {'t','o','d','e','v','/','f','l','a','g','s'};
char ref_topic[9] = {'t','o','d','e','v','/','r','e','f'};Code: Untitled.c Select all
char str_data[5], str_topic[11];
char flag_topic[11] = {'t','o','d','e','v','/','f','l','a','g','s'};
char ref_topic[9] = {'t','o','d','e','v','/','r','e','f'};This was the problem. I've replaced theJust guessing here, as I'm not that familiar with the mqtt code, but are you sure the topic and data are zero-terminated? If not, the strcpy will copy lots of bytes, overwriting lots of static data.
Code: Untitled.c Select all
strcpy(str_topic, event->topic);
strcpy(str_data, event->data);Code: Untitled.c Select all
strncpy(str_topic, event->topic, event->topic_len);
strncpy(str_data, event->data, event->data_len);Hi,You may want to investigate your power supply; sometimes these errors originate in a brownout.
Users browsing this forum: ChatGPT-User and 5 guests