IPv6 multicast testing on esp32
I really want IPv6 multicast working on a fleet of esp32 wifi boards.
This repo is my testing ground.
Testing
Using a ESP-RS devkit connected to a USB port run
cargo run --release
Remember to set the env variables SSID and PASSWORD to a suitable WiFi network available to connect to.
Receiving Multicast messages on linux
To help with testing it is possible to use socat to listen to UDP6-DATAGRAM!
I got this from https://unix.stackexchange.com/questions/735181/ipv6-multicast-fails-when-it-should-loop-back-to-self
sudo ip addr add ff05::1234 dev wlan0 autojoin
socat UDP6-DATAGRAM:'[ff05::1234]':9988,bind=:9988,ipv6-add-membership='[ff05::1234]':wlan0,setsockopt=41:19:i0,setsockopt=41:17:i$(ip -j link show wlan0 | jq '.[].ifindex') -
Note that wlan0 should match the interface your laptop/desktop is using.
What is it meant to do?
The code will connect to wifi, join the multicast group FF05::1234 (Scope Site Local) and listen on port '9988'.
Once initially connected it will send out a udp packet to the multicast group and then wait for incoming packets on port '9988'