Link Search Menu Expand Document

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

  1. Windows
  2. MacOSX and Linux

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:

  1. Open Start
  2. Search for Task Scheduler, and open the corresponding app. The “Task Scheduler” (de: Aufgabenplanung) App opens
  3. Right-click the Task Scheduler Library branch (de: Aufgabenplanungsbibliothek), and select the Create task... option
  4. Fill in the fields in the first tab as follows:



  5. In the second tab, create new Triggers as follows:







  6. In the third tab, create new Actions as follows:





    Arguments: (change MyAppPath accordingly)
    /c start /min C:\MyAppPath\dataFetcher\lcmDataFetcher.bat ^& exit
  7. In the fourth and fifth tabs, set the checkboxes as follows:





  8. Click OK to save
  9. 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.

  1. Open /etc/crontab in your favorite editor
  2. Paste the following entry at the end (change MyAppPath accordingly)
    0 * * * * Rscript /MyAppPath/dataFetcher/lcmDataFetcher.R
  3. Save file and close editor

The above cronjob runs the Data Fetcher script every hour.