ModBus with LowPower consumption

pylon:

void loop()

{
  // display information about the counter
  Serial.print("Awake for ");
  Serial.print(count);
  Serial.println("sec");
  count++;
  delay(1000);                           // waits for a second

// compute the serial input
  if (Serial.available()) {
    int val = Serial.read();
    if (val == 'S') {




You want to do ModBus communication and use the same serial interface to send commands like "go to sleep* or print debugging messages. Do you really think this can work? How should the SCADA system distinguish between ModBus traffic and your other serial stuff?

That serial part was just for testing.

The main goal is to use the serial port just to connect to the scada through modbus and everytime it receives data in the serial port wake up the arduino to answer.

But it keeps giving me erros in the scada ...

Thanks