ABeacon
ABeacon

This project consists of a class implementing an AMX-compatible beacon on an Arduino with Ethernet card using W5100, W5200, or W5500 chips. If using an Ethernet shield using W5500 or W5200 chip, be sure to use version 2.0.0 (or later) of the Ethernet library, since it supports both chips, auto-detecting during runtime.

The AMX beacon protocol is described e.g. here.

This is a singleton class, with no public constructor. Instead, the static "factory" function setup() should be called. The user then has to call the send() function on a regular basis, e.g. every 10 to 60 seconds. Alternatively, checkSend() can be called arbitrarily often, without flooding the LAN. See example/Beacon.ino for an example.

The class requires that the Ethernet has been setup before calling newInstance. It then instantiates its own private EthernetUDP instance.

The beacon should transmit an UDP broadcast message to IP-address 239.255.250.250, port 9131. However, the Arduino library does not consider this IP address to be a broadcast address. Therefore, this implementation instead sends to broadcast address 255.255.255.255.

Porting to other libraries/platforms

I am interesting in (clean) ports to other libraries and platforms. For this, the calls

are used. Pull requests are welcome!