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.

Programmatically enabling collection on LoggerNet?


ccowin Aug 12, 2021 05:11 PM

Hello,

Was wondering if there was a way to programatically enable a station's collection on a loggernet service, either through an http request or editing some configuration file somewhere? Ideally it would both be the enable collection in setup as well as the toggle on/off in status monitor.


jtrauntvein Aug 13, 2021 03:14 PM

Within the LoggerNet install directory (by default "c:\program files (x86)\campbellsci\loggernet\"), there is as program named cora_cmd.exe that is console based (run from the command prompt).  This program is available in the LoggerNet tool bar but I suspect that your interest would run more in executing the program directly as a child process in a script.  By default, this program reads commands from the standard input device and writes the results of those commands to the standard output device.  A script is able to redirect the standard input  and can also use command line options (such as --input and --input-file) to specify the command input.  These options are described in the program help which is available in both PDF and windows help forms.

Here are some example command lines that you could use to accomplish your stated goals:

disable all scheduled collection:

cora_cmd --input={connect localhost; set-lgrnet-setting 1 false;}

disable datalogger scheduled collection (change the false to true to enable the schedule at 5 seconds normal, 2 seconds primary retry, and 5 seconds secodary retry:

cora_cmd --input={connect localhost; set-device-setting logger-name collect-sched {false 1990-01-01 5000 2000 3 5000};}


ccowin Aug 16, 2021 05:32 PM

Well that looks like exactly what I'm looking for!

I've tried a few different things but can't seem to get a connection to the server. I've tried the hostname of the vm with and without the port and the specific IP Address as well but it always returns with a "session failure" error.

I read in the loggernet manual that remote connection needs to be enabled at the time of installation. I assume this was done because I connect to the LN service remotely as it runs on a VM. I was just copying the hostname from the dropdown list in Connect.

Connecting to the localhost works fine. Any suggestions?


ccowin Aug 17, 2021 04:40 PM

Got it working with the --server-port="####" argument on connect. Thanks for your help jtrauntvein!

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