Skip to content

Instantly share code, notes, and snippets.

💭
🐔➡️🚀

Stefan Kremser spacehuhn

💭
🐔➡️🚀
View GitHub Profile
@spacehuhn
spacehuhn / arduinolib.md
Last active Apr 5, 2019
Arduino Library Cheat Sheet
View arduinolib.md

Arduino Library Cheat Sheet

Create the library

  • Make a GitHub repository for it
  • The library name should not start with Arduino
  • Make enough examples with good comments
  • Write an extensive README.md that explains how to install and use the library
  • Should be useful for all architectures, otherwise think twice if your library should be published to the library manager

Define version

@spacehuhn
spacehuhn / esp32_apa102.ino
Created Aug 21, 2018
ESP32 FastLED APA102-2020 LED Example
View esp32_apa102.ino
#include <FastLED.h>
// How many leds in your strip?
#define NUM_LEDS 4
// For led chips like Neopixels, which have a data line, ground, and power, you just
// need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,
// ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
#define DATA_PIN 23
#define CLOCK_PIN 22
View rickroll.md

In the end of setup():

  pinMode(D6, INPUT_PULLUP); // enable button pin

At the end of loop():

  if(digitalRead(D6)){
    if(!attack.isRunning()){
      serialInterface.runCommand("stopap");                    // stop access point and web interface
@spacehuhn
spacehuhn / deauthall.md
Last active Jun 15, 2020
Deauth-All-Button
View deauthall.md

Replace cli with serialInterface if you're using an older version of esp8266_deauther!

In the end of setup():

  pinMode(D5, INPUT_PULLUP); // enable button pin
  pinMode(D4, OUTPUT);       // enable LED pin

In the beginning of loop():

@spacehuhn
spacehuhn / startwlan.md
Last active Jun 19, 2020
little bash script to enable monitor mode
View startwlan.md

Some wireless cards support monitor mode but won't work with airmon-ng. This is a little script helps you turning the monitor mode on! (+ it also sets the channel and the tx-power)

Usage: startWlan.sh [Interface:wlan0] [Channel:1] [Txpower:30] [Bandwidth:HT20|HT40+|HT40-]

Examples:
./startWlan.sh - enables monitor mode on wlan0, sets channel to 1 and tx-power to 30dBm.
./startWlan.sh wlan1 11 33 - enables monitor mode on wlan1, sets channel to 11 and tx-power to 33dBm.
./startWlan.sh wlan0 6 - enables monitor mode on wlan0, sets channel to 6 and tx-power to 30dBm.

Script:

@spacehuhn
spacehuhn / arduino_flash_esp8266.md
Last active May 30, 2020
Flash ESP8266 over an Arduino
View arduino_flash_esp8266.md

How to flash your ESP8266 without a USB-Serial adapter but with an Arduino.

First be sure everything is connected correcly:

Arduino ESP82666
TX RX
RX TX
GND GND
GND GPIO-15
@spacehuhn
spacehuhn / esp8266webserver_download_hack.md
Last active May 1, 2020
ESP8266 Webserver: send or download huge files
View esp8266webserver_download_hack.md

The Arduino webserver library from the ESP8266 is very simple and you can get to its limits pretty fast!

So that beeing said I first want to recommend you this library: ESPAsyncWebServer.
It's a very good alternative with a lot of features and it's easy to use.

However I wanna show you an easy way to hack around the standard webserver library for projects which can't make use of the ESPAsyncWebserver library.

So what we want to do is making the ESP8266 serve files via its webserver that are bigger than the RAM size we have left.
A picture for example. You don't want to hold that in the RAM, it's limited and way to valuable to be used for this.

You can’t perform that action at this time.