🛠 Passerelle 6LoWPAN : wpan0, lowpan0 et BLE du CC1352P7

BeaglePlay (TI Sitara AM6254 / AM625) · avance · Schéma : IMG-beagleplay-avance-2-passerelle-6lowpan.svg — Le BeaglePlay en routeur 6LoWPAN : interface wpan0 (mtu 123) encapsulée dans lowpan0, reliée aux modules kernel bcfserial, wpanusb et mac802154, avec le BLE du CC1352P7 en périphérie

Objectives

Turn the BeaglePlay into an IP/6LoWPAN gateway: the native 802.15.4 plane is raw (short frames, mtu 123 on wpan0); the mac802154 modules and 6LoWPAN encapsulation create a lowpan0 interface that carries IPv6. We stack the modules (bcfserial or wpanusb depending on the CC1352P7 firmware, plus mac802154), bring up the lowpan interface, and announce the prefix to the LAN so that 802.15.4 nodes become full-fledged IPv6 hosts. The CC1352P7's BLE remains usable in parallel for pairing.

Hardware

Complete code

# Charger la pile (bcfserial OU wpanusb selon le firmware flashé)
sudo modprobe mac802154
sudo modprobe wpanusb        # ou : sudo modprobe bcfserial
ip link show wpan0           # mtu 123 = 802.15.4 natif

# Créer l'interface 6LoWPAN par-dessus wpan0
sudo ip link add link wpan0 lowpan0 type lowpan
sudo ip link set wpan0 up
sudo ip link set lowpan0 up
sudo ip -6 addr add fd12:3456:789a::1/64 dev lowpan0

# Rôle de routeur : annoncer le préfixe et forwarder vers eth0
sudo sysctl -w net.ipv6.conf.all.forwarding=1
sudo radvd -C /etc/radvd.conf   # préfixe fd12:3456:789a::/64 sur lowpan0

# BLE du CC1352P7 pour l'appairage
bluetoothctl list

Expected verification

ip -d link show lowpan0 indicates the type lowpan with link/wpan0; the remote node, once joined, obtains an address in fd12:3456:789a::/64 and responds to ping6 from the LAN via the gateway (forwarding=1). bluetoothctl list shows the CC1352P7's BLE adapter, proving that the 15.4 radio and BLE coexist.

Common errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials