News:

  • April 30, 2026, 12:31:38 PM

Login with username, password and session length

Author Topic: HTTPCMD Help  (Read 20813 times)

dmd33

  • Newbie
  • *
  • Posts: 6
HTTPCMD Help
« on: January 15, 2024, 11:15:55 AM »
Hello,

I am trying to get a BRX plc to work with a heartbeat using Opsgenie.  This is way outside of my wheelhouse but I thought I would be able to figure it out if I kept tinkering with it.  So far I have not found a working configuration, any help would be appreciated.

Based on my firewall logs it looks like the PLC is contacting the IP address that api.opsgenie.com resolves to but the ping is not being received. 

My current settings are attached.


This is the command needed to ping the heartbeat.  You can use GET, POST, PUT, PATCH

curl -X GET 'https://api.opsgenie.com/v2/heartbeats/HeartbeatName/ping'
    --header 'Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889'



This would be the response from Opsgenie but I do not plan to use the information in the PLC.  At this time I don't plan on confirming receipt of the ping.

{
    "result": "PONG - Heartbeat received",
    "took": 0,
    "requestId": "111be080-6632-4897-a6e9-b8dc72f943c7"
}

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3806
    • Host Engineering
Re: HTTPCMD Help
« Reply #1 on: January 15, 2024, 11:41:06 AM »
Buffer management - looking at the HTTPCMD parameter screen shot, your pre-defined response body buffer size is 400 bytes starting at the first byte of D8 (D8:UB0).  This goes through D107:UB3 (last byte of D107 DWORD).

However, you tell the instruction to place the actual response length in D24, which is in the middle of your data buffer.  Put it to D124 or some other unused D (use the Cross Reference View Ctrl+Y to make sure you are not using D8 through D107 for ANYTHING other than your response buffer.).

This is probably not the primary issue, but it definitely would be the next "not working" issue.

dmd33

  • Newbie
  • *
  • Posts: 6
Re: HTTPCMD Help
« Reply #2 on: January 15, 2024, 12:17:04 PM »
Thank you for the help.  I see the error there now and I made the change that you suggested.

The issue is not resolved though.

thanks

dmd33

  • Newbie
  • *
  • Posts: 6
Re: HTTPCMD Help
« Reply #3 on: January 15, 2024, 01:07:32 PM »
I ran a packet capture on our firewall and it looks like there might be an issue with the TLS version.  I have seen this topic come up on a thread about HTTPCMD on the AD forums.

Opsgenie supports 1.2 and up.  If I am looking at this packet capture correctly the PLC my be using 1.0???  I don't actually know how to read this.

TLSv1 Record Layer: Alert (Level: Fatal, Description: Handshake Failure)
    Content Type: Alert (21)
    Version: TLS 1.0 (0x0301)
    Length: 2
    Alert Message
        Level: Fatal (2)
        Description: Handshake Failure (40)

dmd33

  • Newbie
  • *
  • Posts: 6
Re: HTTPCMD Help
« Reply #4 on: February 05, 2024, 04:03:23 PM »
What version(s) of TLS are supported by the BRX?

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3806
    • Host Engineering
Re: HTTPCMD Help
« Reply #5 on: February 05, 2024, 04:25:25 PM »
It tries to use TLS 1.2, but will negotiate down to whatever the server supports to establish a "secure" TLS session.

See https://community.automationdirect.com/s/question/0D5Dp000004zOqjKAE/brx-httpcmd-is-now-receiving-a-ssltls-handshake-failure


dmd33

  • Newbie
  • *
  • Posts: 6
Re: HTTPCMD Help
« Reply #6 on: February 06, 2024, 09:51:10 AM »
Yes, I had seen that thread.  It doesn't look like its trying to use 1.2, it goes straight to 1.0.


franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3806
    • Host Engineering
Re: HTTPCMD Help
« Reply #7 on: February 06, 2024, 10:00:23 AM »
Yes, I had seen that thread.  It doesn't look like its trying to use 1.2, it goes straight to 1.0.

What firmware version do you have in your PLC?

dmd33

  • Newbie
  • *
  • Posts: 6
Re: HTTPCMD Help
« Reply #8 on: February 06, 2024, 10:25:05 AM »
Operating System 2.9.8, Booter 1.1.0