This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

how to config the ble ipv6 link-local address?

I am studying the iot-sdk of nordic. Now, as I have shown in previous questions, I can not detect the device under the linux system according to the toturial in iot. Now, I am trying to config the ipv6 link-local address in windows system which I can flash the ble application. Anyone can give some advice about the testing example of iot-sdk udp of client?

here is the python Server example.

import socket
import struct
#This example assumes that the global IPv6 address 2004::02AA:BBFF:FECC:DDEE is available on one of the network interfaces.
SERVER_ADDR = 'fe80::02aa:aaff:feaa:aaaa'
UDP_PORT    = 0x1717
if __name__ == '__main__':
    sock = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
    server_addr = (SERVER_ADDR, UDP_PORT)
    sock.bind(server_addr)
    while 1 :
        recv_data = sock.recvfrom(8)
        print recv_data
        rx_sequence_number = 0
        rx_sequence_number = struct.unpack("!I", recv_data[0][:4])[0]
        print ("Rx Sequence Number %08x" % rx_sequence_number)
        data = recv_data[0]
        sock.sendto(data, recv_data[1])
    sock.close()
    del sock

More specifically, according to the linux version toturial, the 4th step:

4.Connect to the discovered device from the Linux console by using the Bluetooth 6LoWPAN connect command.

Establish the ble 6lowpan can use the follow the command.

echo "connect 00:AA:BB:XX:YY:ZZ 2" > /sys/kernel/debug/bluetooth/6lowpan_control

I have set my PC ipv6 address as

2001:2001:2001:2001:2001::157

and running the above python example, however, there is connection between the PC and the BLE devices.

Parents Reply Children
No Data
Related