Virtuino Forum
Mobile APP + other IOT - Printable Version

+- Virtuino Forum (https://virtuino.com/forum)
+-- Forum: Virtuino (https://virtuino.com/forum/forumdisplay.php?fid=1)
+--- Forum: Virtuino IoT (https://virtuino.com/forum/forumdisplay.php?fid=2)
+--- Thread: Mobile APP + other IOT (/showthread.php?tid=2276)



Mobile APP + other IOT - Buczkowski - 06-03-2024

Hello
Is it possible to connect the application to another IoT cloud? I mean exactly Thinger.io
I would like to read some thermometers, relays and charts.

Thank You


RE: Mobile APP + other IOT - iliaslamprou - 06-04-2024

Hi, 
yes of course. The app supports any MQTT broker and HTTP api
Too many users use the Thinger.io platform with Virtuino


RE: Mobile APP + other IOT - Buczkowski - 06-04-2024

This is very good news
Can you help me configure the connection and reading data from the HTML API?
I have a token and API addresses, but I don't know whether it should be in the server or widget settings.
Thank you very much!


RE: Mobile APP + other IOT - iliaslamprou - 06-05-2024

Hi, 
for an Http Api connection the only you have to do is to add the script "Http Request".
Go to the "Scripts & Tools". Select "Http Request".
Then configute the Http request and test it.
Store the request result to an Emulator Variable.
Add a "Value display" to display the variable to the screen.


RE: Mobile APP + other IOT - Buczkowski - 06-06-2024

(06-05-2024, 07:33 PM)iliaslamprou Wrote: Hi, 
for an Http Api connection the only you have to do is to add the script "Http Request".
Go to the "Scripts & Tools". Select "Http Request".
Then configute the Http request and test it.
Store the request result to an Emulator Variable.
Add a "Value display" to display the variable to the screen.

Thank you very much for help.
I have a url and I have a token.
I need to provide authorization. Am I doing this in the header?
key = token
value = ?

please help Smile
Thank you very much


RE: Mobile APP + other IOT - iliaslamprou - 06-09-2024

Hi,
I think you have to enter the token and the value to the "params".
You have to check the Documentation API of the HTTP server.
This is an example of the Thingspeak platform
https://www.mathworks.com/help/thingspeak/readdata.html


RE: Mobile APP + other IOT - Buczkowski - 06-10-2024

Hi
The problem is lack of authorization. Exactly the same as pasting the api address and not confirming it
"{"error":{"message":"unauthorized"}}"

The ability to read it in HTML is very simple

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Reading data from API</title>
</head>
<body>
    <h1>API</h1>
    <div id="data-container">
        <p>Loading...</p>
    </div>

    <script>
        document.addEventListener("DOMContentLoaded", function() {
            const url = "https://backend.thinger.io/v3/users/.....";
            const token = "eyJhbGci...........";

            fetch(url, {
                method: 'GET',
                headers: {
                    'Authorization': 'Bearer' + token
                }
            })
            .then(response => response.json())
            .then(date => {
                const dataContainer = document.getElementById('data-container');
                dataContainer.innerHTML = `
                    <p>temp1: ${data.temp1}°C</p>
                    <p>temp2: ${data.temp2}°C</p>
                   
                `;
            })
            .catch(error => {
                console.error('Error:', error);
                document.getElementById('data-container').innerHTML = '<p>error</p>';
            });
        });
    </script>
</body>
</html>

but unfortunately I don't know how to read this data in the application. Sad


RE: Mobile APP + other IOT - iliaslamprou - 06-11-2024

Hi,
it is ery easy to get data from tis url.
The settings are in the attached image.

Please try to get the data using an Http clicnt from the web first, like the "postman".
Then enetr the same setting to the app


RE: Mobile APP + other IOT - Buczkowski - 06-14-2024

(06-11-2024, 09:35 PM)iliaslamprou Wrote: Hi,
it is ery easy to get data from tis url.
The settings are in the attached image.

Please try to get the data using an Http clicnt from the web first, like the "postman".
Then enetr the same setting to the 

Unfortunately, the attempt to connect according to the photo fails. I tried to connect to blynk using the http API - it works without a problem, but the token is in the http address. Any idea to help Smile The problem is still with authorization

(06-13-2024, 09:39 AM)futurmagnussen Wrote: Absolutely, connecting your application to Thinger.io to read data from thermometers, relays, and charts is possible! Need more information let me know.

What information do you need?