Checking GPS Data using ioxclient
Once GPS service is up and running , you can verify the gps data to ensure that things are fine
Before you proceed with steps mentioned below , please make sure you have configured the IOxGPS service with rest API as explained in previous chapter.Without that , data will not flow through
NAT Configuration on IOS
Use IOXClient CLI to check the mapped port of the NBI and Broker. Check the right port mapping for NBI port under networking section from the output of below command
ioxclient svc info IOxCore
Add nat entries on the IOS to map the ports with the IP of the svcbr_0 of the Guest OS to the IP of the external interface or VLAN.
conf> ip nat inside source static tcp <svcbr_0 IP on GOS> 9999 interface GIGE-0 9999
IOxClient configuration
Configure ioxclient to get the service data.Below is the snapshot for configuring ioxclient to start getting the gps data.
Configure ioxclient for communicating with NBI
rgowrimo@ubuntu:~$ ioxclient svc infra nbi init
Registration Successful for application ioxclient_9081
Obtaining access token..
Successfully obtained Access Token
Saving current configuration
Enter the North bound gateway IP address[ 10.78.106.98 ] :
Enter the North bound gateway Port[40001]: 9999
Enter the North bound gateway api prefix[/api/v1/mw/]:
Enter the North bound gateway URL scheme[https]:
Saving current configuration
- Above, North bound gw ip is the WAN IP of the router.
- North bound gw port is the port configured via NAT rule in above config.In this case is the same "9999" port
Please note that the current version of micro service provides only Latitude, Longitude, altitude along with timestamp.
Checking Streaming GPS Data
Use the below command to start streaming the GPS data
$ ioxclient svc infra msg ws sub "**"
Currently active profile : gps
Command Name: service-infrastructure-messaging-websocket-subscribe
{"message":{"altitude":"902","latitude":"77.695277","longitude":"12.931943","timestamp":"1490008098"},"topic":"gps"}
{"message":{"altitude":"902","latitude":"77.695277","longitude":"12.931943","timestamp":"1490008103"},"topic":"gps"}
{"message":{"altitude":"903","latitude":"77.695277","longitude":"12.931943","timestamp":"1490008128"},"topic":"gps"}
{"message":{"altitude":"903","latitude":"77.695277","longitude":"12.931943","timestamp":"1490008133"},"topic":"gps"}
{"message":{"altitude":"903","latitude":"77.695277","longitude":"12.931943","timestamp":"1490008138"},"topic":"gps"}
{"message":{"altitude":"903","latitude":"77.695277","longitude":"12.931943","timestamp":"1490008143"},"topic":"gps"}
If the GPS is not enabled on the device then the stream will return a JSON error code stating "GPS not enabled. Check the IOS configuration".
If the GPS antenna is not in line of sight of the satellites the stream will give "nan" as values. These values will continue to stream till the device is line of sight and acquires right co-ordinates.In this case, JSON payload with error code stating "Antenna is not in line of sight" will be given
Next steps
To learn more about how to develop GPS App use below link:
GPS App development - How to develop GPS App development using IOx gps service
Reference GPS App - Sample GPS App
IOx Services developer guide - IOx Services developer guide