Nothing printed at Serial

134 views
Skip to first unread message

Paulo Renato Xavier da Silva

unread,
Sep 1, 2017, 7:20:36 PM9/1/17
to xbee-api

I'm using the example bellow and I don't get nothing printed at Serial. Any help?

The configuration of the lab is:

2 Arduino Uno
2 Xbee S2

If I use xbee.onResponse(printResponseCb, (uintptr_t)(Print*)&DebugSerial), I get the packet information printed via Serial

// Copyright 2015, Matthijs Kooijman <matt...@stdin.nl>
//
// Permission is hereby granted, free of charge, to anyone
// obtaining a copy of this document and accompanying files, to do
// whatever they want with them without any restriction, including, but
// not limited to, copying, modification and redistribution.
//
// NO WARRANTY OF ANY KIND IS PROVIDED.
//
//
// This example prints any received ZigBee radio packets to serial.

#include <XBee.h>
#include <Printers.h>
#include <AltSoftSerial.h>

XBeeWithCallbacks xbee;

AltSoftSerial SoftSerial;
#define DebugSerial Serial
#define XBeeSerial SoftSerial

void setup() {
  // Setup debug serial output
  DebugSerial.begin(115200);
  DebugSerial.println(F("Starting..."));

  // Setup XBee serial communication
  XBeeSerial.begin(9600);
  xbee.begin(XBeeSerial);
  delay(1);

  // Setup callbacks
  xbee.onZBRxResponse(processRxPacket);
}

void processRxPacket(ZBRxResponse& rx, uintptr_t) {
  DebugSerial.print(F("Received packet from "));
  printHex(DebugSerial, rx.getRemoteAddress64());
  DebugSerial.println();
  DebugSerial.print(F("Payload: "));
  DebugSerial.write(rx.getData(), rx.getDataLength());
  DebugSerial.println();
}

void loop() {
  // Check the serial port to see if there is a new packet available
  xbee.loop();
}

karnravee maneekhao

unread,
Sep 30, 2019, 9:01:55 AM9/30/19
to xbee-api
I have the same problem as you. How did you solved this problem.

เมื่อ วันเสาร์ที่ 2 กันยายน ค.ศ. 2017 6 นาฬิกา 20 นาที 36 วินาที UTC+7, Paulo Renato Xavier da Silva เขียนว่า:
Reply all
Reply to author
Forward
0 new messages