GPS Location updates from an API call - networks, NOT mobile devices

Solved
PiC
Conversationalist

GPS Location updates from an API call - networks, NOT mobile devices

We have Meraki networks onboard marine vessels, and for those devices the portal location info is useless. We've dealt with it, and used the Pepwave Peplink portal instead - these are cellular routers similar to Cradlepoints, and have GPS built in. Pepwave's cloud management portal has an API from which I can pull GPS location data via GPX or KML format, and each vessel also has an onboard GPS that could be used as a source as well. There are other portals such as marinetraffic.com that track commercial vessels and have APIs. All of the conversations I've found about updating location in the Meraki portal, though, has to do with mobile devices and onboard GPS or wifi scanning mechanisms. Has anyone built out a method of updating networks and devices like MXes and switches from actual GPS data?

1 Accepted Solution
PhilipDAth
Kind of a big deal
Kind of a big deal

About 6 years ago I wrote a Python script for a customer in the marine sector.  It pulled the GPS location from an onboard vessel system and updated the vessel location using the GPS coordinates.  This then allowed the Meraki portal to show where the vessel was.

 

You don't actually have to do it onboard though if you are using something like marinetraffic.com - you can use their API to pull the vessel location and update it - all from shore side.

 

The Meraki API has changed since I did it.  Basically, in the address field of an MX appliance, you can put in GPS co-ordinates.  Start by doing that in the dashboard, so you get it in the correct format.

 

Then use this API call to get that data.  This will let you see what the field names are.

https://developer.cisco.com/meraki/api-v1/get-network-device/

 

Once you know the field names for the GPS coordinates, you can use this API call to update them whenever you want.

https://developer.cisco.com/meraki/api-v1/update-network-device/

 

 

From long ago, this was the key line of code that did the update - but I doubt this will work with the current API version.  Hence the exercise above.

dashboard.devices.updateNetworkDevice(netId,serial,lat=lat,lng=long)

View solution in original post

3 Replies 3
PhilipDAth
Kind of a big deal
Kind of a big deal

About 6 years ago I wrote a Python script for a customer in the marine sector.  It pulled the GPS location from an onboard vessel system and updated the vessel location using the GPS coordinates.  This then allowed the Meraki portal to show where the vessel was.

 

You don't actually have to do it onboard though if you are using something like marinetraffic.com - you can use their API to pull the vessel location and update it - all from shore side.

 

The Meraki API has changed since I did it.  Basically, in the address field of an MX appliance, you can put in GPS co-ordinates.  Start by doing that in the dashboard, so you get it in the correct format.

 

Then use this API call to get that data.  This will let you see what the field names are.

https://developer.cisco.com/meraki/api-v1/get-network-device/

 

Once you know the field names for the GPS coordinates, you can use this API call to update them whenever you want.

https://developer.cisco.com/meraki/api-v1/update-network-device/

 

 

From long ago, this was the key line of code that did the update - but I doubt this will work with the current API version.  Hence the exercise above.

dashboard.devices.updateNetworkDevice(netId,serial,lat=lat,lng=long)
PhilipDAth
Kind of a big deal
Kind of a big deal

I found the old code.  REMEMBER, this will not work anymore, but it still shows the required flow.

 

https://ifm.net.nz/cookbooks/meraki-gps.html

 

PiC
Conversationalist

That helps a lot, thank you!

Get notified when there are additional replies to this discussion.