Skip to content

Instantly share code, notes, and snippets.

Avatar

Andrés Castro Socolich andresrcs

View GitHub Profile
@andresrcs
andresrcs / web_server_example.ino
Created Jan 28, 2020
Example Arduino Scketch for an ESP8266 board (Wemos D1 mini) and DS18B20 temperature probe sensors that serves HTML and JSON outputs over a web server.
View web_server_example.ino
#include <ESP8266WiFi.h> // Library for WiFi
#include <ESP8266WebServer.h> // Library for the web server
#include <ArduinoJson.h> // Library for JSON processing
#include <OneWire.h> // Library for DS18B20 sensor
#include <DallasTemperature.h> // Library for DS18B20 sensor
#include "credentials.h" // File with WiFi credentials
// Network Configurations
IPAddress ip(192,168,0,102); // Set the board's IP configuration
IPAddress gateway(192,168,0,1);
@andresrcs
andresrcs / mqtt_example.ino
Created Jan 28, 2020
Example MQTT implementation scketch for an ESP8266 board and a DS18B20 temperature probe sensor
View mqtt_example.ino
#include <ESP8266WiFi.h> // Library for WiFi
#include <OneWire.h> // Library for DS18B20 sensor
#include <DallasTemperature.h> // Library for DS18B20 sensor
#include <Adafruit_MQTT.h> // MQTT client
#include <Adafruit_MQTT_Client.h> // MQTT client
#include "credentials.h"
// Content - credentials.h ##########################################################
// ###################################################################################
// WiFi Credentials
// #define WLAN_SSID "YOUR SSID"
@andresrcs
andresrcs / speedtest.py
Created Jan 17, 2020
Python scrip for ETL speedtest-cli data into PostgreSQL
View speedtest.py
#!/usr/bin/python
import os
import re
import subprocess
import time
import pyodbc
try:
response = subprocess.Popen('/usr/local/bin/speedtest-cli', shell=True, stdout=subprocess.PIPE).stdout.read()
You can’t perform that action at this time.