This describes the way how to build and run the software.
- First of all get your Raspi up to date
sudo apt-get update sudo apt-get upgrade
- Add prerequisites for .NET Core framework
sudo apt-get install curl libunwind8 gettext
- Install the .NET Core runtime
curl -SL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-linux-arm.tar.gz sudo mkdir -p /usr/share/dotnet sudo tar -zxf dotnet.tar.gz -C /usr/share/dotnet sudo ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
- Test the .NET Core installation
dotnet --help
Usage: dotnet [host-options] [path-to-application]path-to-application: The path to an application .dll file to execute. host-options: --additionalprobingpath <path> Path containing probing policy and assemblies to probe for --depsfile <path> Path to <application>.deps.json file --runtimeconfig <path> Path to <application>.runtimeconfig.json file --fx-version <version> Version of the installed Shared Framework to use to run the application. --roll-forward-on-no-candidate-fx Roll forward on no candidate shared framework is enabled --additional-deps <path> Path to additonal deps.json file Common Options: -h|--help Displays this help. --info Displays the host information
See also here for more information. Maybe this here is also necessary.
- Download and install the Tinkerforge Brick daemon for the operating system where you will run the
datacollectorand connect the weather station to. For Raspbian this looks for examplesudo apt-get install libusb-1.0-0 libudev0 pm-utils wget http://download.tinkerforge.com/tools/brickd/linux/brickd_linux_latest_armhf.deb sudo dpkg -i brickd_linux_latest_armhf.deb
- Install a MQTT broker somewhere. In my case I'm running Mosquitto on my Synology NAS.
-
The complete code can be build on any Windows system. There is a cross compile possible and everything is prepared in the
buildscript.batscript. Possible options for the build script arelinux-armlinux-x64win-x64
-
The build process will build the
datacollectoras well as theremotedeviceand all available plugins for the given destination/architecture. -
Compile the code for the desired destination(s).
-
After the build process is finished, copy the folder
./build/linux-arm/to your Raspi. -
For the
remotedeviceyou need to remove the following plugins from thePluginsfolder:Lcd.dll- Remove this because on theremotedeviceyou usually don't have the Tinkerforge display of the weather station.MQTT.dll- Remove this unless you want to re-publish the data to another broker/topic. Don't removeM2Mqtt.dllbecause it's used by theremotedeviceto deal with MQTT.
On the first run some config files with default values are created. Start the datacollector
datacollector.exeor the
remotedevice remotedevice.exeExecute this commands on the command line in the
build path of your architecture. Then abort the loop by pressing the escape button. In the next step configure each *.config file to fit your needs. For further details see the plugins documentation.
Both programs, the datacollector as well the remotedevice, are running in an endless loop. To abort the loop, just hit the escape button.
The config files are named like the plugins with Config.config at the end. See the plugins and their configs for more details.
The description for configuring the datacollector or the remotedevice can be found in their respective directories.
-
You cannot run the
datacollectorand theremotedeviceat one machine using the same plugin directory. The plugins cannot be used simultaneously by thedatacollectorand theremotedevice. If you want to run both on the same machine, you need to have two plugin directories and to configure one for thedatacollectorand the other for theremotedevice. -
Some of the plugins are using NuGet packages. During the deployment the plugins have a different deployment location than the
datacollectorprogram. Some of the DLLs will load additional dependencies - but somehow they are not taken from the plugin path. Caused by this the NuGet packages are also added to thedatacollector/remotedeviceproject. This solved the issue, but it's not a good solution.
Return to main.