Z1 motes - 基站和传感节点之间的通信

Z1 motes - Communication between a base station and sensing node

过去几天我一直在尝试通过基站访问各个节点,但我一直不走运。我在基站 (unicast-receiver.c) 和传感节点 (unicast-sender.c)

上尝试了以下操作

首先,我尝试在单播发送方上创建一个 RPL dag,并使用

从单播接收方跟踪它
address= servreg_hack_lookup(SERVICE_ID_1)

然后是

simple_udp_sendto(&unicast_connection, msg.value, 1, address) 

但它给了我一个完全不同的地址,而不是传感节点的地址,因此它没有用。

无论如何,我试图删除 RPL dag,但后来我找不到硬编码传感节点地址的方法。

如果我至少可以硬编码传感节点的地址并使用simple_udp_sendto(&unicast_connection, msg.value, 1, address) 函数与传感节点通信然后那可以工作,但是怎么做呢?

(编辑)我什至无法向远程 z1 节点发送一个字节,我认为仅获取地址不会有帮助,因为传感节点应该期待一些东西,如果我会发送它。但是在这种情况下我该如何发送呢?

唯一需要解决的问题是使用

获取节点地址
uip_ipaddr_t addr;
uip_ip6addr(&addr, 0xaaaa, 0, 0, 0, 0, 0, 0, 0); // or whatever is the values for your node 

然后使用任何简单的 udp 发送功能发送您的数据。

simple_udp_sendto_custom(&unicast_connection, msg.value, 1, &addr); // this is my own custom function, 
//but any other should do the same thing provided the address