HTTP 0.9 seems to be not supported on OH 3.3

Hello,

I’m running OH 3.3.
I’m configuring a device I have which is a temperature module operating temperature sensors and supporting HTTP requests.
It is made by Xytronix Research & Design and the model is X-DAQ-2R1-4T-E.

The problem I have is that this device, when you query the device via HTTP, it replies a version 0.9 of HTTP, meaning, no header, just the reply body.
Testing with curl, I have to add the curl parameter --http0.9 otherwise curl would complain.

issa@localhost:~> curl  http://192.168.79.218/state.xml
curl: (1) Received HTTP/0.9 when not allowed
issa@localhost:~> curl --http0.9  http://192.168.79.218/state.xml
<?xml version="1.0" encoding="utf-8"?>
<datavalues>
<units>C</units>
<sensor1temp>22.0</sensor1temp>
<sensor2temp>22.0</sensor2temp>
<sensor3temp>x.x</sensor3temp>
<sensor4temp>x.x</sensor4temp>
<relay1state>0</relay1state>
<relay2state>0</relay2state>
</datavalues>

When setup in OH3.3, I had a look at the logs, OH3.3 complains as well

12:36:37.449 [TRACE] [http.internal.http.RefreshingUrlCache] - Requesting refresh (retry=false) from 'http://192.168.79.218/state.xml' with timeout 3000ms
12:36:37.453 [TRACE] [http.internal.http.RefreshingUrlCache] - Sending to 'http://192.168.79.218/state.xml': Method = {GET}, Headers = {Accept-Encoding: gzip, User-Agent: Jetty/9.4.46.v20220331}, Content = {null}
12:36:37.477 [TRACE] [tp.internal.http.HttpResponseListener] - Received from 'http://192.168.79.218/state.xml': Code = {505}, Headers = null, Content = {null}
12:36:37.480 [WARN ] [tp.internal.http.HttpResponseListener] - Requesting 'http://192.168.79.218/state.xml' (method='GET', content='null') failed: org.eclipse.jetty.client.HttpResponseException: HTTP protocol violation: bad response on HttpConnectionOverHTTP@2761fbc9::SocketChannelEndPoint@7b03827f{l=/192.168.79.210:57950,r=/192.168.79.218:80,OPEN,fill=-,flush=-,to=6/0}{io=0/0,kio=0,kro=1}->HttpConnectionOverHTTP@2761fbc9(l:/192.168.79.210:57950 <-> r:/192.168.79.218:80,closed=false)=>HttpChannelOverHTTP@6ffa2371(exchange=HttpExchange@195b7b43{req=HttpRequest[GET /state.xml HTTP/1.1]@314c7412[TERMINATED/null] res=HttpResponse[null 505 Unknown Version]@563b083e[PENDING/null]})[send=HttpSenderOverHTTP@68645823(req=QUEUED,snd=COMPLETED,failure=null)[HttpGenerator@2a27b70f{s=START}],recv=HttpReceiverOverHTTP@7819aabd(rsp=IDLE,failure=null)[HttpParser{s=CLOSE,0 of -1}]]

So I guess the very simplistic replies from that device is causing OH to choke :slight_smile:

Any ways I can get around this problem?

Thanks for the help!
Regards

Never mind, the device also provides another HTTP endpoint (/stateFull.xml) replying with HTTP headers - OH3.3 is happy now (and me too :slight_smile: )