Skip to content

Instantly share code, notes, and snippets.

@Bolukan
Bolukan / MinimalEnergyWifiOnESP.ino
Created June 10, 2018 08:39
All tricks to minimize energy for WiFi on ESP
/*
* Efficient WiFi
* https://www.bakke.online/index.php/2017/05/21/reducing-wifi-power-consumption-on-esp8266-part-2/
*
*/
/* WiFi settings */
#include "secrets.h" // WIFI SSID and password
#include <WiFi>
@Bolukan
Bolukan / Open Youtube on KODI.user.js
Last active October 24, 2018 14:18
Open Youtube video on KODI
// ==UserScript==
// @name Open Youtube on KODI
// @namespace https://github.com/Bolukan/
// @version 0.2
// @date 2018-10-24
// @description Open current youtube video on KODI
// @author Bollie
// @copyright 2018, Bollie
// @homepage https://github.com/Bolukan/
// @compatible chrome
@Bolukan
Bolukan / MYSQL BME280 ESP8266.ino
Last active October 27, 2018 19:51
Proof-of-concept Log sensor data directly via MYSQL connection to database
#include <Arduino.h>
#include <Wire.h>
#include <SPI.h> // need for buggy BME280
#if defined(ESP8266)
#include <ESP8266WiFi.h>
#elif defined(ESP32)
#include <WiFi.h>
#endif
@Bolukan
Bolukan / wifi_station_continuous.ino
Last active November 17, 2018 20:28
Best Practice Continuous WiFi Connection (WIP)
#include <Arduino.h>
#if defined(ESP8266)
#include <ESP8266WiFi.h>
#elif defined(ESP32)
#include <WiFi.h>
#endif
// #include "secrets.h"
#ifndef SECRETS_H
/* Last udpate: Added enumerated weather types, improved efficiency
* Last update: 07-Aug-17, with improved forecast rules
*
* ESP32 and BMP180 or BME280 and OLED SH1106 or SSD1306 display Weather Forecaster
* Using air pressure changes to predict weather based on an advanced set of forecasting rules.
* The 'MIT License (MIT) Copyright (c) 2016 by David Bird'. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
* following conditions:
* The above copyright ('as annotated') notice and this permission notice shall be included in all copies or substantial portions of the Software and where the
@Bolukan
Bolukan / lowpowerwifi.ino
Last active November 18, 2018 12:15
Low power WiFi Connection
#include <Arduino.h>
#if defined(ESP8266)
#include <ESP8266WiFi.h>
#elif defined(ESP32)
#include <WiFi.h>
#endif
#include <WiFiClient.h>
#include <time.h>
#include <Arduino.h>
#include <Wire.h>
#include <SPI.h> // BME280 library demand
#if defined(ESP8266)
#include <ESP8266WiFi.h>
#elif defined(ESP32)
#include <WiFi.h>
#endif
#include <WiFiClient.h>
@Bolukan
Bolukan / rtcmem.h
Created January 2, 2019 23:26
rtcmem.h
/*
RTCMEM.h
A wrapper for the ESP8266 RTC memory
*/
#ifndef RTCMEM_H
#define RTCMEM_H
@Bolukan
Bolukan / rtcmem.cpp
Created January 2, 2019 23:27
rtcmem.cpp
#include <arduino.h>
#include <rtcmem.h>
#include "CRC32.h"
RTCMEM::RTCMEM()
{
}
void RTCMEM::reset(uint16_t recordLength)
{
@Bolukan
Bolukan / ESP8266WiFi_base.ino
Last active February 8, 2019 20:28
Base code for using ESP8266WiFi
#if !defined(ESP8266)
#error This file is for ESP8266 only
#endif
#include <Arduino.h>
// WiFi
#include <ESP8266WiFi.h> // https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/src/ESP8266WiFi.h
// #include "secrets.h" // Uncomment this line and add secrets.h to your project
#ifndef SECRETS_H