arduino serial communication


I have an Arduino board and am trying to make it communicate with an Asus WL500GP-V2 router with Oleg firmware.

The code loaded on the board is:

byte ad,bd,as,bs;

void setup() { Serial.begin(115200); }

void loop() { while(1) { if (Serial.available() > 3) { ad =; bd =; as =; bs =; Serial.println(ad,DEC); Serial.println(bd,DEC); Serial.println(as,DEC); Serial.println(bs,DEC); } }


The router file I am accesing to communicate with the board is : /dev/usb/tts/0.

I am trying to send 4 charactes at a time , and then print them on the screen. With the serial monitor it works but on the router it doesn't. The same program on the arduino board but with only one byte sent works wery well.

Can you tell me what is my mistake?

Forgot to tell, for testing on the router side I am using the arduino-serial programm: