News:

  • October 02, 2026, 06:10:31 AM

Login with username, password and session length

Author Topic: HTTPCMD Help  (Read 33112 times)

Bolt

  • Hero Member
  • *****
  • Posts: 598
Re: HTTPCMD Help
« Reply #15 on: August 31, 2019, 02:47:14 PM »
Here's a screenshot of wireshark, I'm not really sure what I'm looking for.  It is worth noting that the /post/xxx.php request doesn't show up on the wire until after the 15 second disconnect.  And it's all addressed to UDP to 255.255.255.255?  I can't find any source or destination containing the server's IP in the time period involved here.

Bolt

  • Hero Member
  • *****
  • Posts: 598
Re: HTTPCMD Help
« Reply #16 on: August 31, 2019, 02:56:16 PM »
The difference is really this pronounced.  Check out the Trend View attached.  Same request to the same server, same response, one via HTTPCMD, the other via OPENTCP, STREAMOUT, STREAMIN, CLOSE.

Andrew S

  • Hero Member
  • *****
  • Posts: 144
Re: HTTPCMD Help
« Reply #17 on: August 31, 2019, 03:00:41 PM »
Make sure you have the IP address formatted correctly in D300. Each octet is a byte so for instance if your server IP address is 192.168.12.34 the memory locations would contain:
D300:UB3 - 192
D300:UB2 - 168
D300:UB1 - 12
D300:UB0 - 34
The native equivalent value of this IP address would be -1062728670


Bolt

  • Hero Member
  • *****
  • Posts: 598
Re: HTTPCMD Help
« Reply #18 on: August 31, 2019, 03:07:56 PM »
IP address is correct.

My SL3 via STREAMOUT is
Code: [Select]
"GET http://" FmtInt(D300,ipaddr) "/post/weather.php" "$0D$0A" response into PLC within 1/2 second

My SL3 via HTTPCMD is
Code: [Select]
/post/weather.php response into PLC over 15 seconds
« Last Edit: August 31, 2019, 03:09:39 PM by Bolt »

Andrew S

  • Hero Member
  • *****
  • Posts: 144
Re: HTTPCMD Help
« Reply #19 on: August 31, 2019, 03:20:35 PM »
Do you have any filtering switched on for the Wireshark capture or display? There are two - one you set when you set the interface you want to monitor, and the other's to filter the captured data once you start capturing.
The best way to set up Wireshark is to use "host 192.168.0.10" in the capture filter and then don't filter the display (at least initially). If you want to run a capture and then send it over I'll be happy to look at it for you. PM me if you're interested.

Andrew S

  • Hero Member
  • *****
  • Posts: 144
Re: HTTPCMD Help
« Reply #20 on: August 31, 2019, 03:24:29 PM »
Looking again at the trace screenshot, that's probably a logger message. It's not the GET - that's a TCP message (the one you mentioned is UDP). Take a look at the TCP message at the top of the screen - is that relevant?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: HTTPCMD Help
« Reply #21 on: September 03, 2019, 01:50:24 PM »
Starting to think there is a bug. We've had another report that sounds curiously similar. Looking at it now.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Andrew S

  • Hero Member
  • *****
  • Posts: 144
Re: HTTPCMD Help
« Reply #22 on: September 03, 2019, 03:31:57 PM »
This might (or might not) be relevant but when I initially started using HTTPCMD I was having trouble connecting to the server. It turned out that if I added a PING first it worked just fine. Here's the thread I started about it: https://forum.hosteng.com/index.php/topic,2649.0.html

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: HTTPCMD Help
« Reply #23 on: September 03, 2019, 05:04:52 PM »
The issue was in the chunk handling. Not sure how this escaped, because it appears that chunking was always going to be a problem. I know we tested with some chunked sites, but apparently need to add some more.

The difficulty is that there are at least 3 different ways the response payload can be terminated. Trying to handle them all in a single asynchronous state handler is surprisingly awkward.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Bolt

  • Hero Member
  • *****
  • Posts: 598
Re: HTTPCMD Help
« Reply #24 on: September 03, 2019, 05:37:11 PM »
This might (or might not) be relevant but when I initially started using HTTPCMD I was having trouble connecting to the server. It turned out that if I added a PING first it worked just fine. Here's the thread I started about it: https://forum.hosteng.com/index.php/topic,2649.0.html
I was always PINGing before the HTTPCMD, or OPENTCP, either way.  Thanks for the re-read, I vaguely remembered that post.

The issue was in the chunk handling. Not sure how this escaped, because it appears that chunking was always going to be a problem. I know we tested with some chunked sites, but apparently need to add some more.

The difficulty is that there are at least 3 different ways the response payload can be terminated. Trying to handle them all in a single asynchronous state handler is surprisingly awkward.

Cool, good to know I wasn't crazy afterall.

Don't forget to remove the existing TCP connection option, https://forum.hosteng.com/index.php/topic,2649.msg21567.html#msg21567

But, I don't think the chunk issue applies to me?  I'm just trying to read a <300 character string back into the BRX.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: HTTPCMD Help
« Reply #25 on: September 03, 2019, 05:41:14 PM »
But, I don't think the chunk issue applies to me?  I'm just trying to read a <300 character string back into the BRX.

It's a payload encoding format that some servers use. Has nothing to do with the length of the payload.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO