Shop OBEX P1 Docs P2 Docs Learn Events
Cannot read data from XBee S1 — Parallax Forums

Cannot read data from XBee S1

d2rkd2rk Posts: 31
edited 2013-10-21 02:57 in Accessories
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:
  • 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

  • d2rkd2rk Posts: 31
    edited 2013-10-21 02:21
    I've tried the same scheme, but with DemoBoard and everything start working as it should (I was using pins P6 and P7). Any guesses why it doesn't work with QuickStart board?
  • d2rkd2rk Posts: 31
    edited 2013-10-21 02:57
    Sorry, my mistake. Just missed with J1 pins and actual propeller chip pins. Closed.
Sign In or Register to comment.