DNS

microk8s enable host-access:ip=192.168.178.27

/etc/netplan/50-*.yaml

network:
    ethernets:
        eth0:
            dhcp4: true
            optional: true
            nameservers:
                addresses: [192.168.178.1]
    version: 2
    wifis:
        wlan0:
            optional: true
            access-points:
                "FRITZ!Box 5530 VS":
                    password: "95802538411183299862"
            dhcp4: no
            addresses: [192.168.178.27/24]
            nameservers:
                addresses: [192.168.178.1,8.8.8.8]
            routes:
              - to: default

Cordova Plugin


connect-src * 'unsafe-inline';
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *; img-src 'self' data: content:; connect-src * 'unsafe-inline';">


cordova create SimpleConnect ch.awri.simpleconnect
cd SimpleConnect/
cordova platform add android

plugman create --name SimpleConnect --plugin_id cordova.plugin.simpleconnect --plugin_version 0.0.1 --variableHOST=https://kimo2007.dnshome.de

cd SimpleConnect/

plugman platform add --platform_name android

cd..
plugman createpackagejson /mnt/PLATTE1/bionic/SimpleConnect/SimpleConnect

plugman install --platform android --project platforms/android --plugin /mnt/PLATTE1/bionic/SimpleConnect/SimpleConnect/

cordova platform rm browser
cordova platform rm android
cordova plugin rm cordova.plugin.simpleconnect

cordova plugin add ./cordova-plugin-simpleconnect

https://snyk.io/advisor/npm-package/cordova/functions/cordova%2Fexec%2Fproxy.add

Wyliodrin

SimulatorButtonTest

var Gpio = require("onoff").Gpio;

var led = new Gpio(4, "out");

var button = new Gpio(22, "in");

function sleep(ms){

var waitTill = new Date(new Date().getTime() + 1 * ms);

while(waitTill > new Date()){}

};

led.writeSync(1);

led.writeSync(0);

while(button.readSync() === 0) {

    console.log("loop");

led.writeSync(1);

sleep(500);

led.writeSync(0);

sleep(1000);

}

console.log("onoff.Gpio tutorial finished!");

process.on('SIGINT', function () {

  button.unexport();

});

exit(0);

STK500

Old Style wiring #define

The 10µF electrolytic capacitor connected to RESET and GND of the programming board is needed only for the boards that have an interface between the microcontroller and the computer’s USB, like Mega, UNO, Mini, Nano. Boards like Leonardo, Esplora and Micro, with the USB directly managed by the microcontroller, don’t need the capacitor.

https://www.mikrocontroller.net/articles/AVR_Fuses

https://docs.arduino.cc/built-in-examples/arduino-isp/ArduinoISP

ESP8266

Sniffer2

include <Arduino.h>

extern "C" {
  #include <user_interface.h>
}

#define DATA_LENGTH           112

#define TYPE_MANAGEMENT       0x00
#define TYPE_CONTROL          0x01
#define TYPE_DATA             0x02
#define SUBTYPE_PROBE_REQUEST 0x04

struct RxControl {
 signed rssi:8; // signal intensity of packet
 unsigned rate:4;
 unsigned is_group:1;
 unsigned:1;
 unsigned sig_mode:2; // 0:is 11n packet; 1:is not 11n packet;
 unsigned legacy_length:12; // if not 11n packet, shows length of packet.
 unsigned damatch0:1;
 unsigned damatch1:1;
 unsigned bssidmatch0:1;
 unsigned bssidmatch1:1;
 unsigned MCS:7; // if is 11n packet, shows the modulation and code used (range from 0 to 76)
 unsigned CWB:1; // if is 11n packet, shows if is HT40 packet or not
 unsigned HT_length:16;// if is 11n packet, shows length of packet.
 unsigned Smoothing:1;
 unsigned Not_Sounding:1;
 unsigned:1;
 unsigned Aggregation:1;
 unsigned STBC:2;
 unsigned FEC_CODING:1; // if is 11n packet, shows if is LDPC packet or not.
 unsigned SGI:1;
 unsigned rxend_state:8;
 unsigned ampdu_cnt:8;
 unsigned channel:4; //which channel this packet in.
 unsigned:12;
};

struct SnifferPacket{
    struct RxControl rx_ctrl;
    uint8_t data[DATA_LENGTH];
    uint16_t cnt;
    uint16_t len;
};

// Declare each custom function (excluding built-in, such as setup and loop) before it will be called.
// https://docs.platformio.org/en/latest/faq.html#convert-arduino-file-to-c-manually
static void showMetadata(SnifferPacket *snifferPacket);
static void ICACHE_FLASH_ATTR sniffer_callback(uint8_t *buffer, uint16_t length);
static void printDataSpan(uint16_t start, uint16_t size, uint8_t* data);
static void getMAC(char *addr, uint8_t* data, uint16_t offset);
void channelHop();

static void showMetadata(SnifferPacket *snifferPacket) {

  unsigned int frameControl = ((unsigned int)snifferPacket->data[1] << 8) + snifferPacket->data[0];

  uint8_t version      = (frameControl & 0b0000000000000011) >> 0;
  uint8_t frameType    = (frameControl & 0b0000000000001100) >> 2;
  uint8_t frameSubType = (frameControl & 0b0000000011110000) >> 4;
  uint8_t toDS         = (frameControl & 0b0000000100000000) >> 8;
  uint8_t fromDS       = (frameControl & 0b0000001000000000) >> 9;

  // Only look for probe request packets
  if (frameType != TYPE_MANAGEMENT ||
      frameSubType != SUBTYPE_PROBE_REQUEST)
        return;

  Serial.print("RSSI: ");
  Serial.print(snifferPacket->rx_ctrl.rssi, DEC);

  Serial.print(" Ch: ");
  Serial.print(wifi_get_channel());

  char addr[] = "00:00:00:00:00:00";
  getMAC(addr, snifferPacket->data, 10);
  Serial.print(" Peer MAC: ");
  Serial.print(addr);

  uint8_t SSID_length = snifferPacket->data[25];
  Serial.print(" SSID: ");
  printDataSpan(26, SSID_length, snifferPacket->data);

  Serial.println();
}

