Skip to content

Instantly share code, notes, and snippets.

View jasonblewis's full-sized avatar

Jason Lewis jasonblewis

View GitHub Profile
esphome:
name: m5stickc
platform: ESP32
board: m5stick-c
includes:
# - custom_components/axp192/axp192.h
#- custom_components/st7735/st7735.h
platformio_options:
# upload_speed: 230400
# upload_speed: 115200
// Auto generated code by esphome
// ========== AUTO GENERATED INCLUDE BLOCK BEGIN ===========
#include "esphome.h"
using namespace esphome;
using namespace binary_sensor;
using namespace light;
logger::Logger *logger_logger;
using namespace sensor;
using namespace i2c;
i2c::I2CComponent *bus_a;
// Auto generated code by esphome
// ========== AUTO GENERATED INCLUDE BLOCK BEGIN ===========
#include "esphome.h"
using namespace esphome;
using namespace binary_sensor;
using namespace light;
logger::Logger *logger_logger;
using namespace sensor;
using namespace i2c;
i2c::I2CComponent *bus_a;
// Auto generated code by esphome
// ========== AUTO GENERATED INCLUDE BLOCK BEGIN ===========
#include "esphome.h"
using namespace esphome;
using namespace binary_sensor;
using namespace light;
logger::Logger *logger_logger;
using namespace sensor;
using namespace i2c;
i2c::I2CComponent *bus_a;

cannot access devices on second i2c bus (grove port) on m5stickc after rebooting. Can successfully read bus after the first flash, but then cannot read the bus after subsequent boots

log after first boot after flash

Leaving...
Hard resetting via RTS pin...
================================================================================ [SUCCESS] Took 13.69 seconds ================================================================================
INFO Successfully uploaded program.
INFO Starting log output from /dev/ttyUSB0 with baud rate 115200
@jasonblewis
jasonblewis / build.pl
Last active July 23, 2019 05:27
include image
#!/usr/bin/env perl
use Template;
my $DEBUG = 9;
my $tt = Template->new({
INCLUDE_PATH => './',
OUTPUT_PATH => './',
});
my $vars = {
:k-man-badge MODE k-man-badge :+Ri
:NickServ!NickServ@services. NOTICE k-man-badge :This nickname is registered. Please choose a different nickname, or identify via /msg NickServ identify <password>.
:freenode-connect!frigg@freenode/utility-bot/frigg NOTICE k-man-badge :Due to the persistent ongoing spam, all new connections are being set +R (block messages from
unidentified users) and will be scanned for vulnerabilities. This will not harm your computer, and vulnerable hosts will be notified.
:freenode-connect!frigg@freenode/utility-bot/frigg PRIVMSG k-man-badge :VERSION
:k-man-badge!~k-man-bad@debian.organictrader.com.au JOIN #badgetest
:verne.freenode.net 353 k-man-badge @ #badgetest :k-man-badge _k-man-badge @k-man
:verne.freenode.net 366 k-man-badge #badgetest :End of /NAMES list.
:_k-man-badge!~k-man-bad@debian.organictrader.com.au QUIT :Read error: Connection reset by peer
< k-man-badge> DEBUG:None:if not empty string RAW: :k-man!~jason@unaffiliated/k-man PRIVMSG #badgetest :hi
def print_response():
while(client.connected):
client.last_response = client.get_response()
if(client.last_response != ''):
logging.debug("RAW: {}".format(client.last_response))
if "PING" in client.last_response: # Respond to pongs from the server
client.send_pong(client.last_response) # Give the server the timestamped PONG
if "Closing Link" in client.last_response: # Server said goodbye
client.connected = False # So we're disconnected now, thread ends.
try:
import machine, time
from ssd1306 import SSD1306_I2C
WIDTH = const(132)
HEIGHT = const (64)
sda_pin = 21
scl_pin = 22
i2c = machine.I2C(scl=scl_pin, sda=sda_pin, speed=400000)
import machine
from machine import Timer
# see listing one
# https://www.embedded.com/electronics-blogs/break-points/4024981/My-favorite-software-debouncers
np = machine.Neopixel(15,8,machine.Neopixel.TYPE_RGB)
button = machine.Pin(34,machine.Pin.IN)
check_msec = 20