Thinger.io

Apr 21, 2024

Raspberry Pi:

Requisitos--Requirements:

Install dependencies:

WiringPi:

Make a Thinger.io account:

https://console.thinger.io/signup

Presionamos--Press +Create Device

Rellenamos el formulario--Fill the form:

Presionamos--Press Green button Add Device

Clonamos el Cliente para Linux, entramos a la carpeta clonada--Clone the Linux Client and move to the new directory:

Ahora agregamosnuestros datos en--Now we need to add our data to main.cpp:

Buscamos las siguientes constantes y las definimos con nuestros datos--Look for the next constants and define them with your data:

Luego de editado guadamos y cerramos--After edit save and close:

Compillamos con el--Compille with the script run.sh:

Si todo va bien veremos como el programa será compilado y ejecutado automáticamente.--If all works fine, it should be compiled and executed automatically.

Regresamos al Dashboard de thinger.io y veremos nuestras Raspberry Pi conectada--Back to the thinger.io's Dashboard and we can see our Raspberry Pi connected:

Statistics

Status

Para probar seleccionamo Device Raspberry Pestaña API --> sum e ingresamos 2 valores en Resource Input, tras lo cual pulsamos Run:

Podemos observar que la API solo suma enteros, ya que nuestra Pi le ha devuelto un entero--We can see that the API just sum integers, our Pi back just an integer.

Si pulsamos--If we push Show Query we can see--Podremos ver:

Overview
Curl
Info

Ahora si cerramos la Terminal la conexión se cierra-- Now  if we close the Terminal the conection will be closed.

Así que instalaremos el Cliente como un Daemon --So we install the Client like a Daemon to start automatically when the pi boot up.

Cerramos la Terminal actual y abrimos una nueva, nos movemos al siguiente directorio--Close the current Terminal and open a new one, we move to the next path:

Daremos permisos de ejecución al--We need to give executable perms to the script install.sh:

Luego lo ejecutamos--Then we run it:

Esto copiará un--This will copy an init script a--to /etc/init.d/thinger y copiara el binario compilado a--and copy the binary to /usr/local/bin/thinger

Ahora podemos hacer lo que queramos programando la Raspberry Pi en cpp.--Now we can program our Raspberry Pi in cpp:

Desinstalar--Uninstall:

Así que, para remover el Daemon deberemos detener el servicio y luego eliminar esos 2 archivos si ya no queremos utilizar thinger.io--So to remove the Daemon we need to stop the service and the delete those files if we dont use thinger.io anymore:

Docs:

Arduino:

Abrimos--Open Arduino IDE

Vamos a la opción:

Ethernet shield

Donde debemos editar--We need edit:

WiFi Shield:

Donde debemos editar--We need edit:

Como vemos solo con agregar unas líneas a nuestro código ya estaremos online y al contrario que Raspberry Pi podemos fácilmente integrar nuestros códigos de siempre. Pero también tiene su propia sintaxis si deseamos usarla. Soporta muchas placas más, no solo Arduino y Raspberry Pi.

As we can see, just by adding a few lines to our code we will already be online and unlike the Raspberry Pi we can easily integrate our usual codes. But it also has its own syntax if we want to use it. It supports many more boards, not just Arduino and Raspberry Pi.