Skip to content

Instantly share code, notes, and snippets.

View nobodyguy's full-sized avatar

Jan nobodyguy

  • ExpertaLabs
  • Brno, Czech Republic
View GitHub Profile
@nobodyguy
nobodyguy / bambu_updater.py
Last active October 30, 2025 19:36
Small python script to update Bambulab A1 Mini or P1S in LAN mode with older firmware (without offline SD card update) to the first version that enables offline updates. Feel free to modify it for other printers and firmware versions.
#!/usr/bin/env python3
"""
Bambulab Printer OTA Firmware Update Script
This script connects to your Bambulab printer (A1 Mini or P1S) via MQTT
and initiates an OTA firmware update.
Sources:
- https://github.com/lunDreame/user-bambulab-firmware/issues/15
- https://m.cafe.naver.com/ca-fe/web/cafes/30884640/articles/3353
"""
@nobodyguy
nobodyguy / printer_monitor.js
Last active May 4, 2025 22:45
Shelly Plus Plug S script to automatically turn off the plug after 3D printing has finished and cooling delay has elapsed
// This script detects printing start and stop events based on power consumption.
// When the stop event is detected, it waits for 15 minutes to enable printer to cool down and shutdown event is triggered.
let CONFIG = {
cooldownDelay: 15 * 60 * 1000, // 15 minutes
idlePowerMax: 12, // 12 Watts (in reality 7-8W)
};
let cooldownTimer = null;
let printingStarted = false;
@nobodyguy
nobodyguy / instructions.md
Created November 27, 2021 22:48
How to turn BlackPillV2 into BMP
  1. Compile blackmagic firmware according to this guide https://github.com/blacksphere/blackmagic/blob/master/src/platforms/f4discovery/Readme.md#alternate-build-for-stm32f401-stm32f411-minif4-aka-blackpillv2-boards (make PROBE_HOST=f4discovery BLACKPILL=1)
  2. Connect the board to your computer while holding BOOT0 and NRST buttons to boot into STM32 bootloader
  3. Execute these commands to unlock the board and flash BMP firmware:
dfu-util --list
dfu-util -a 0 --device XXX:XXX --dfuse-address 0x08000000 -D ./src/blackmagic.bin -s :unprotect:force
dfu-util -a 0 --device XXX:XXX --dfuse-address 0x08000000 -D ./src/blackmagic.bin
@nobodyguy
nobodyguy / controller.ino
Last active September 27, 2023 18:14
Arduino PID controller with relay and DS18B20
#include <PID_v1.h>
// Libraries for the DS18B20 sensor
#include <OneWire.h>
#include <DallasTemperature.h>
// DS18B20 on PIN 6 on the Arduino
#define ONE_WIRE_BUS 6
//Solid state relay on PIN 5 on the Arduino
@nobodyguy
nobodyguy / tracker.ino
Last active September 21, 2022 03:13
GpsLoRaWANTracker using Arduino, RN2483 and L86/neo-m8n GPS module
#include <TinyGPS++.h>
#include <SoftwareSerial.h>
#include <avr/sleep.h>
#include <avr/power.h>
// ----------------------------------------------
// DEFINES
// ----------------------------------------------
#define rxGpsPin 10
#define txGpsPin 11
@nobodyguy
nobodyguy / testNode.ino
Last active January 18, 2017 14:35
RFM69CW basic sleeping node - reports static payload every 1 minute
//*********************************************************************************************
// Sample RFM69 sender/node sketch, with ACK and optional encryption, and Automatic Transmission Control
// Sends periodic static messages to gateway (id=1)
//*********************************************************************************************
#include <RFM69.h> //get it here: https://www.github.com/lowpowerlab/rfm69
#include <RFM69_ATC.h> //get it here: https://www.github.com/lowpowerlab/rfm69
#include <SPI.h> //included with Arduino IDE install (www.arduino.cc)
#include "LowPower.h"
//*********************************************************************************************
@nobodyguy
nobodyguy / temp.ino
Created January 10, 2017 13:07
DHT22 OLED temperature
#include <DHTSensor.h>
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
DHTSensor sensor(7);//Will be using pin3 for collecting the data
@nobodyguy
nobodyguy / wateringSystem.ino
Last active September 25, 2015 21:53
Watering system using Arduino, soil humidity sensor and 3-6V water pump. Checking for humidity is done every 24 hours.
const int sensorPin = A0;
const int sensorPowerPin = 4;
int sensorValue = 0;
const int transistorPin = 5;
const long sleepTime = 86390000; // 24 hours - 10 seconds
const int wateringTime = 10000; // 10 seconds
const int drySoil = 400;
printf("Temperature table:\n\n\t ");
n=0;
while (mon[n]!='\0')
{
if (mon[n]==',')
printf(" ");
else
printf("%c", mon[n]);
n++;
@nobodyguy
nobodyguy / http_server.ps1
Last active July 9, 2022 15:09
Powershell HTTP server in background thread (could be easily killed)
$ServerThreadCode = {
$listener = New-Object System.Net.HttpListener
$listener.Prefixes.Add('http://+:8008/')
$listener.Start()
while ($listener.IsListening) {
$context = $listener.GetContext() # blocks until request is received
$request = $context.Request