User Tools

Site Tools


raspberry_pi:projects:temperature_sensor

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
raspberry_pi:projects:temperature_sensor [2025/02/05 15:23] jmbargalloraspberry_pi:projects:temperature_sensor [2025/02/19 08:59] (current) 195.53.121.100
Line 1: Line 1:
-======  Sistema de comprovació de temperatures del CPD (raspi) ======+====== Temperature Verification System for CPD (Raspi) ======
  
 +====== Initial Raspberry Pi Setup ======
  
-====== Configuracio inicial raspberry pi ======+See chapter on Initial Raspberry Pi Setup
  
-Veure capitol configuració inicial Raspberry+==== OS for RPI ====
  
-==== OS per RPI ====+Download the Raspbian/Lite image from https://www.raspberrypi.org/downloads/raspbian/
  
 +Download the Win32 Disk Imager program from http://sourceforge.net/projects/win32diskimager/
  
-Obtindre imatge Raspbian/Lite desde https://www.raspberrypi.org/downloads/raspbian/+Start Win32 Disk Imager and select the downloaded Raspbian image (.img file) with the "Image File" selector. Choose the drive letter where the SD card is and click "Write".
  
-Obtindre programa Win32 Disk Imager http://sourceforge.net/projects/win32diskimager/+Imager will ask for confirmation to overwrite. Select "Yes". Wait for the confirmation and click "OK", then close Disk Imager and remove the SD card.
  
-Iniciar Win32 Disk Imager y seleccionar la imatge Rapsbian descarregada (.img file) amb el selector "Image File". Seleccionar la lletra on es la SD y "Write".+==== Basic Raspberry Pi Setup ====
  
-Imager demana confirmar sobreescritura. Seleccionar "Yes". Esprar a la confirmacio y  "OK", tancar Disk Imager y extreure la SD card.+Insert the SD card into the Raspberry Pi (connect the keyboard and display before connecting the power).
  
-==== ajust basic Raspberry Pi ====+The Raspberry Pi will boot and ask for a username and password.
  
- +By default, they are:
-Insertar la SD card a la Raspberry Pi (Conectar teclat y display abans de conectar la alimentacio). +
- +
-Rasperry Pi arrenca i demana username y password. +
- +
-Per defecte son :+
  
 username: **pi** username: **pi**
Line 30: Line 27:
 password: **raspberry** password: **raspberry**
  
-Despres de arrencar es pot entrar a configuracio amb:+After booting, you can enter the configuration with:
  
 <code bash>sudo raspi-config</code>  <code bash>sudo raspi-config</code> 
  
-A la configuracio:+In the configuration:
  
-   Cambiar password/username si es creu necessari +   Change password/username if needed 
-     +   Configure boot to console, smb option 1, console. 
-   Configurar arrencada per consola smb option 1, console. +   Adjust/check time/language/keyboard settings
-     +   In the interfacing optionsselect P2 - SSH enable 
-   Ajustar/comprobar configuracio de Hora/idioma/teclat+   - Open advanced options -> Expand filesystem
-     +
-   De les opcions de interfacing , seleccionar P2 - SSH  enable  +
-     +
-   Open advanced options ->  Expand filesystem+
      
-Finalment anar a "Finish" i reiniciar RPI amb:+Finally, go to "Finish" and reboot the Raspberry Pi with:
  
 <code bash>sudo reboot</code> <code bash>sudo reboot</code>
  
-==== connexio PC(SSH) ====+==== PC Connection (SSH) ====
  
 +From Windows, you can use PuTTY: http://www.chiark.greenend.org.uk/~sgtatham/putty....
  
- +To find the Raspberry Pi's IP, you can use:
- Desde Windows es pot fer servir PuTTY  http://www.chiark.greenend.org.uk/~sgtatham/putty.... +
- +
-Per saber la ip de la Raspberry es pot fer servir:+
  
 <code>ifconfig</code> <code>ifconfig</code>
  
-==== cablejat Sensor==== +==== Sensor Wiring ====
- +
-{{ :raspberry_pi:projects:raspberrypi-gpio-esquema-conexion-sensor-dht22-am2302.png?600 |}}+
  
-==== instal.lacio llibreries DHT22 ==== +{{ :raspberry_pi:projects:raspberrypi-gpio-connection-sensor-dht22-am2302.png?300 |}}
- +
  
 +==== Install DHT22 Libraries ====
  
-Actualitzar la Raspberry pi.+Update the Raspberry Pi:
  
 <code bash>sudo apt-get update <code bash>sudo apt-get update
Line 74: Line 63:
 sudo apt-get upgrade</code> sudo apt-get upgrade</code>
  
-Install Adafruit Python code. Necezsari per llegir el sensor DHT22Tambe pèrmet comprovar que tot esta montat correctament.+Install Adafruit Python code, necessary for reading the DHT22 sensor. It also allows checking if everything is set up correctly.
  
-Primerinstalar compilador y llibreria python +Firstinstall the compiler and Python library:
  
 <code bash>sudo apt-get install build-essential python-dev python-openssl</code> <code bash>sudo apt-get install build-essential python-dev python-openssl</code>
  
-Situarse al directori on es vol instal.lar  el codi Adafruit , per defecte /home/+Navigate to the directory where you want to install the Adafruit codeby default /home/.
  
 <code bash>cd /home/pi</code> <code bash>cd /home/pi</code>
  
-Pot fer falta instl.lar Git si no esta inclos per defecte:+You may need to install Git if it's not included by default:
  
 <code bash>sudo apt-get install git</code> <code bash>sudo apt-get install git</code>
  
-Clonar el repositori git: +Clone the git repository:
  
 <code bash>git clone https://github.com/adafruit/Adafruit_Python_DHT.g...</code> <code bash>git clone https://github.com/adafruit/Adafruit_Python_DHT.g...</code>
  
-Anar al directori corresponent:+Go to the corresponding directory:
  
 <code bash>cd Adafruit_Python_DHT</code> <code bash>cd Adafruit_Python_DHT</code>
  
- +And finallyinstall the Adafruit library. Type the following and press enter:
-And finally install the Adafruit library. Type following and press enter.+
  
 <code bash>sudo python setup.py install</code> <code bash>sudo python setup.py install</code>
  
-==== prova del DHT22 ====+==== DHT22 Test ====
  
- +Navigate to the Adafruit_Python_DHT directory and then to the examples directoryEnter the following and press enter.
-Anar al directori Adafruit_Python_DHT y despres al directori examples. Entrar el seguent i pulsar enter enter.+
  
 <code bash>cd /home/pi/Adafruit_Python_DHT/examples</code> <code bash>cd /home/pi/Adafruit_Python_DHT/examples</code>
  
-provar el funcionament amb:+Test the operation with:
  
-<code bash>sudo ./AdafruitDHT.py sensortipus GPIO</code>+<code bash>sudo ./AdafruitDHT.py sensortype GPIO</code>
  
-En el cas del cablejat del texte:+In the case of the wiring from the text:
  
 <code bash>sudo ./AdafruitDHT.py 22 4</code> <code bash>sudo ./AdafruitDHT.py 22 4</code>
  
-Si tot esta okes veura la lectura del sensor. +If everything is correctthe sensor reading will appear.
- +
-==== configuracio MySql per guardar dades Temperatura ====+
  
 +==== MySQL Configuration for Storing Temperature Data ====
  
-Instalar Mysql/MariaDb y els complements necesaris:+Install MySQL/MariaDB and the necessary plugins:
  
 <code>sudo apt-get install mysql-server python-mysqldb</code> <code>sudo apt-get install mysql-server python-mysqldb</code>
  
-Entrar al mode consola de sql.+Enter the SQL console:
  
 <code>sudo mysql -u root -p -h localhost</code> <code>sudo mysql -u root -p -h localhost</code>
  
-Pulsar Enter per password (buit)y entrarem en la consola MariaDb +Press Enter for the password (empty), and we will enter the MariaDB console.
  
-Sobre consola+On the console:
  
-Primercrear base de dades temperatures:+Firstcreate a database called temperatures:
  
 <code sql>CREATE DATABASE temperatures;</code> <code sql>CREATE DATABASE temperatures;</code>
  
-Seleccionar la base de dades creada:+Select the created database:
  
 <code sql>USE temperatures;</code> <code sql>USE temperatures;</code>
  
-Crear usuari i garantir acces la base de dades a aquest usuari:+Create user and grant access to the database to this user:
  
 <code sql>CREATE USER 'logger'@'localhost' IDENTIFIED BY 'password'; <code sql>CREATE USER 'logger'@'localhost' IDENTIFIED BY 'password';
Line 149: Line 135:
 FLUSH PRIVILEGES;</code> FLUSH PRIVILEGES;</code>
  
