Skip to content

Instantly share code, notes, and snippets.

View Neumi's full-sized avatar
🐙

Neumi Neumi

🐙
View GitHub Profile
@Neumi
Neumi / synchronize_ethernet_clients_arduino.ino
Created November 14, 2023 00:14
Arduino and Python code to synchronize many hardware clients on a local LAN network via UDP broadcasts.
/*
// python code for sync command
// sends sync broadcast to the network to trigger all devices to synchronize
import socket
import time
UDP_IP = "255.255.255.255" # Broadcast IP address
UDP_PORT = 8888 # UDP port
@Neumi
Neumi / mqtt_power_plug.ino
Last active November 6, 2023 10:10
MQTT for ESP based relais power plugs.
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
const char* mqtt_server = "111.111.111.111"; // change to MQTT BROKER SERVER
// MQTT broker settings
const int mqtt_port = 1883;
const char* mqtt_topic = "/iot/devices/100/power";
@Neumi
Neumi / ContentView.swift
Last active August 30, 2023 12:57
Ethersweep Remote IOS app
import SwiftUI
import Network
struct ContentView: View {
@State private var ipAddress = "192.168.1.184"
@State private var port = "8888"
@State private var speed: Double = 200
@State private var steps: Double = 100
@State private var selectedStepMode = 32
@Neumi
Neumi / robot_control.pde
Last active October 11, 2022 14:38
Ethersweep robot keyboard control Processing Code
// more info: github.com/neumi/ethersweep
import hypermedia.net.*;
UDP udp;
String ipLeft = "192.168.0.102";
String ipRight = "192.168.0.101";
String ipGripper = "192.168.0.100";
int port = 8888;
@Neumi
Neumi / read_write_wifi_credentials_to_eprom.ino
Created August 13, 2020 11:16
Small Arduino code snippet to save/read EPS8266 or ESP32 WIFI password and SSID from/to EEPROM.
#include <EEPROM.h>
int eeprom_size = 512; // depends on microcontroller
int max_ssid_size = 32;
int max_psk_size = 63;
void setup()
{
EEPROM.begin(eeprom_size);
Serial.begin(115200);
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'key ttn-account-v2.not-a-real-key-blabla-booboo',
}
params = (
('last', '2d'),
)
// MIT License
// https://github.com/gonzalocasas/arduino-uno-dragino-lorawan/blob/master/LICENSE
// Based on examples from https://github.com/matthijskooijman/arduino-lmic
// Copyright (c) 2015 Thomas Telkamp and Matthijs Kooijman
// Adaptions Neumi
#include <lmic.h>
#include <hal/hal.h>
static const u1_t NWKSKEY[16] = { 0xF7, 0xA5, 0x02, 0x48, 0x9B, 0xD1, 0xF2, 0x92, 0x97, 0x62, 0x69, 0x4C, 0xDB, 0x2A, 0xE9, 0x7A };