/**
 * Callback for promiscuous mode
 */
static void ICACHE_FLASH_ATTR sniffer_callback(uint8_t *buffer, uint16_t length) {
  struct SnifferPacket *snifferPacket = (struct SnifferPacket*) buffer;
  showMetadata(snifferPacket);
}

static void printDataSpan(uint16_t start, uint16_t size, uint8_t* data) {
  for(uint16_t i = start; i < DATA_LENGTH && i < start+size; i++) {
    Serial.write(data[i]);
  }
}

static void getMAC(char *addr, uint8_t* data, uint16_t offset) {
  sprintf(addr, "%02x:%02x:%02x:%02x:%02x:%02x", data[offset+0], data[offset+1], data[offset+2], data[offset+3], data[offset+4], data[offset+5]);
}

#define CHANNEL_HOP_INTERVAL_MS   1000
static os_timer_t channelHop_timer;

/**
 * Callback for channel hoping
 */
void channelHop()
{
  // hoping channels 1-13
  uint8 new_channel = wifi_get_channel() + 1;
  if (new_channel > 13) {
    new_channel = 1;
  }
  wifi_set_channel(new_channel);
}

#define DISABLE 0
#define ENABLE  1

void setup() {
  // set the WiFi chip to "promiscuous" mode aka monitor mode
  Serial.begin(115200);
  delay(10);
  wifi_set_opmode(STATION_MODE);
  wifi_set_channel(1);
  wifi_promiscuous_enable(DISABLE);
  delay(10);
  wifi_set_promiscuous_rx_cb(sniffer_callback);
  delay(10);
  wifi_promiscuous_enable(ENABLE);

  // setup the channel hoping callback timer
  os_timer_disarm(&channelHop_timer);
  os_timer_setfn(&channelHop_timer, (os_timer_func_t *) channelHop, NULL);
  os_timer_arm(&channelHop_timer, CHANNEL_HOP_INTERVAL_MS, 1);
}

void loop() {
  delay(10);
}

VS Code MingW

/etc/.profile
#  HOME=“/home/$LOGNAME“
HOME=“/c/robert/dev“

launch.json

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        
        {
            "name": "(gdb) Starten",
            "type": "cppdbg",
            "request": "launch",
            "program": "c:\\robert\\dev\\gaming\\emptymath2\\empty.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "miDebuggerPath": "gdb.exe",
            "setupCommands": [
                {
                    "description": "Automatische Strukturierung und Einrückung für \"gdb\" aktivieren",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                },
                {
                    "description":  "Disassemblierungsvariante auf Intel festlegen",
                    "text": "-gdb-set disassembly-flavor intel",
                    "ignoreFailures": true
                }
            ]
        }

    ]
}

Raspberry alte Webcam

sudo apt install fswebcam
v4l2-ctl --list-formats-ext


fmpeg -f v4l2 -video_size 1280x720 -i /dev/video0 -frames 1 out.jpg

Das Paletten Format der Kamera wird nicht unterstützt darum: 
LD_PRELOAD=/usr/lib/arm-linux-gnueabihf/libv4l/v4l1compat.so fswebcam -r 384x288  /home/pi/output.jpg && ls

Mjpeg Streamer

LD_PRELOAD=/usr/lib/arm-linux-gnueabihf/libv4l/v4l1compat.so ./mjpg_streamer -i ‚input_uvc.so -r 285×288‘ -o „output_http.so -w ./www“

sudo systemctl start mjpg-streamer
sudo systemctl status mjpg-streamer
sudo systemctl enable mjpg-streamer

[Unit]
Description=Streams video with Raspberry Pi Camera
After=syslog.target
After=network.target
#Requires=dev-video0.device
#BindsTo=dev-video0.device

[Service]
ExecStart=/usr/local/bin/mjpg_streamer -i "/usr/local/lib/mjpg-streamer/input_uvc.so -r 352x288 -fourcc RGB24" -o "/usr/local/lib/mjpg-streamer/output_http.so -w /home/pi/mjpg-streamer/mjpg-streamer-experimental/www"
Environment="LD_PRELOAD=/usr/lib/arm-linux-gnueabihf/libv4l/v4l1compat.so"

[Install]
WantedBy=multi-user.target

Emscripten

https://www.codeproject.com/Articles/84461/MinGW-Static-and-Dynamic-Libraries

CXXFLAGS
-O2 -g -pedantic -Wall -fmessage-length=0

Compile Linux
-lBaseEngine -lSDL2main sdl2-config --cflags --libs

Compile Link MingW (-mconsole -mwindows)
-lBaseEngine -lmingw32 -lSDL2main -lBaseEngine -lSDL2main sdl2-config --cflags --libs

 Windows Icon
corona.rc=> id ICON „path/to/my.ico“
windres corona.rc -O coff -o corona.res
g++ -o a.o corona.res
Link
g++ $(OBS) -o $(TARGET) corona.res $(INCDIR) $(LIBDIR) $(LIBS)

VisualC
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\inclide
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\x64

SDL2.lib
SDL2main.lib
SDL2_image.lib
SDL2_mixer.lib
SDL2_net.lib