My variable iHttpGet_Cmd_Status is returning 0, but
My variable iWeather_Cmd_Status is returning -40, Not Enough Data Returned
And nothing is loaded into my string.
Any thoughts on what to try from here? I have already tried making my string tables arbitrarily larger (100 entries, 1024 wide) since I started them at minimal sizes. Also, I have experimented with the forslash or backslash in the string command, either works in the command line, and neither has an effect in OptoScript.
I popped the executable “httpget.exe” into my windows directory, and was able to get the response “0017.4”, which is the humidy % in my office where this thing is laying.
So, this is my first attempt to use the built-in opto function instead of just a command line utility. I’d rather log this weather station data into my SNAP-PAC-R1 then have to run a separate logging utility.
Since I’ve never used any form of HttpGet or HttpPost, I have no idea that the string I’m getting back on the command line isn’t an http response.
Hmm -I looked at that utility and the -r option means to just send raw data - so it may return http if that option wasn’t there, it just crashed when I tried it though.
Also you are using /r when the example has \r. \r is most likely an escape for the carriage return character 13.
So on your string you are sending from your strategy you probably should have “*SRH2” + CHR(13) I would check if that magically works for you. If not, then try the TransmitReceiveString command (You will need to open the comm handle yourself first).