Question for 100 points
.
I have the ESP32 connected to the Arduino MEGA (as it should be, via the 3v - 5v logic, because without this bidolka the ESP started to heat up) and I send from the cell (BT Serial Terminal) a command (such my macro) under the button
? Relay, 109, 1 !
The command is parsed, all great, means - turn on all relays. On ESP32 (serial.monitor) and Xiaomi (BT monitor) I get the feedback: enabled:
Relay no. 1 ON
Relay no. 2 ON
Relay 3 ON
Relay 4 ON
Relay 5 ON
Relay 6 ON
Relay 7 ON
Relay 8 ON
The mega as instructed turns on all relays, only there is one but .... why does it show me on its SERIAL MONITOR:
a command from the ESP has arrived: I am switching on relay no. 1
a command from the ESP has arrived: I am switching on relay 2
ESP Incoming command: switching on relay 3
ESP Incoming ESP command: switching on relay 4
ESP Incoming command: switching on relay 5
6,7,8 does not exist --- but turns on. Macros from Xiaomi turn on 6,turn off 6, 7 or 8 is OK. But when I get 8 strings (in a loop with ESP) to display after 5 it stops showing it. It doesn't bother me but I like to speculate, buffer overflow ? or what ?
what is going on ? The function in MEGA Relay_Report is executed for all the relays (1-8) just why does the Relay_Report function after 5 calls not show for 6, 7, 8 ?

I have the ESP32 connected to the Arduino MEGA (as it should be, via the 3v - 5v logic, because without this bidolka the ESP started to heat up) and I send from the cell (BT Serial Terminal) a command (such my macro) under the button
? Relay, 109, 1 !
The command is parsed, all great, means - turn on all relays. On ESP32 (serial.monitor) and Xiaomi (BT monitor) I get the feedback: enabled:
Relay no. 1 ON
Relay no. 2 ON
Relay 3 ON
Relay 4 ON
Relay 5 ON
Relay 6 ON
Relay 7 ON
Relay 8 ON
The mega as instructed turns on all relays, only there is one but .... why does it show me on its SERIAL MONITOR:
a command from the ESP has arrived: I am switching on relay no. 1
a command from the ESP has arrived: I am switching on relay 2
ESP Incoming command: switching on relay 3
ESP Incoming ESP command: switching on relay 4
ESP Incoming command: switching on relay 5
6,7,8 does not exist --- but turns on. Macros from Xiaomi turn on 6,turn off 6, 7 or 8 is OK. But when I get 8 strings (in a loop with ESP) to display after 5 it stops showing it. It doesn't bother me but I like to speculate, buffer overflow ? or what ?
what is going on ? The function in MEGA Relay_Report is executed for all the relays (1-8) just why does the Relay_Report function after 5 calls not show for 6, 7, 8 ?
// ---------------------------------------------------------------------------------------------- //
// --- R E L A Y S W I T C H ------------------------------------------------------------------ // <- Przekaznik (SWITCH)
// ---------------------------------------------------------------------------------------------- //
//
void Przekaznik_Przelacz( int p, bool stan) //
{ //
switch ( stan ) //
{ //
case 0 : P[p].turnOff(); PrzekaznikStan[p] = P[p].getState(); break; //
case 1 : P[p].turnOn(); PrzekaznikStan[p] = P[p].getState(); break; //
} //
Przekaznik_Raport(p); //
} //
//
// ---------------------------------------------------------------------------------------------- //
// --- R E L A Y S W I T C H ------------------------------------------------------------------ // <- Przekaznik (RAPORT)
// ---------------------------------------------------------------------------------------------- //
//
void Przekaznik_Raport(int p) //
{ //
#if Terminal //
Serial.print(F("Stan przekaźnika nr : ")); //
Serial.print(p); //
if ( PrzekaznikStan[p] ) Serial.println(F(" ON ")); //
else //
if (!PrzekaznikStan[p] ) Serial.println(F(" OFF ")); //
#endif //
}