10-08-2015 11:05 PM
Hi!
I would like to be able to acquire data from diverse sensors that implement the CoAP protocol: http://coap.technology
It seems there is no native implementation in LabVIEW for this, but there are plenty for other platforms.
I guess one solution can be to deploy one those implementations and access them as a gateway from LabVIEW (ie a Phyton based one), but it will require to install and maintain additional software.
May I have your pointers on what can I do or where can I look to implement a client for CoAP devices in LabVIEW?
Quite appart, if someone is interested I have found this nice implementation of IBM's IoT services based on MQTT written in LabVIEW: https://developer.ibm.com/recipes/tutorials/national-instruments-labview-for-the-iot-foundation
Thank you guys!
10-12-2015 06:14 AM
From the looks of it, it's a HTTP REST-based protocol, so you can just use the HTTP Client VIs to make requests and get the response back. The url/headers/content of the request will change according to the specification but you might not need to implement the low-level HTTP functions. If you do, the HTTP protocol isn't too complicated to implement as a wrapper of the TCP/IP VIs.
10-13-2015 01:18 PM
Sam,
Thank you for your kind response.
I'm commited to make it work despite of my huge ignorance on this subject. Actually, now I'm headed in the direction you mention using the HTTPVIEWHTTPClient.lvlib.vi library in LabVIEW 2014 SP1.
However I haven't been able to sucessfully get a valid response from a public test server for CoAP.
First of all, I have to mention that CoAP is UDP based, not TCP. I'm wondering if those libraries can be used...
However, here it is my setup:
Using the URL coap://coap.me:5683/hello it should return "world" (I have tested this with Copper (Cu), an add-on for Firefox which is a CoAP client). Instead, I get the LabVIEW error code 363524 that states that the protocol is not supported.
If instead, I fire the URL http://coap.me/hello, I get the response [:error, "Not Found"] which is okay, as that is the same response I get from any web browser. Using the same with the port 5683, I mean: http://coap.me:5683/hello it provides a 363500 LabVIEW error, that states it does not get response from the server, which is what I expected, the server is not configured to listen at that port http requests...
Currently, I'm trying to figure it out how to work with the UDP functions, but in the meantime, if you have an additional input, I really would appreciate it.
Thank you!
10-13-2015 05:43 PM
Just an update: I concluded that the way to go is to use the UDP palette.
Currently I have been able to get a valid response from the test server after I placed a basic "header" according to the protocol.
Now I'm building on top of that.
Later I'll share my findings about this in case anyone else is interested.
Best regards
03-10-2016 04:35 AM
Hi MVidal,
Have you successfully designed the CoAP client in LabVIEW?
I have a similar problem - I need to design a CoAP server. I wonder if it will be too different from creating a CoAP client?
Regards.
03-10-2016 09:38 AM
Hi!
Yeah I was able to build it. Actually it was quite straight forward to write the client after reading the specification: http://tools.ietf.org/html/rfc7252
Altough I only implemented the parts that are useful in my case, which are quite basic and may not be a fully compliant one (ie. some Methods/Messages not implemented, No observer, etc), but it won't be that hard to add them. What I wasn't able to solve was the support of ipv6, as LabVIEW does not offer it, but it is ok in ipv4.
I'm sorry I don't have info about the server implementation. I haven't read about it. Though for your reference I found this link quite useful during my task: http://trac.tools.ietf.org/wg/core/trac/wiki/PlugFest
Good luck with your project!
01-05-2017 03:50 PM
Can you share an example .vi of you implementation? Thank you.
06-02-2022 06:54 AM
This replies with ACK:
08-29-2022 08:40 AM
So, you are looking for help, but you are not willing to share?
08-29-2022 08:53 AM
What do you mean? Did you notice the original post was about 7 years ago and that I have posted later about my findings the issues I have encountered?