Building the project

For the server side, we have the following library dependencies:

  • NymphRPC
  • POCO

For the node, we have the following dependencies:

  • NymphRPC
  • POCO
  • Mosquitto

The NymphRPC library (described at the beginning of this section) is compiled according to the project's instructions and installed in a place where the linker can find it. The POCO libraries are installed using the system's package manager (Linux, BSD, or MSYS2) or by hand.

For the Mosquitto library dependency, we can compile the libmosquitto and libmosquittopp library files using the project's library version by using the Makefile in the test/SmingCore/network/libmosquitto folder. Again you should install the resulting library files where the linker can find them.

When not using MinGW, one can also use the generally available version via the OS's package manager or similar.

After these steps, we can compile the server and client using the following command-line command from the root of the project:

make

This should compile both the server and node projects using the top-level Makefile, resulting in an executable for each in their respective bin/ folder. You should ensure that the executable name and path in the server's Node class match that of the node executable's location.

We should now be able to run the project and start to collect test results. The project includes a stripped version of the ESP8266-based BMAC firmware, which we'll be covering in detail in Chapter 9, Example - Building Monitoring and Control. Please refer to that chapter to understand how to communicate with the simulated nodes via MQTT, how to turn on modules inside the firmware and how to interpret the data sent over MQTT by the modules.

After setting things up as described in that chapter - requiring at the least an MQTT broker and a suitable MQTT client - and turning on the BME280 module in the simulated node, we expect it to start sending over MQTT the temperature, humidity and air pressure values we set for the room the simulated node is in.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.65.65