I am trying to pull temperature and humidity data from Fluke DewK 1620a thermo-hygrometers and write the temp/humidity readings to a log. I can connect to the device via netcat with a simple 'nc 18.104.22.168 10001', run some basic commands and receive output. Now I'd like to construct a command line, I can put in a script that will send a command and write the output to a file.
If I run the following from the command line
$ echo "read?" | nc -v -i 1 22.214.171.124 10001
Connection to 126.96.36.199 10001 port [tcp/scp-config] succeeded! 76.55,44.4,72.06,48.0
After the -i interval has elapsed, the connection closes and my prompt overwrites the temperature and humidity data.
I then tried the following:
echo "read?" | nc -v -i 1 188.8.131.52 10001 >> test.out 2>&1
The command executes and the 'test.out' file only contains the following for each execution.
Connection to 184.108.40.206 10001 port [tcp/scp-config] succeeded!
The temperature and humidity readings are not included in the file. Increasing the verbosity does not seem to help.
I know I'm probably missing something obvious, but I simply cannot see it. Any help would be greatly appreciated.