Data Fetcher
- The data from LoRaWAN sensors are transmitted to a server of The Things Network. The data are then stored for a maximum of seven days. Consequently, the lcm application must retrieve and locally store the sensor data at least every seven days
- This is the purpose of the “Data Fetcher”. The Data Fetcher script collects all data from configured “the things network applications” and stores them locally as CSV files
- Below, you will find a description of how this process can be initiated automatically on various operating systems
Table of contents
Windows
The following setup procedure relies on the Windows Task Scheduler, which periodically executes a batch file. To create a task on Windows 10, follow these steps:
- Open
Start
- Search for
Task Scheduler
, and open the corresponding app. The “Task Scheduler” (de:Aufgabenplanung
) App opens - Right-click the
Task Scheduler Library
branch (de:Aufgabenplanungsbibliothek
), and select theCreate task...
option - Fill in the fields in the first tab as follows:
- In the second tab, create new Triggers as follows:
- In the third tab, create new Actions as follows:
Arguments: (changeMyAppPath
accordingly)
/c start /min C:\MyAppPath\dataFetcher\lcmDataFetcher.bat ^& exit
- In the fourth and fifth tabs, set the checkboxes as follows:
- Click OK to save
- You can right-click the new task and execute it in order to test
MacOSX and Linux
The following setup procedure relies on the cronjob daemon, which periodically executes a R script file.
- Open
/etc/crontab
in your favorite editor - Paste the following entry at the end (change
MyAppPath
accordingly)
0 * * * * Rscript /MyAppPath/dataFetcher/lcmDataFetcher.R
- Save file and close editor
The above cronjob runs the Data Fetcher script every hour.