Send UDP packet by Xbee

Hey guys,

I’m trying to send a UDP packet but the xbee module is not invoked.

I’m using a mbed lpc1768 board with a Xbee radio and the ‘ps’ output is the following:

ps

pid | name | state Q | pri | stack ( used) | base | current

  • | isr_stack | - - | - | 512 ( 336) | 0x100000c8 | 0x10000290

1 | idle | pending Q | 15 | 256 ( 128) | 0x1000050c | 0x1000058c

2 | main | running Q | 7 | 1536 ( 732) | 0x1000060c | 0x10000a7c

3 | pktdump | bl rx _ | 6 | 1536 ( 236) | 0x10001d58 | 0x1000226c

4 | 6lo | bl rx _ | 3 | 1024 ( 268) | 0x10002358 | 0x1000264c

5 | ipv6 | bl rx _ | 4 | 1024 ( 292) | 0x100015f0 | 0x100018cc

6 | udp | bl rx _ | 5 | 1024 ( 484) | 0x100028e4 | 0x10002bdc

7 | coap | bl mbox _ | 6 | 1024 ( 584) | 0x100011ec | 0x100013a4

8 | xbee | bl rx _ | 2 | 1024 ( 540) | 0x10000c6c | 0x10000f74

SUM | | | 8960 ( 3600)

When I try to send a UDP packet using ‘gnrc_netapi_dispatch_send(GNRC_NETTYPE_UDP, GNRC_NETREG_DEMUX_CTX_ALL, ip)’ the invoked pids are, by this order, 6 (udp) and 5 (ipv6). After this, the packet is not transmitted.

Note: Xbee module is working (it transmits information if called directly by UART).

Thanks in advance,

Tiago Carvalho

Hi Tiago,

can you tell us on which git revision you are on? There used to be a bug in xbee, pretty much as you described, but that should be fixed as of the latest release (and in current master).

Cheers, Martine

Hello Martine,

Thank you for your answer. Im on:

SHA-1: 993ed203b53cd5418257c97fecddc1802ff3c96b

  • Merge pull request #6947 from kaspar030/fix_NULL_zero_checks

From 4/21/2017

Is that xbee fix available at this point?

Cheers,

Tiago Carvalho

Hi,

Mh, curious, the bug of Xbee that I was thinking of shouldn’t have been in effect at this point, but regardless it might be a good idea to get to current master or the current release (2018.01), since the version you are using is almost a year old.

Cheers, Martine

Hi Martine,

It solved the issue! Thank you for your advice.

I’m now sending packets by Xbee.

Now I have the inverse problem: A UPD packet arrives on the other device and is properly decoded:

[xbee] isr: data available, waiting for read

[xbee] recv: reading size without dropping: 85

[xbee] recv: consuming packet: reading 85 byte

It contains the correct destination IPv6 address but nothing happens before the mentioned debugs. Did I miss any netdev configuration? I already have a running UDP server as described in the examples.

Thank you,

Tiago

Hello,

I noticed that the device sending the packet doesn’t use 6lowpan (DEBUG(“6lo: GNRC_NETDEV_MSG_TYPE_SND received\n”) doesn’t appear*)* but on the other device, when the message arrives and after decoding, the 6lo logic is called giving the following error:

[xbee] isr: data available, waiting for read

[xbee] recv: reading size without dropping: 69

[xbee] recv: consuming packet: reading 69 byte

[xbee-gnrc] recv: successfully parsed packet

6lo: GNRC_NETDEV_MSG_TYPE_RCV received

6lo: dispatch 0hx … is not supported

6lo: waiting for incoming message.

I’m trying to run 6lowpan but it seems that it is not executed on the sending side. Do I need extra configuration? I already have:

USEMODULE += gnrc_netdev_default

USEMODULE += auto_init_gnrc_netif

USEMODULE += gnrc_ipv6

USEMODULE += gnrc_sock_udp

USEMODULE += gnrc_udp

Thank you,

Tiago

Hi Tiago,

debug-fix.diff (571 Bytes)

Hi Martine,

It worked!

Using gnrc_ipv6_default is the trick here.

Thank you very much.

Cheers, Tiago