{{tag>[linux fedora atusb 6lowpan 802.15.4]}} =====Fedora - 802.15.4 ATUSB===== Configuring 6LoWPAN with an ATUSB on Fedora. * You can find the adapter here: [[http://shop.sysmocom.de/products/atusb]] * Linux WPAN [[http://wpan.cakelab.org/]] * WPAN tools [[https://github.com/linux-wpan/wpan-tools]] {{::atusb-top.jpg?nolink|}} ====Configure the adapter==== * Install the WPAN tools:dnf install wpan-tools * Connect the ATUSB and a ''wpan0'' network device should appear. * If the device is not already in the DOWN state, configure it down: ip link set wpan0 down * Set the channel, for example channel 15:iwpan phy0 set channel 0 15 # Channels channel-11 2405 MHz channel-12 2410 channel-13 2415 channel-14 2420 channel-15 2425 channel-16 2430 channel-17 2435 channel-18 2440 channel-19 2445 channel-20 2450 channel-21 2455 channel-22 2460 channel-23 2465 channel-24 2470 channel-25 2475 channel-26 2480 * Configure a PAN ID:iwpan dev wpan0 set pan_id 0xCAFE * Configure a short address (node 1):iwpan dev wpan0 set short_addr 0x0001 * Add the lowpan device and enable the interfaces:ip link add link wpan0 name lowpan0 type lowpan ip link set wpan0 up ip link set lowpan0 up ====Test WPAN layer==== * On node 1, listen for node 2:wpan-ping -d 0x0002 * On node 2, send pings to node 1:# wpan-ping -a 0x0001 -s 5 -c5 PING 0x0001 (PAN ID 0xcafe) 5 data bytes 5 bytes from 0x0001 seq=0 time=5.3 ms 5 bytes from 0x0001 seq=1 time=5.3 ms 5 bytes from 0x0001 seq=2 time=5.3 ms 5 bytes from 0x0001 seq=3 time=7.9 ms 5 bytes from 0x0001 seq=4 time=7.2 ms --- 0x0001 ping statistics --- 5 packets transmitted, 5 received, 0% packet loss rtt min/avg/max = 7.162/6.199/7.917 ms ====IPv6==== * Configure IPv6 address on node1:ip addr add 2001:db8::1/64 dev lowpan0 * Configure IPv6 address on node2:ip addr add 2001:db8::2/64 dev lowpan0 * Ping test (node 2 to 1):# ping6 -c5 2001:db8::1 PING 2001:db8::1(2001:db8::1) 56 data bytes 64 bytes from 2001:db8::1: icmp_seq=1 ttl=64 time=14.6 ms 64 bytes from 2001:db8::1: icmp_seq=2 ttl=64 time=16.3 ms 64 bytes from 2001:db8::1: icmp_seq=3 ttl=64 time=17.6 ms 64 bytes from 2001:db8::1: icmp_seq=4 ttl=64 time=16.4 ms 64 bytes from 2001:db8::1: icmp_seq=5 ttl=64 time=15.1 ms --- 2001:db8::1 ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 4007ms rtt min/avg/max/mdev = 14.669/16.056/17.607/1.041 ms ====Monitor mode==== * Configure devices down:ip link set lowpan0 down ip link set wpan0 down * Configure channel to monitor:iwpan phy0 set channel 0 26 * Add monitor interface:iwpan phy phy0 interface add monitor%d type monitor * Enable monitor interface:ip link set monitor0 up * Dump packets with tcpdump, tshark, wireshark, ...