-El usuari/privilegis estan creatsAra es possible cambiar de l´usuari root a aquest nou usuari:+The user/privileges are createdNow, you can switch from the root user to this new user:
  
 <code sql>quit</code> <code sql>quit</code>
  
-Tornar a conectar amb el nou usuari+Reconnect with the new user:
  
 <code>sudo mysql -u logger -p -h localhost</code> <code>sudo mysql -u logger -p -h localhost</code>
  
-Donar la contrasenya implementada al pas anterior.+Enter the password created earlier.
  
-Crear dues taules. Temperaturedata per guardar les dades del sensor data/hora y mailsendlog that amb informacio del correus que han superat els limits de temperatura.+Create two tables: `temperaturedata` to store the sensor data (date/time, sensor, temperature, humidity) and `mailsendlog` with information about emails triggered by temperature limits.
  
-Per crear les taules:+To create the tables:
  
 <code sql>USE temperatures;</code> <code sql>USE temperatures;</code>
  
-Crear la primera taula amb les columnes dateandtime, sensor, temperature humidity:+Create the first table with columns for date/time, sensor, temperature, and humidity:
  
 <code sql>CREATE TABLE temperaturedata (dateandtime DATETIME, sensor VARCHAR(32), temperature DOUBLE, humidity DOUBLE);</code> <code sql>CREATE TABLE temperaturedata (dateandtime DATETIME, sensor VARCHAR(32), temperature DOUBLE, humidity DOUBLE);</code>
  
-Crear segona taula amb columnes dateandtimetriggedsensortriggedlimit y lasttemperature:+Create the second table with columns for date/timetriggered sensortriggered limit, and last temperature:
  
 <code sql>CREATE TABLE mailsendlog (mailsendtime DATETIME, triggedsensor VARCHAR(32), triggedlimit VARCHAR(10), lasttemperature VARCHAR(10));</code> <code sql>CREATE TABLE mailsendlog (mailsendtime DATETIME, triggedsensor VARCHAR(32), triggedlimit VARCHAR(10), lasttemperature VARCHAR(10));</code>
  
-Es pot confirmar, que les taules buides estan creades amb:+You can confirm that the empty tables were created with:
  
-<code sql >SELECT * FROM mailsendlog;+<code sql>SELECT * FROM mailsendlog;
 SELECT * FROM temperaturedata;</code> SELECT * FROM temperaturedata;</code>
  
-Si les taules exiteixenes veura: "Empty Set (0.00 sec)"+If the tables existyou will see: "Empty Set (0.00 sec)"
  
-La base de dades esta configurada es pot sortir de mysql:+The database is configured, and you can exit MySQL:
  
 <code>quit</code> <code>quit</code>
  
-Reiniciar mysql perque els canvis tinguin efecte:+Restart MySQL to apply the changes:
  
 <code>sudo /etc/init.d/mysql restart</code> <code>sudo /etc/init.d/mysql restart</code>
  
 +==== Temperature Logger Code ====
  
-==== temperature Logger Code ====+Make sure you are in the directory where you want to install the DHT22-TemperatureLogger, by default /home/pi/:
  
 +<code bash>cd /home/pi</code>
  
-Asegurarse de estar en el directori on es vol instal.lar el DHT22-TemperatureLogger, per defecte /home/pi/: +Clone the git repository:
- +
-<code bash >cd /home/pi</code> +
- +
-Clonar el respositori git:+
  
 <code bash>git clone https://github.com/jjpFin/DHT22-TemperatureLogger</code> <code bash>git clone https://github.com/jjpFin/DHT22-TemperatureLogger</code>
  
-Anar al directori DHT22-TemperatureLogger: +Go to the DHT22-TemperatureLogger directory:
  
 <code bash>cd /home/pi/DHT22-TemperatureLogger</code> <code bash>cd /home/pi/DHT22-TemperatureLogger</code>
  
-Obrir config.json en un editor:+Open `config.json` in an editor:
  
 <code bash>sudo nano config.json</code> <code bash>sudo nano config.json</code>
  
-Llistat de configuracions:+Configuration list:
  
 <code python> <code python>
-#mysql:Configuracio de la base de dades.+#mysql: Database configuration.
  
-#sensors: Configuracions per els sensor conectats a la RPI.+#sensors: Configuration for the sensors connected to the RPI.
  
-#name: nom dels sensor GPIO on esta conectat.+#name: sensor name and GPIO where it is connected.
  
-#SensorType: 22 per un dht22 .+#SensorType: 22 for a DHT22.
  
-#Temperature low and high  limits per llençar els correus de alerta.+#Temperature low and high limits to trigger alert emails.
  
