This is an old revision of the document!


Send the local GPS NMEA stream to a remote UDP server

Goal

This script sends the local GPS NMEA stream to a remote UDP server. In addition, the GNSS frames are extended with a sentence (PNMID) and the serial number from the router. If Telit modules have been installed for the router, a GPRMC frame is searched for and provided from a GNSS data block using a regex rule.

Prerequisites

  • NetModule Wireless Router with wireless connection
  • NetModule wireless router with a GNSS module
  • NetModule Software 5.0.0.101 or newer
  • Not available for legacy products NB1600, NB2700, NB3700, NB3710

The wiki was tested with router software version 5.0.0.101.


1. Set up the SDK script on the router

In the first step, the SDK function is activated and further options are specified.


  1. The function is activated under point 1.
  2. Under point 2, we free up memory for the execution of the script. For this SDK script, 100 MB is sufficient; only a few variables are stored temporarily for the execution of the program.
  3. Under point 3, we activate monitoring to check whether the script is still being processed correctly. We use the router's core function in the program. Monitoring makes sense here.

In the second step, we store the SDK script in Job Management.

First, we store the SDK script under Job Management. Using the plus button under point 3, we add a script.


After pressing the plus button, a new window opens with settings.

First, assign a name to the SDK process. In the second step, you can insert the SDK script using the “upload” function. You can open the script by clicking on the “show code” button in the WIKI and then download the “GPS_TRACKING.are” file. Once you have saved the file on your computer, you can search for it in step 3 using Browse and select it. The last step, “Apply“, saves everything to the router.


The “GPS_TRACKING.are” script can be downloaded via the “show code” link.

show code


Next, set up the trigger that will start the script.

Here, too, pressing the plus button opens a new window with insertion options.

Again, start by assigning a name to the SDK process. Use the “event-based” option as the trigger type for this script. Select the “sdk-startup” event from the list. Why do we use these settings for the script? The script was created as an endless script. The commands are controlled and executed in the script. Errors are output and the program is then terminated. The event starts the script when the daemon of the SDK program is started by the router. This is also advantageous if the watchdog restarts the SDK daemon on the router. In this case, the script is also reactivated. The “Apply” button saves the changes back to the router.


In the last step, we activate the SDK script on the router.

Again, enter the name for the SDK process first. If you want to activate the first SDK script on the router, the two fields “Trigger” and “Script” are already filled with the options you set up earlier. If you already have multiple scripts, you must select the correct option (Trigger and Script) from the pull-down menu. As before, click “Apply” to apply the setting to the router. In this case, the SDK script is also activated. Two arguments are required for the GPS_Tracking script: an IP address from the server and a UDP port. In this example, the IP address 192.168.1.1 and UDP port 20000 were used.


2. Additional information

show code