Skip to content

Instantly share code, notes, and snippets.

View abobija's full-sized avatar

Alija Bobija abobija

View GitHub Profile
@abobija
abobija / esp-idf-on-wsl2.md
Last active April 13, 2024 04:57
ESP-IDF on WSL2 - Build, Flash and Monitor

ESP-IDF on WSL2 - Build, Flash and Monitor ⚡

Demo

How to setup ESP-IDF on WSL2 Ubuntu 20.04 - Config, Build and Flash

Intro

WSL2 still does not support USB devices, but with a little effort we can make possible to flash and monitor ESP device from WSL2.

@abobija
abobija / init.lua
Created September 24, 2019 12:14
Code written from YouTube video https://youtu.be/00gPK3rfXZA
local username = 'ADAFRUIT_IO_USERNAME'
local aioKey = 'ADAFRUIT_IO_KEY'
local feed = 'ADAFRUIT_IO_MQTT_FEED_NAME'
local sda = 26
local scl = 27
local sla = 0x3c
i2c.setup(i2c.HW0, sda, scl, i2c.FAST)
local disp = u8g2.ssd1306_i2c_128x64_noname(i2c.HW0, sla)
@abobija
abobija / index.js
Last active March 20, 2024 22:35
Code written in YouTube video https://youtu.be/q5tOByY1ch4
var mqtt = require('mqtt');
var client = mqtt.connect('mqtt://io.adafruit.com', {
username: 'ADAFRUIT_IO_USERNAME',
password: 'ADAFRUIT_UI_KEY'
});
var ssd1306topic = `${client.options.username}/f/ssd1306`;
client.on('connect', function() {
@abobija
abobija / wsl2-ubuntu-lamp.md
Last active February 25, 2024 08:07
LAMP stack on WSL2 (Ubuntu 20.04) - Apache, MySQL, PHP, PhpMyAdmin

LAMP stack on WSL2 (Ubuntu 20.04) - Apache, MySQL, PHP, PhpMyAdmin

Apache

sudo apt-get update && sudo apt-get upgrade 
sudo apt-get install -y apache2

PHP

@abobija
abobija / humidifier.yaml
Created August 19, 2022 18:37
Code of humidifier made in https://youtu.be/-uyNXLJjQtI
substitutions:
device_name: humidifier
device_name_verbose: Humidifier
esp8266:
board: d1_mini
esphome:
name: ${device_name}
@abobija
abobija / esp-idf on ubuntu 20.04.1.md
Last active September 9, 2023 02:20
ESP-IDF on Ubuntu 20.04.1

ESP-IDF on Ubuntu 20.04.1

This is commands used in youtube video

How to setup ESP-IDF on Ubuntu 20.04.1

Commands:

sudo apt update && sudo apt upgrade -y
@abobija
abobija / init.lua
Created June 18, 2019 16:19
Code written in YouTube video https://youtu.be/Tb3L4UcjlI4
local function init_ws()
require('ws32_client')
.on('receive', function(data, ws)
print('WS received: ', data)
end)
.on('connection', function(ws)
print('WS connected')
local timer = tmr.create()
@abobija
abobija / server.js
Created June 20, 2019 15:48
WebSocket NodeJS Server written in YouTube video https://www.youtube.com/watch?v=_Z9Axfh6AEU
const app = require('express')();
const appWs = require('express-ws')(app);
app.ws('/echo', ws => {
ws.on('message', msg => {
console.log('Received: ', msg);
ws.send(msg);
});
});
@abobija
abobija / Program.cs
Created November 16, 2019 14:22
Code written in YouTube video https://youtu.be/eSS5w29iVl8
using SimpleHttp;
using System.Threading;
namespace SimpleHttpDemo
{
class Program
{
static void Main(string[] args)
{
Route.Add("/", (req, res, props) =>
@abobija
abobija / init.lua
Created November 16, 2019 21:10
Code written for ESP32 in YouTube video https://youtu.be/b6W0ps3IhzA
local rfidmod = nil
local function init_rfid()
if rfidmod ~= nil then
return
end
rfidmod = require('rfid32')({
pin_sda = 22,
pin_clk = 19,