Skip to content

Instantly share code, notes, and snippets.

View chartinger's full-sized avatar

Christian Hartinger chartinger

View GitHub Profile
using System;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace ConsoleWebServer
{
/**
* Based on https://msdn.microsoft.com/en-us/library/6y0e13d3%28v=vs.110%29.aspx
@chartinger
chartinger / TestHelper.js
Created January 11, 2017 10:47
Simple Vue.js shallow render helper
import Vue from 'vue'
const mockComponent = function (name, props) {
return {
props: props,
render: function (createElement) {
return createElement(name, { props: props })
}
}
}
/*
Simple test for Mosca retain flag
- Creates a Mosca server
- Connects mqtt.js client when ready
- sends a random message with retain flag
- subscribes to the topic after sending
- checks if received message is the correct one
- checks ifd retain flag is set
country=AT
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="your_real_wifi_ssid"
scan_ssid=1
psk="your_real_password"
key_mgmt=WPA-PSK
}
@chartinger
chartinger / TFT_BMP280.ino
Created May 13, 2019 13:18
D1 Mini - TFT+BME280 - VSCODE
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
#include <XPT2046_Touchscreen.h>
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
#include <Fonts/FreeMonoBoldOblique12pt7b.h>
#define TFT_CS D0 //for D1 mini or TFT I2C Connector Shield (V1.1.0 or later)
http://rootzwiki.com/topic/41985-enable-wifi-tether-through-adb/
adb shell input keyevent 3 # home
adb shell am start -a android.intent.action.MAIN -n com.android.settings/.Settings
adb shell input keyevent 20 # down
adb shell input keyevent 20 # down
@chartinger
chartinger / README.md
Last active October 2, 2020 20:36
Raspberry Install

Install latest image onto sd card with edger

in the boot mount add file ssh and wpa_supplicant.conf

passwd
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install htop joe
sudo apt-get install mosquitto
In the PubSubClient Example a WiFi.mode(WIFI_STA); is missing. MQTT Connection will result in ERR=2
https://github.com/knolleary/pubsubclient/issues/138#issuecomment-326113915
When the D1 is seemingly bricked - pull down D3 (GPIO0) and D8 to GND to flash
https://github.com/esp8266/Arduino/issues/2604
ESP32 - D1 Mini Format CP210x Drivers
https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers