I’m trying to read temperature data from a Sensatronics E4 temperature monitor using HttpClient on a Photon.
is copied from this thread: Spark Core Http Client Library
When I call
I expect to get a string back like this:
Probe 1|74.2|Probe 2|71.4|Probe 3|-99.9|Probe 4|-99.9
and when I read the sensor from Firefox, Matlab, or curl, that’s exactly what I get. But when I run this Photon program all I get is
Application> Response status: -1 Application> HTTP Response Body: Application> Start of Loop. Application> Response status: -1 Application> HTTP Response Body: Application> Start of Loop. Application> Response status: -1 Application> HTTP Response Body:
Apparently, the HttpClient library croaks because the E4 did not return an HTTP result code (eg. 200), just the data string. Unfortunately, Sensatronics is no longer with us so a firmware upgrade is out of the question.
Now I’d be happy to play with this myself but when I included the library directly into my code to make some changes, it wouldn’t compile, complaining something about multiple class definitions or some such C++ mumbo jumbo.
So does anyone know either:
- how to get HttpClient to return a result when the provider doesn’t give a result code,
- or how to get the HttpClient library to compile
- or some other low-cost temperature sensor that provides a network REST API I can query successfully?