View demoRelay.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ESP8266WiFi.h> | |
#include <PubSubClient.h> | |
const char* ssid = "wifi"; | |
const char* password = "clave"; | |
const char* mqtt_server = "mqtt_server"; | |
int devicePin = 2; | |
WiFiClient espClient; |
View stats.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Raspberry Pi System Stats | |
# Save temperature, cpu usage and others to ThingSpeak channel | |
# Check the article: https://www.gsampallo.com/blog/2019/10/20/estadisticas-de-sistemas-de-raspberry-pi/ | |
# | |
import subprocess | |
import json | |
import requests | |
p = subprocess.Popen(['iostat','-c','-o','JSON'], stdout=subprocess.PIPE,stderr=subprocess.PIPE) |
View Attiny85_StteperMotor.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Control de un motor paso a paso ( 28BYJ-48) con Attiny85 y L293D | |
* Esquemas y documentación aqui: https://www.gsampallo.com/blog/?p=624 | |
*/ | |
const int motorPin1 = 0; | |
const int motorPin2 = 1; | |
const int motorPin3 = 2; | |
const int motorPin4 = 4; | |
int motorSpeed = 1200; //variable para fijar la velocidad |
View pir_oled.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void loop() { | |
estado = digitalRead(sensor); //se lee el estado del sensor | |
Serial.print("Estado del sensor = "); | |
Serial.println(sensor); | |
//Vaciamos la pantalla | |
oled.crearDisplay(); | |
oled.setTextColor(WHITE); | |
oled.setCursor(0,0); | |
oled.setTextSize(2); |
View enviar_mensaje.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Send Push notification from NodeMCU with Pushbullet API | |
* https://www.gsampallo.com/2020/07/09/envio-de-notificaciones-desde-nodemcu-con-pushbullet/ | |
* Guillermo Sampallo 2020 | |
*/ | |
#include <ESP8266WiFi.h> | |
const char* ssid = "SSD_NETWORK"; | |
const char* password = "PASSWORD_NETWORK"; |
View conectarse_red.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ESP8266WiFi.h> | |
const char* ssid = "NOMBRE_RED"; | |
const char* password = "PASSWORD_RED"; | |
void setup() { | |
Serial.begin(115200); | |
WiFi.begin(ssid,password); |
View webserver.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ESP8266WiFi.h> | |
const char* ssid = "NOMBRE_RED"; | |
const char* password = "PASSWORD_RED"; | |
WiFiServer servidor(80); | |
void setup() { | |
Serial.begin(115200); |
View webserver_led.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ESP8266WiFi.h> | |
const char* ssid = "SSID_NETWORK"; | |
const char* password = "PASSWORD_NETWORK"; | |
WiFiServer servidor(80); | |
int pinLed1 = 5; //D1 | |
void setup() { |
View publicar_mqtt.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ESP8266WiFi.h> | |
#include <PubSubClient.h> | |
//Reemplace por los datos de la red iot | |
const char* ssid = "Nombre_red"; | |
const char* password = "Clave_red"; | |
const char* mqtt_server = "Servidor_MQTT"; | |
WiFiClient espClient; |
View suscribirse_mqtt.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ESP8266WiFi.h> | |
#include <PubSubClient.h> | |
//Reemplace por los datos de la red iot | |
const char* ssid = "Nombre_red"; | |
const char* password = "password"; | |
const char* mqtt_server = "mqtt_server"; | |
WiFiClient espClient; |
OlderNewer