attie / libxbee3

A C/C++ library to aid the use of Digi XBee radios in API mode
GNU Lesser General Public License v3.0
68 stars 40 forks source link

Timeout with sample/xbee1/0.simple_at #28

Open bbbbbbboc opened 7 years ago

bbbbbbboc commented 7 years ago

Hi all, I keep getting this incorrect result when running the main.c in 0.simple_at tx:17 txRet:0 Although i knew someone else has asked this question, but i still can't figure out the solution that was provided, after i do XBEE_LOG_LEVEL=100 make run i get the result of LD_LIBRARY_PATH=../../../lib ./main 20#[xbee.c:160] xbee_vsetup() 0x16521f0: Created new libxbee instance @ 0x16521f0 6#[conn.c:530] _xbee_conNew() 0x16521f0: Created new 'Local AT' type connection @ 0x1657050 15#[thread.c:71] threadFunc() 0x16521f0: starting thread 0x1656ae0, function xbee_rx()... 15#[thread.c:71] threadFunc() 0x16521f0: starting thread 0x1656ca0, function xbee_rxHandler()... 15#[thread.c:71] threadFunc() 0x16521f0: starting thread 0x1656e60, function xbee_tx()... tx: -17 txRet: 0 6#[conn.c:1079] xbee_conEnd() 0x16521f0: Closed connection @ 0x1657050 20#[xbee.c:200] xbee_shutdown() 0x16521f0: Started shutdown procedure for libxbee instance @ 0x16521f0 15#[thread.c:71] threadFunc() !0x16521f0!: starting thread 0x1657050, function xbee_shutdownThread()... Can someone explain what is going wrong now? i have tried close or open flow control in config.mk but i still got this error.

attie commented 6 years ago

Hello,

A return value of -17 is XBEE_ETIMEOUT (see include/xbee.h).

This means that it's likely that your XBee module isn't talking back to the host correctly, or perhaps that the XBee module isn't even receiving the message in the first place. Double check the baud rate, hardware flow control configuration, and perhaps use minicom / TeraTerm to confirm communications first.

Attie

On 8 October 2017 at 02:05, knightcnbj notifications@github.com wrote:

Hi all, I keep getting this incorrect result when running the main.c in 0.simple_at tx:17 txRet:0 Although i knew someone else has asked this question, but i still can't figure out the solution that was provided, after i do XBEE_LOG_LEVEL=100 make run i get the result of LD_LIBRARY_PATH=../../../lib ./main 20#[xbee.c:160] xbee_vsetup() 0x16521f0: Created new libxbee instance @ 0x16521f0 6#[conn.c:530] _xbee_conNew() 0x16521f0: Created new 'Local AT' type connection @ 0x1657050 15#[thread.c:71] threadFunc() 0x16521f0: starting thread 0x1656ae0, function xbee_rx()... 15#[thread.c:71] threadFunc() 0x16521f0: starting thread 0x1656ca0, function xbee_rxHandler()... 15#[thread.c:71] threadFunc() 0x16521f0: starting thread 0x1656e60, function xbee_tx()... tx: -17 txRet: 0 6#[conn.c:1079] xbee_conEnd() 0x16521f0: Closed connection @ 0x1657050 20#[xbee.c:200] xbee_shutdown() 0x16521f0: Started shutdown procedure for libxbee instance @ 0x16521f0 15#[thread.c:71] threadFunc() !0x16521f0!: starting thread 0x1657050, function xbee_shutdownThread()... Can someone explain what is going wrong now? i have tried close or open flow control in config.mk but i still got this error.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/attie/libxbee3/issues/28, or mute the thread https://github.com/notifications/unsubscribe-auth/ACGAPyl2oPGV24GvKRwu9ryOcsysIxArks5sqB--gaJpZM4PxjSV .

attie commented 6 years ago

I'm going to close this issue if there is no activity.

Hitheshkaranth commented 6 years ago

@attie

I received a similar error and I could detect xbee using XCTU on usb to serial converter. Bother xbee base and remote are configured in API mode however Im not able to get it to transmit any data (the serial ports work fine as I have tested it with another usb to serial converter and have set similar baud rate which I used to communicate xbee device) based on your sample programs at /sample/xbeeZB/1.simple.at(using libxbee3) I did manage to run

  root@machinekit:/home/machinekit/libxbee3-master/sample/xbeeZB/1.simple_at# 
  XBEE_LOG_LEVEL=100 ./main
  20#[xbee.c:160] xbee_vsetup() 0x21128: Created new libxbee instance @ 0x21128
  6#[conn.c:530] _xbee_conNew() 0x21128: Created new 'Local AT' type connection @ 0x23a68
  15#[thread.c:71] threadFunc() 0x21128: starting thread 0x23968, function xbee_tx()...
  15#[thread.c:71] threadFunc() 0x21128: starting thread 0x23880, function xbee_rxHandler()...
  15#[thread.c:71] threadFunc() 0x21128: starting thread 0x23798, function xbee_rx()...
  tx: -17
  txRet: 0
  6#[conn.c:1079] xbee_conEnd() 0x21128: Closed connection @ 0x23a68
  20#[xbee.c:200] xbee_shutdown() 0x21128: Started shutdown procedure for libxbee instance @ 
  0x21128

where am I goin wrong? can you please help me with this?

attie commented 6 years ago

Is hardware flow control enabled in libxbee / XBee module? Do you have the lines connected?