Prototype for Apparateq discovery protocol. The protocol uses multicast for device discovery and configuration. The target platform is small embedded systems with limited network protocol capabilities. In principle the devices do not even need to have an assigned IP address, but they need to be able to receive UDP over IP multicast.
The protocol data format is described in src/Protocol.h and consists of a single Message struct which is identical whether communications goes from server -> client or in the opposite direction.
Currently this concept is implemented as two unix processes, client and server but could easily be adapted to a small embedded system.
The only requirements are cmake and a C++ compiler.
The project builds on macOS and Linux and uses the std::thread library.
> git clone https://github.com/mortenjc/discovery.git
> cd discovery
> mkdir build
> cd build
> cmake ..
> make
The client application instantiates a 'device' with an initial state of 'booting' and an 'ip address' of "0.0.0.0". It generates a random serial numbe, product id and product name. As the serial number is based on the unix process id there is a small risk of duplicate serial numbers if the clients are run on different machines.
The server application is a continuous loop asking for a command like 'discovery', 'address assignment' or 'configuration'. For the two latter additional arguments must be specified.
To start the clients, open a terminal window and type the following command
build> ./bin/client
To start the server,
build> ./bin/server
This is not designed to be a secure protocol. Anyone can currently configure and reconfigure any device at any time. The target is a measurement laboratory or similar with these devices performing non critical operations.
- Morten Jagd Christensen
See also the list of contributors on Github.
This project is licensed under the BSD-2 License see the LICENSE file for details.