Cannot read data from XBee S1
Hi,
I have QuickStart Board with XBee S1 (+ XBee Explorer Regulated) that receives commands from PC with XBee S1. The problem is I can send data from QuickStart board but cannot receive anything back, while PC client transmits and receives everything correctly.
Connections of QuickStartBoard and XBee S1:
Any suggestions?
Thanks.
I have QuickStart Board with XBee S1 (+ XBee Explorer Regulated) that receives commands from PC with XBee S1. The problem is I can send data from QuickStart board but cannot receive anything back, while PC client transmits and receives everything correctly.
Connections of QuickStartBoard and XBee S1:
- P27 <-> DOUT
- P28 <-> DIN
#include <stdio.h>
#include <stdlib.h>
#include <propeller.h>
int main() {
char cmd;
FILE* xbee_dev = fopen("SSER:9600, 28, 27", "r+");
setvbuf(xbee_dev, NULL, _IONBF, 0); // no buffering
xbee_dev->_flag &= ~_IOCOOKED;
waitcnt(50*(CLKFREQ/1000)+CNT);
fputs("OK", xbee_dev);
while (1) {
if ((cmd = fgetc(xbee_dev)) > 0) {
printf("Echo: %d\n", cmd);
}
}
fclose(xbee_dev);
return 0;
}
Any suggestions?
Thanks.
Comments