News:

  • October 01, 2026, 12:20:59 AM

Login with username, password and session length

Author Topic: Anyone using HTTPCMD?  (Read 35425 times)

Andrew S

  • Hero Member
  • *****
  • Posts: 144
Re: Anyone using HTTPCMD?
« Reply #15 on: July 01, 2019, 04:54:34 PM »
I'm using a directly assigned IP address. It's not a variable.

I came to the same conclusion Bob, but of the scenarios you mentioned I don't know that any really fit my situation. I've validated and re-validated the IP address (I'm able to use the exact same IP address from another client on the same subnet), it's on the same subnet as the server (so unlikely to be an ARP failure) and we're not using DNS for this since it's an IP address.

Perhaps I just need a holiday...

Andrew S

  • Hero Member
  • *****
  • Posts: 144
Re: Anyone using HTTPCMD?
« Reply #16 on: July 03, 2019, 01:32:47 PM »
I'm still beating my head against a wall with this.

I added a PING statement which works fine. This tells me that the network connectivity is good.

Wireshark shows TCP SYN packets being sent from the PLC to the Server, but no ACK responses come from the server. However, all other clients I've tried elicit a correct response from the server.

Here's the really strange thing - if I run the PING first, the HTTPCMD succeeds, and continues to succeed for a while. After a period of inactivity it starts failing again, until I PING the server once more.

Is it possible that ARP handling is failing for HTTPCMD but it's working for PING?

Another thing to note is that it works just fine (always) on a different NodeJS server. The server that's failing is an Ubuntu 19.04 box running in a Hyper-V VM on my Win10 box. Once again though, other clients always connect to it just fine - it's just the PLC/this-particular-server combo that's causing a problem.


BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: Anyone using HTTPCMD?
« Reply #17 on: July 03, 2019, 01:45:51 PM »
Is it possible that ARP handling is failing for HTTPCMD but it's working for PING?

Doubtful. Stack doesn't know the difference.
"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

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: Anyone using HTTPCMD?
« Reply #18 on: July 03, 2019, 01:53:09 PM »
Another thing to note is that it works just fine (always) on a different NodeJS server.

By "it", do you mean the BRX PLC doing HTTPCMD?

plcnut

  • Hero Member
  • *****
  • Posts: 815
    • premiersi.com
Re: Anyone using HTTPCMD?
« Reply #19 on: July 03, 2019, 02:29:23 PM »
I have only piddled with NodeJS, but have done a lot with IIS.
In IIS you can set up your server to only respond to a request based on the Name versus an IP request. I do not know if this "filtering" happens at the connect, or at the request level.
The only servers that I maintain are on private networks, so we always set them to work based on the IP.
Maybe the NodeJS server doesn't like the request from the BRX?
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
https://premiersi.com

Andrew S

  • Hero Member
  • *****
  • Posts: 144
Re: Anyone using HTTPCMD?
« Reply #20 on: July 03, 2019, 02:42:17 PM »
By "it", do you mean the BRX PLC doing HTTPCMD?
Yes. The solution works end-to-end if I run a PING first. At least for a while.

Another weirdness I've come across is that I can't get HTTPCMD to succeed (ever) if I use TCPOPEN. The TCPOPEN connects successfully (and the CLOSE works correctly too) but the HTTPCMD always fails without an error code (just the error bit being set). Since there's no diagnostics I can't tell why it fails but if I bypass the TCPOPEN and CLOSE statements and change the same HTTPCMD statement to specifically use either an IP address or hostname, it succeeds.


Andrew S

  • Hero Member
  • *****
  • Posts: 144
Re: Anyone using HTTPCMD?
« Reply #21 on: July 03, 2019, 02:43:36 PM »
Maybe the NodeJS server doesn't like the request from the BRX?

It's not getting as far as the server (which doesn't by default care how you reach it - IP address or any hostname is ok by default). The problem occurs lower down at the TCP negotiation.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: Anyone using HTTPCMD?
« Reply #22 on: July 03, 2019, 02:46:14 PM »
By "it", do you mean the BRX PLC doing HTTPCMD?
Yes. The solution works end-to-end if I run a PING first. At least for a while.

Another weirdness I've come across is that I can't get HTTPCMD to succeed (ever) if I use TCPOPEN. The TCPOPEN connects successfully (and the CLOSE works correctly too) but the HTTPCMD always fails without an error code (just the error bit being set). Since there's no diagnostics I can't tell why it fails but if I bypass the TCPOPEN and CLOSE statements and change the same HTTPCMD statement to specifically use either an IP address or hostname, it succeeds.

The option to TCPOPEN then HTTPCMD may not work. We had good thoughts, but reality got in the way. I thought that option got removed, but I guess not.
"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

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3626
  • Darth Ladder
Re: Anyone using HTTPCMD?
« Reply #23 on: July 03, 2019, 03:18:14 PM »
What if you load the program on a SIM on one of the PC's that can access the server?
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

Andrew S

  • Hero Member
  • *****
  • Posts: 144
Re: Anyone using HTTPCMD?
« Reply #24 on: July 03, 2019, 04:18:49 PM »
What if you load the program on a SIM on one of the PC's that can access the server?
Same behavior as the PLC.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: Anyone using HTTPCMD?
« Reply #25 on: July 03, 2019, 04:33:50 PM »
Same behavior as the PLC.

Windows stack is *very* different than the hardware's stack. I'd be looking elsewhere.
"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