Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Using WebAPI to get IPInfo


ridgerunner81 Mar 3, 2016 07:16 PM

Prior to OS28, we were able to use the following WebAPI request to get the dataloggers (CR1000 & CR800) network information:

 

http://?command=dataquery&uri=dl:status.ipinfo&mode=most-recent&format=json

 

now that the network information has been moved to the "Settings" table and the "IPInfo()" command has been created, the above query does not work anymore.  I have tried the following queries without success:

 

http://?command=dataquery&uri=dl:settings.IPAddressEth&mode=most-recent&format=json
http://?command=dataquery&uri=dl:settings.IPInfo&mode=most-recent&format=json
http://?command=dataquery&uri=dl:settings.ipinfo&mode=most-recent&format=json
http://?command=BrowseSymbols&uri=dl:setttings&format=html

 

With the OS update is it still possible to get the network information via the WebAPI without needing to store it in a public variable?


ridgerunner81 Mar 22, 2016 06:44 PM

The information in the CR1000 Status.IPInfo was:
"eth MAC: 00d02c044e5b\r\neth IP: 10.11.40.23\r\neth mask: 255.255.0.0\r\neth gw: 10.11.1.1\r\ndns: 0.0.0.8\r\ndns: 10.11.10.11\r\ndns: 10.11.10.12\r\n"

The information in the CR800 Status.IPInfo was:
"CSIO(1) MAC: 00d02c0209b0\r\nCSIO(1) IP: 10.11.40.48\r\nCSIO(1) mask: 255.255.0.0\r\nCSIO(1) gw: 10.11.1.1\r\ndns: 0.0.0.8\r\ndns: 10.11.10.11\r\ndns: 10.11.10.12\r\n"

With the update for OS 29, is it still possible to get the MAC Address of the datalogger?


GaryTRoberts Mar 22, 2016 07:06 PM

It is not possible to do this is OS 29 (or OS 4 on the CR6) through the WebAPI because these settings were moved to the Settings table which is not available through the API.  We have submitted this as a request to Engineering and it will be included in the next release of the datalogger operating system.

To get around it for now, you will have to declare Public variables in your program.  You can then parse Settings.EthernetInfo as needed to get at the information you wanting.

ie.

Public EtherNet_Info As String * 300

Somewhere in one of your scans:

EtherNet_Info = Settings.EthernetInfo

Then you can parse it as you have done in the past but instead using the Public table.

For others that are interested in doing the same thing on the logger's other Ethernet interfaces, the following can be used to get simular information concerning them:

Settings.PPPInfo (PPP Connection)

Settings.WiFiStatus (CR6 Wifi)

Settings.CSIOInfo (NL2X0 devices setup in bride mode)

Log in or register to post/reply in the forum.