-#Humidity limits igual per humitat.+#Humidity limits similarly for humidity.
  
-#Threshold :llindar de activacio de advertencies.+#Threshold: activation threshold for warnings.
  
-#mailInfo: Informacio per els email+#mailInfo: Email information.
  
-#Senderaddress: Remitent dels correus.+#Senderaddress: Email sender address.
  
-#Receiveraddress: Receptor dels correus.+#Receiveraddress: Email receiver address.
  
-#Username: nom usuari correu.+#Username: email username.
  
-#Password: password  email de enviamaent.+#Password: email password.
  
-#subjectMessage: Capçalera del correu.+#subjectMessage: Email subject.
  
-#subjectWarning: Motiu del correu.+#subjectWarning: Reason for the email.
  
-#sqlBackupDump: configuracio Backup dumps.+#sqlBackupDump: backup dump configuration.
  
-#BackupDumpEnabled y/n indica si es vol backup de sql.+#BackupDumpEnabled y/n indicates if SQL backup is enabled.
  
-#backupDay dia per el backup. 1-7 (Monday to Sunday) 0 daily.+#backupDay: day for the backup. 1-7 (Monday to Sunday) 0 daily.
  
-#backupHour hora del dump - 0-24+#backupHour: hour of the dump - 0-24
  
-#backupDumpPath  path on dump es guardatPer defecte carpeta Backups.+#backupDumpPathpath where the dump is savedBy default, the Backups folder.
  
-#weeklyAverages: Define si s´envien promitjos setmanals.+#weeklyAverages: Define if weekly averages are sent.
  
-#weeklyAveragesSendingEnabled:significa activat.+#weeklyAveragesSendingEnabled:means enabled.
  
-#weekDayForSendingAverages: dia de la setmana dels promitjos. 1-7 (Monday to Sunday)+#weekDayForSendingAverages: day of the week for averages. 1-7 (Monday to Sunday).
  
-#hourOfTheDayForSendingAverages: hora del dia 0-24.+#hourOfTheDayForSendingAverages: hour of the day 0-24.
  
-#useFahrenheits: y enabled, n disabled. +#useFahrenheits: y enabled, n disabled.
  
 #mailSendingTimeoutInFullHours: 0-x #mailSendingTimeoutInFullHours: 0-x
  
-#Per reduir spam. 0, logger envia mail a cada advertenciaValors mes alts limiten els correus a un per horaUtilitzat perque la #safata de entrada no es pleni de advertencies.+#To reduce spam. At 0, logger sends mail for each warningHigher values limit the emails to one per hourUsed to prevent inbox from being flooded with alerts.
  
-#adafruitPath:  path per Adafruit_Python_DHT  per defecte/home/pi/Adafruit_Python_DHT/ Script AdafruitDHT.py.+#adafruitPath: path for Adafruit_Python_DHT, by default /home/pi/Adafruit_Python_DHT/ Script AdafruitDHT.py.
 </code> </code>
  
-Un cop fetes les configuracionspremer Ctrl+x y guardar amb "Y"Provar el funcionament del DHT22-TemperatureLogger :+Once the configurations are donepress Ctrl+x and save with "Y"Test the DHT22-TemperatureLogger:
  
-<code bash >python DHT22logger.py</code>+<code bash>python DHT22logger.py</code>
  
-Si tot es correcte el programa escriura a la base de dades per comprovar que es aixi entrar a la base de dades:+If everything is correct, the program will write to the database. To verify, enter the database:
  
 <code bash>sudo mysql -u logger -p -h localhost</code> <code bash>sudo mysql -u logger -p -h localhost</code>
  
-Posar la password corresponentA la consola mysql:+Enter the corresponding password. In the MySQL console:
  
 <code sql>use temperatures; <code sql>use temperatures;
Line 280: Line 264:
 select * from temperaturedata;</code> select * from temperaturedata;</code>
  
-Comprovar que les lectures s´escriuen a la base de dades, per sortir:+Verify that the readings are written to the database. To exit:
  
 <code sql>quit</code> <code sql>quit</code>
  
-==== lectura automatica Sensor ====+==== Automatic Sensor Reading ====
  
- +Add a cron task:
-Afegir una tasca crontab:+
  
 <code>crontab -e</code> <code>crontab -e</code>
  
-Seleccionar opcio /bin/nano y s´obrira el crontab.+Select the /bin/nano option, and the crontab will open.
  
