Maker Pro
Maker Pro

Project help!! Arduino issue

I am doing a project on farm monitoring.
It involves a network of zigbee routers (currently 2 routers). each with 3 sensor attached.
The coordinator is receiving i/o packets from these router, as checked on xctu.

I wanted to mount the coordinator on arduino, so that I can view packets received on serial monitor.
But I am not able to upload the code onto the board. It is getting compiled successfuly .

It shows issues /error messages like "com port busy" or "board can't be accessed" or some sync issue.

Both arduino and zigbee are at 9600 baud rate.

The code I wrote was:

void setup()
{ Serial.begin(9600);
}
void loop()
{
if(Serial.available()>=21)
{
for(int i=0;i<22;i++)
{
Serial.print(Serial.read,HEX);

/* I tried replacing this line with Serial.print(Serial.read());*/
/* I also tried
byte now= Serial.read();
Serial.print(now,BYTE);
*/
}
}
}

The connections I made were:

arunio vcc --> xbee vcc
arduino gnd --> xbee gnd
arduino tx -->xbee rx
arduino rx -->xbee tx

Please suggest what can be done to solve this issue.
 

Harald Kapp

Moderator
Moderator
Try uploading the code without the coordinator attached (bare Arduino). When succesfull, remove the connection to the PC and re-attach the coordinator. I think I rmember that the Arduino cannot serve both serial ports simultaneously.
 
Top