Skip to content

Instantly share code, notes, and snippets.

View andresrcs's full-sized avatar

Andrés Castro Socolich andresrcs

View GitHub Profile
@andresrcs
andresrcs / web_server_example.ino
Created January 28, 2020 21:07
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.
#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 January 28, 2020 20:43
Example MQTT implementation scketch for an ESP8266 board and a DS18B20 temperature probe sensor
#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 January 17, 2020 00:14
Python scrip for ETL speedtest-cli data into PostgreSQL
#!/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()