-Afegir al crontab la tasca (per exemple cada 15 minuts).+Add the task to the crontab (for example, every 15 minutes):
  
 <code>*/15 * * * * python /home/pi/DHT22-TemperatureLogger/DHT22logger.py</code> <code>*/15 * * * * python /home/pi/DHT22-TemperatureLogger/DHT22logger.py</code>
  
-Sortir i guardar Ctrl+x seleccionant "Y" quan es pregunti.+Exit and save with Ctrl+x, selecting "Y" when asked.
  
-==== Configurar IP estatica Raspbian ====+==== Configure Static IP for Raspbian ====
  
-Per configurar una IP estática a Raspbian s´ha de edoitar el fitxer /etc/dhcpcd.conf :+To configure static IP in Raspbian, you need to edit the file `/etc/dhcpcd.conf`:
  
 <code>sudo nano /etc/dhcpcd.conf</code> <code>sudo nano /etc/dhcpcd.conf</code>
  
-Si mirem el contingut veurem linies comentades (comencen amb '#'que tenen un exemple de configuració IP estática+If you look at the content, you will see commented lines (starting with '#'that provide an example of static IP configuration:
  
 <code> <code>
Line 316: Line 299:
 </code> </code>
  
-==== thinkspeak ==== +==== ThinkSpeak ====
- +
- +
-==== Configuració del compte de ThingSpeak.com ==== +
  
-Registrar-se a https://thingspeak.com +==== ThingSpeak Account Configuration ==== 
-Si no tenim compte previ a MathWorks ThingSpeak ens redirigueix, amb la possibilitat de emprar el amteix mail per el registre a:https://www.mathworks.com.+
  
-Crear un nou channel al nostre perfil i afegir dos field chart (Temperatura i Humitat)+Register at https://thingspeak.com.  
-Obtindre el "Write API Key" del channel creat servira per configurar el script de conexio thingspeak i enviament de dades.+If you don't have previous account with MathWorks, ThingSpeak will redirect you, with the option to use the same email to register at: https://www.mathworks.com.
  
-====Script Python per el envíament de dades al compte de ThingSpeak ts.py ====+Create a new channel in your profile and add two field charts (Temperature and Humidity). 
 +Get the "Write API Key" for the created channel, which will be used to configure the ThingSpeak connection script and data submission.
  
 +==== Python Script for Sending Data to ThingSpeak ts.py ==== 
  
 <code python> <code python>
Line 338: Line 318:
     # Write API Key ThingSpeak.com     # Write API Key ThingSpeak.com
     miWriteAPIKey = "XXXXXXXXXXXXXXXX"     miWriteAPIKey = "XXXXXXXXXXXXXXXX"
-    # Número GPIO de conexión out del sensor dht22 a RaspberryPi+    # GPIO number for DHT22 sensor connection to RaspberryPi
     raspiNumGPIO = "X"     raspiNumGPIO = "X"
     def getSensorData():     def getSensorData():
Line 344: Line 324:
        return (str(RH), str(T))        return (str(RH), str(T))
     def main():     def main():
-       print 'Iniciando...'+       print 'Starting...'
        baseURL = 'https://api.thingspeak.com/update?api_key=%s' % miWriteAPIKey        baseURL = 'https://api.thingspeak.com/update?api_key=%s' % miWriteAPIKey
        while True:        while True:
Line 354: Line 334:
                sleep(5)                sleep(5)
            except:            except:
-               print 'Terminado.'+               print 'Done.'
                break                break
     if __name__ == '__main__':     if __name__ == '__main__':
     main()     main()
 </code> </code>
-==== Canvis al codi basic ==== 
  
 +==== Changes to the Basic Code ==== 
  
-miWriteAPIKey introduir la Write API Key del compte corresponent de thingspeak corresponent control-temperatures@fidmag.com.+In `miWriteAPIKey`, input the Write API Key for the corresponding account at thingspeak.
  
 <code>miWriteAPIKey = "XXXXXXXXXXXXXXXX"</code> <code>miWriteAPIKey = "XXXXXXXXXXXXXXXX"</code>
  
-Canviat:+Change:
  
 <code>f = urllib2.urlopen(baseURL + "&field2=%s&field1=%s" % (RH, T))</code> <code>f = urllib2.urlopen(baseURL + "&field2=%s&field1=%s" % (RH, T))</code>
  
-S´ha canviat l´ordre per que apareixi primer la temperatura que es la dada mes rellevant. +The order has been switched so the temperature appears first, as it is the most important data.
-==== automatitzar l´enviament de dades ====+
  
 +==== Automate Data Sending ==== 
  
-Afegir una tasca crontab:+Add a cron task:
  
 <code bash>crontab -e</code> <code bash>crontab -e</code>
  
-Seleccionar opcio /bin/nano y s´obrira el crontab.+Select the /bin/nano option, and the crontab will open.
  
-Afegir al crontab la tasca (per exemple cada 15 minuts).+Add the task to the crontab (for example, every 15 minutes):
  
-<code >*/15 * * * * python /home/pi/Adafruit_Python_DHT/DHT22-TemperatureLogger/ts.py</code>+<code>*/15 * * * * python /home/pi/Adafruit_Python_DHT/DHT22-TemperatureLogger/ts.py</code>
  
-Sortir i guardar Ctrl+x seleccionant "Y" quan es pregunti. +Exit and save with Ctrl+x, selecting "Y" when asked.
- +
- +
-==== Canals Thingspeak ====+
  
 +==== ThingSpeak Channels ==== 
  
   * [[https://thingspeak.com/channels/1285244/charts/1?bgcolor=%23ffffff&color=%23d62020&dynamic=true&results=60&type=line&update=15]]   * [[https://thingspeak.com/channels/1285244/charts/1?bgcolor=%23ffffff&color=%23d62020&dynamic=true&results=60&type=line&update=15]]
   * [[https://thingspeak.com/channels/1285244/charts/2?bgcolor=%23ffffff&color=%23d62020&dynamic=true&results=60&type=line&update=15]]   * [[https://thingspeak.com/channels/1285244/charts/2?bgcolor=%23ffffff&color=%23d62020&dynamic=true&results=60&type=line&update=15]]
  
-==== enviament de e-mails de alerta amb thingspeak ====+==== Sending Alert Emails with ThingSpeak ==== 
  
 +==== MATLAB Analysis to Send Emails ==== 
  
-==== fer un analisi MATLAB per enviar el mail ==== +  Obtain an "alert API key" from Accounts>My profile. The alert APIs start with "TAK". 
- +  * Create a new MATLAB Analysis in Apps>MATLAB Analysis. Click "new" at the top and choose the blank template, then write or paste the following code:
- +
-  Obtindre una "alert API key" desde Accounts>My profile. Les API de alertes comencen amb   "TAK" +
-  * Crear un nou MathLab Analysis Apps>MathLab Analysis. Clickar "new" a la part superiort i escollir la plantilla en blanc i escriure o enganxar el seguent codi: +
- +
  
 <code> <code>
Line 413: Line 388:
 </code> </code>
  
-  * Ajustar el alert body, subject y la (alertAPI key. +  * Adjust the alert body, subject, and the alert API key. 
-  * Click "save and Run" i es rebrá un email en uns pocs instants+  * Click "save and Run", and an email will be received in a few moments
-  * Conectar el MATLAB Analysis TimeControl React  que depengui del valor del canal en el que estas interessat.+  * Connect the MATLAB Analysis to TimeControl or React depending on the channel value you are interested in.
  
 {{:fidmag:projectes:temperatures:mail.jpg?400|}} {{:fidmag:projectes:temperatures:mail.jpg?400|}}
  
-==== React App ====+==== React App ====  
 + 
 +React works with MATLAB® Analysis to take actions when the channel data meets certain conditions. 
 + 
 +==== Define Reactions to Channel Data ====  
 + 
 +Select Apps>React 
 + 
 +  - Click "New React" 
 +  - Select Options 
 +{{:fidmag:projectes:temperatures:react.jpg?400|}} 
 + 
 +  * React name: Name the alert 
 +  * Condition Type: Choose if the condition is a string, numeric, etc., in our case numeric 
 +  * Test Frequency: The frequency when the React should check 
 +  * React to Data in this channel: choose channel 
 +  * Input condition: define the value that triggers the alert. 
 + 
 +The data that meets the conditions triggers a callback, either an HTTP request or an email.
  
 +==== History of Alerts ==== 
  
-React treballa amb MATLAB® Analysis  per fer accions quan les dades del canal compleixen unes determinades condicions.+After running the app, go to the Dashboard>Activity. It will show the last sent emails or actions that have been triggered.
  
 ==== Definir Reaccions a les dades del canal==== ==== Definir Reaccions a les dades del canal====
raspberry_pi/projects/temperature_sensor.1738769007.txt.gz · Last modified: 2025/02/05 15:23 by jmbargallo