Soft WDT reset

I use a sp. conection with cayenne is ok, but after sending the data, there is a reset of the soft.

data ok
[150030] Publish: topic 1, channel 1, value 21.000, subkey c, key temp
[150032] Publish: topic 1, channel 2, value 24.000, subkey c, key temp
[150033] Publish: topic 1, channel 3, value 361, subkey lux, key lum
[150038] Publish: topic 1, channel 4, value 0, subkey d, key digital_sensor

⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮
Soft WDT reset

stack>>>

which device you are using and can you share the code you have used?

hello, it’s a wemos mini pro
// This example shows how to connect to Cayenne using an ESP8266 and send/receive sample data.
// Make sure you install the ESP8266 Board Package via the Arduino IDE Board Manager and select the correct ESP8266 board before compiling.

#define CAYENNE_DEBUG
#define CAYENNE_PRINT Serial
#include <CayenneMQTTESP8266.h>
#include <stdio.h> 


float T_CUVE, T_SURF ;
int resistance_on;


char DONNE_SERIE_RX[20];
int bufferSize= 64 ;
int nbrecaractere =19;


// WiFi network info.
char ssid[] = "";
char wifiPassword[] = "";

// Cayenne authentication info. This should be obtained from the Cayenne Dashboard.



char username[] = "";
char password[] = "";
char clientID[] = "";

//boolean tempo = 1;

//**********////
#define VIRTUAL_CHANNEL1 1
#define VIRTUAL_CHANNEL2 2
#define VIRTUAL_CHANNEL3 3
#define VIRTUAL_CHANNEL4 4

char mychar;
  int i=0;
  int T_CUVE_100,T_SURF_100,LDR =0;
  String string1,string2,string3,string4;
 // int tempo =0;
  unsigned long int DELAIS = 0;

void setup() {
  Serial.begin(115200);
  Cayenne.begin(username, password, clientID, ssid, wifiPassword);
  Serial.print("WEMOS 11072019");
  
}

void loop() {

  Cayenne.loop();

   

    if(Serial.available()) {
      
      do {
      mychar = Serial.read(); // read char from UART 
      Serial.print(mychar);  //test
      }
      while ( mychar != '*');
     DONNE_SERIE_RX[i] = mychar;
      for (i=1; i<19 ; i++ ) {mychar= Serial.read();DONNE_SERIE_RX[i]=mychar;}  //18--> 16
    
    Serial.print (DONNE_SERIE_RX[0]);Serial.println (DONNE_SERIE_RX[17]);
     if ((DONNE_SERIE_RX[0] == '*') && (DONNE_SERIE_RX[17] =='#')) {  // verifie que les data sont corect 

      // sprintf(DONNE_SERIE, "*%04d;%04d;%04d;%1d#\r\n", t1,t2,ldr,resistance_on);

    Serial.println ( "data ok"); //test
    for (i=1; i < nbrecaractere; i++) {
    if ((char)DONNE_SERIE_RX[i]==';') {i++;break;}
     string1+=((char)DONNE_SERIE_RX[i]); }
  // Serial.println(string1); 
  for (i; i < nbrecaractere; i++) {
    if ((char)DONNE_SERIE_RX[i]==';') {i++;break;}
     string2+=((char)DONNE_SERIE_RX[i]);   }
  // Serial.println(string2);    
  for (i; i < nbrecaractere+1; i++) {
   if ((char)DONNE_SERIE_RX[i]==';') {i++;break;}
     string3+=((char)DONNE_SERIE_RX[i]);   }
  for (i; i < nbrecaractere+1; i++) {
   if ((char)DONNE_SERIE_RX[i]=='#') {i++;break;}
     string4+=((char)DONNE_SERIE_RX[i]);   }
 //  Serial.println(string3); 

      T_CUVE_100=(int)string1.toInt();
      T_CUVE =  float (T_CUVE_100/100);

      T_SURF_100=(int)string2.toInt();
      T_SURF = float( T_SURF_100/100);

      LDR=(int)string3.toInt();
      
      resistance_on=(int)string4.toInt();
     

     Cayenne.virtualWrite(1, T_CUVE,"temp","c");
     Cayenne.virtualWrite(2, T_SURF,"temp","c");
     Cayenne.virtualWrite(3, LDR, "lum" ,"lux");
     Cayenne.virtualWrite(4, resistance_on,"digital_sensor","d");
     //Serial.flush();
     
     }
if(Serial.available()) {
  
  do {
  mychar = Serial.read(); // read char from UART 
  Serial.print(mychar);  //test
  }
  while ( mychar != '*');
 DONNE_SERIE_RX[i] = mychar;
  for (i=1; i<19 ; i++ ) {mychar= Serial.read();DONNE_SERIE_RX[i]=mychar;}  //18--> 16

Serial.print (DONNE_SERIE_RX[0]);Serial.println (DONNE_SERIE_RX[17]);
 if ((DONNE_SERIE_RX[0] == '*') && (DONNE_SERIE_RX[17] =='#')) {  // verifie que les data sont corect 

  // sprintf(DONNE_SERIE, "*%04d;%04d;%04d;%1d#\r\n", t1,t2,ldr,resistance_on);

Serial.println ( "data ok"); //test
for (i=1; i < nbrecaractere; i++) {
if ((char)DONNE_SERIE_RX[i]==';') {i++;break;}
 string1+=((char)DONNE_SERIE_RX[i]); }
  // Serial.println(string1); 
  for (i; i < nbrecaractere; i++) {
if ((char)DONNE_SERIE_RX[i]==';') {i++;break;}
 string2+=((char)DONNE_SERIE_RX[i]);   }
  // Serial.println(string2);    
  for (i; i < nbrecaractere+1; i++) {
   if ((char)DONNE_SERIE_RX[i]==';') {i++;break;}
 string3+=((char)DONNE_SERIE_RX[i]);   }
  for (i; i < nbrecaractere+1; i++) {
   if ((char)DONNE_SERIE_RX[i]=='#') {i++;break;}
 string4+=((char)DONNE_SERIE_RX[i]);   }
 //  Serial.println(string3); 

  T_CUVE_100=(int)string1.toInt();
  T_CUVE =  float (T_CUVE_100/100);

  T_SURF_100=(int)string2.toInt();
  T_SURF = float( T_SURF_100/100);

  LDR=(int)string3.toInt();
  
  resistance_on=(int)string4.toInt();

what does this code do? can you comment it out and check if you have the same issue.

I collect data on the port serie, I process them and I transmit them in wifi

does this work for you without the cayenne code added?

Your problem is at while ( mychar != '*'); There’s no way to exit that while loop and the watchdog timer is being triggered and resetting the device.

1 Like

hello, I changed the code. it’s ok, there is no more reset. thank you


adam

      Leader




    July 12

Your problem is at while ( mychar != '*'); There’s no way to exit that while loop and the watchdog timer is being triggered and resetting the device.


Visit Topic or reply to this email to respond.


In Reply To


ricard97432

    July 12

I collect data on the port serie, I process them and I transmit them in wifi


Visit Topic or reply to this email to respond.

To unsubscribe from these emails, click here.

-------- Message original --------

2 Likes