Arduino Yun + SSMTP
¿Que es SSMTP?
SSMTP es una herramienta que permite enviar correos (email) por medio de comando desde el terminal.Por ejemplo, se puede crear un código en Arduino donde te envié un email cuando se active un sensor (puede ser un sensor de movimiento, luz, etc).
Instalación
En mi caso me conecto al Arduino Yun por SSH ocupando Putty.
opkg update
opkg install ssmtp
nano /etc/ssmtp/ssmtp.conf
Se configura del siguiente modo:
*El documento se guarda con las teclas control+o y se sale del editor nano con control+x
Le aplicamos un actualización de seguridad al archivo
# The user that gets all the mails (UID < 1000, usually the admin)
root=tucorreo@gmail.com
# The mail server (where the mail is sent to), both port 465 or 587 should be acceptable
# See also http://mail.google.com/support/bin/answer.py?answer=78799
mailhub=smtp.gmail.com:587
# The address where the mail appears to come from for user authentication.
rewriteDomain=gmail.com
# The full hostname
hostname=YUN
# Use SSL/TLS before starting negotiation
UseTLS=Yes
UseSTARTTLS=Yes
# Username/Password
AuthUser=tucorreo@gmail.com
AuthPass=contraseña
# Email 'From header's can override the default domain?
FromLineOverride=yes
root=tucorreo@gmail.com
# The mail server (where the mail is sent to), both port 465 or 587 should be acceptable
# See also http://mail.google.com/support/bin/answer.py?answer=78799
mailhub=smtp.gmail.com:587
# The address where the mail appears to come from for user authentication.
rewriteDomain=gmail.com
# The full hostname
hostname=YUN
# Use SSL/TLS before starting negotiation
UseTLS=Yes
UseSTARTTLS=Yes
# Username/Password
AuthUser=tucorreo@gmail.com
AuthPass=contraseña
# Email 'From header's can override the default domain?
FromLineOverride=yes
Le aplicamos un actualización de seguridad al archivo
chmod 640 /etc/ssmtp/ssmtp.conf
Con el siguiente comando se envía un email con el contenido "hola mundo"
echo "hola mundo" | ssmtp emaildedestino@gmail.com
Suscribirse a:
Enviar comentarios
(
Atom
)
Buen aporte, me ayudo muchisimo... Gracias!
ResponderEliminarDe nada, gracias por visitar mi blog :)
Eliminar