Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » HTTP and OPC UA on Raspberry Pi(HTTP Post request)
HTTP and OPC UA on Raspberry Pi [message #1832844] Sat, 26 September 2020 17:07 Go to next message
Manuel Reif is currently offline Manuel ReifFriend
Messages: 2
Registered: September 2020
Junior Member
Hi,
I'm trying to create an OPC UA server on a Rasperry Pi with methods that trigger http GET and POST requests to a REST API to control another device. GET works fine according to the documentation but POST unfortunately does not. I tried a Client FB with:

- ID=http[<IP>:80/<PATH>?apikey=<XYZ>;POST;application/json;*]
- one SD={JSON String} input via a String2String FB
- two RDs to String2String FBs for the responses

So I need to send an "apikey" (as query parameter or header parameter) and a JSON string (as the body). According to the documentation (I guess there it means SD instead of RD in the http client data input section?) the query parameters are ignored when there is a SD input. I tried many variants and always got errors like:
- Client FB Status Output "No_Socket" or "Invalid_ID"
- forte errors like "You can use maximum 1 SD"

Can anybody help me with this issue or succesfully executed a http POST request already?
I'm grateful for every hint. Thanks!
Re: HTTP and OPC UA on Raspberry Pi [message #1832863 is a reply to message #1832844] Mon, 28 September 2020 06:42 Go to previous messageGo to next message
Jose Maria Jesus Cabral Lassalle is currently offline Jose Maria Jesus Cabral LassalleFriend
Messages: 199
Registered: February 2016
Senior Member
Hi

you're right. It should be SD instead of RD.

Regarding your specific problem, I assume that you won't be able to do it with the current state of the HTTP layer. As you noted, you can only send either using the SD or in the PARAMETERS.

Regarding the errors you get, check the log in forte. You should get more informaion there. I just rechecked the code, and it has changed the PARAM structure, but it's not in the documentation.

You should have it like:

ttp[IP:PORT/PATH?PARAMETERS; POST | PUT | GET ; content-type]

So the response code is gone, and content-type is optional (default to text/html)

The HTTP layer is not well supported and it was developed just for small testing. Feel free to improve it

Regards,

Jose
Re: HTTP and OPC UA on Raspberry Pi [message #1832866 is a reply to message #1832863] Mon, 28 September 2020 07:13 Go to previous message
Manuel Reif is currently offline Manuel ReifFriend
Messages: 2
Registered: September 2020
Junior Member
Hi,
thanks for your reply! I will test it a little bit more (and reply here in case I make progress) but as it is now I also have my doubts it will work for my usecase.

Thanks and regards
Manuel
Previous Topic:opc ua forte on Raspberry pi
Next Topic:Updating all types in application
Goto Forum:
  


Current Time: Mon Jun 14 10:08:55 GMT 2021

Powered by FUDForum. Page generated in 0.01653 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top