Arduberry Sketch stops working after some time

Arduberry losses it’s sketch or miss-behaving after a day of running. It’s stop responding to my serial comm port communication program. The only way I am fixing this issue is by re-uploading my sketch again.

What causes the comm port failure? How to debug this issue?

Can you post the sketch here so that we can have a look. Also, can you tell us more how you are using the Serial port. Is it connected to a sensor or are you using a Serial Port monitor, and if so what .


#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

void setup() {


  // Transmitter is connected to Arduino Pin #10

  // Optional set pulse length.

  // Optional set protocol (default is 1, will work for most outlets)
  // mySwitch.setProtocol(2);

  // Optional set number of transmission repetitions.


void loop() {

//  Serial.println("hello");
 // delay(1000);

if (mySwitch.available()) {

    int value = mySwitch.getReceivedValue();

    if (value == 0) {
      Serial.println("Unknown encoding");
    } else {

      Serial.println( mySwitch.getReceivedValue() );
      Serial.println( mySwitch.getReceivedDelay());
      Serial.println( mySwitch.getReceivedBitlength() );



    long rfCmd;
    int pulse;
    int bits;
    pulse = Serial.parseInt();
    bits = Serial.parseInt();


//  delay(1000);


void sendRCSwitch(int pulse, long rfCmd,int bits){



I am using NoneJS to read the serial port data from the other end.

The Sketch looks fine. I don’t know exactly what’s going wrong. Can you double-check if serial login and serial boot messages are disabled:


I checked serial login and serial boot messages are disabled.

Power cycle and reboot doesn’t fix the problem. Only reloading the arduino sketch fixes it. Does it give us any clue ?

Sorry, but I cannot think of anything. Doesn’t resetting the Arduberry help? Does it work fine on a normal Arduino Uno?


I did some digging around. I found the arduino script fails when serial command is sent back to back without any delay. May be I should add delay/sleep in arduino script?

I think adding a delay might help. Usually, it takes sometime for the sensor to respond to the command and maybe when it’s processing the previous command, a new command comes and the sensor overlooks it, which might be causing the problem.

Do try the delay and let us know if it works.