05-02-2023 01:21 PM
I am acquiring data using the BOSCH XDK110 sensor and sending the collected data over MQTT to an IoT platform (https://akenza.io/). I want to now display the data onto LabVIEW from (https://akenza.io/).
I am using HTTP GET method but unsure how to use the API with the header to display the data.
I cant find any examples that use HTTP GET with an API. The examples are directed for HTTP GET basics. - I have tried the basic examples to display data to LabVIEW by connecting to platforms that require no further inputs other than a URL.
Has anyone managed to achieve something similar?
- Open to suggestions on how to retrieve the data (if there are other easier methods)
- Hoping for any example .vi's
Any advice towards achieving this is much appreciated
Solved! Go to Solution.
05-02-2023 03:05 PM
You are not setting the header correctly, check this edited version. You should probably create a new API key.
05-03-2023 04:25 AM
Thank you for tour response.
Unfortunately, this does not work either. I have tried this with a newly generated API
05-03-2023 07:09 AM
Ah, sorry, I should have paid more attentions to your error message, I just got an "unauthorized" message.
Have you seen this KB article: Error 363507 When Using the HTTP Client API in LabVIEW? I see that you are on LabVIEW 2015. Your certificates are probably outdated. You can either disable server verification, add the certificate to your ca store or update the ca store. This post has more details: https://lavag.org/topic/16601-labview-could-not-verify-the-authenticity-of-the-server/?do=findCommen...
My remark about the api key was because if you do not want others to access the data, you must revoke the api keys.
05-04-2023 01:39 PM
Yes I am using 2015. I have worked around this by using a newer version from a different PC but would like to get this resolved on the 2015 version.
- I tried to disable verification. This does not work either.
- what I would ideally like to do is 'update the ca store' as mentioned, however following the steps I have found I am not able to complete this. The links attached are what I tried to use:
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019P6VSAU&l=en-GB
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019YHDSA2&l=en-GB
This is where i am having the issues when following these steps:
4.Enter the following commands to generate an RSA self-signed certificate:
openssl x509 -req -in mydevice.csr -out mydevice.crt -CA testcacert.pem - Cakey privkey.pem -Cacreateserial
openssl genrsa -out privkey.pem 1024
- with regards to the API key, yes I will revoke the key.
05-04-2023 03:14 PM - edited 05-04-2023 03:22 PM
That does not apply in this case, since you are not connecting to a server for which you have a private key.
Since api.akenza.io uses a Let's Encrypt certificate, you should be able to download the ISRG Root X1 certificate from https://letsencrypt.org/certificates/ and point ConfigSSL.vi to that CA certificate file. You can also append the contents of that file to your ca-bundle.crt.
Edit: You may also want to look at this site on how to get an update version of the ca bundle: https://curl.se/docs/caextract.html
05-05-2023 04:32 AM
In my experience just updating the CA bundle is sometimes not enough. That NI HTTPS Client library uses under the hood a NI build of libcurl and that then uses an NI Build of OpenSSL.
This is actually necessary since both projects and especially OpenSSL do not only not guarantee ABI compatibility, but very regularly break it.
The OpenSSL version used in the ni-OpenSSL 2015 library is however at best at version 1.0.2 but more likely 1.0.1, since 1.0.2 was released in January 2015. That is a very ancient version for an SSL implementation and most modern web servers will not really care to try to support it, freely after the motto: if it works it works, if it doesn’t it’s really the webclients problem!
Now there is a solution for this by installing a newer version of these components. The binary libraries are actually a shared component between National Instruments software products. Installing a new version of LabVIEW will actually make other versions of LabVIEW use those components too. If you have some installation of a newer LabVIEW Professional version laying around somewhere, you can relatively easily create a mini installer for these components by creating a project and in there an installer that selects the according NI Curl and NI Open SSL components as additional installs. I had very good results for an application build in LabVIEW 2013 that used those components from LabVIEW 2020 to communicate with REST servers that were secured with fairly recent SSL protocol settings.