Skip to content

Instantly share code, notes, and snippets.

View kzyapkov's full-sized avatar

Kiril Zyapkov kzyapkov

  • KN12
View GitHub Profile
@kzyapkov
kzyapkov / ota.py
Last active November 3, 2022 10:23
Silabs Gecko BLE OTA with Python
#!/usr/bin/env python
# Copyright (c) 2022 Kiril Zyapkov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@kzyapkov
kzyapkov / shelly_auth_test.py
Created March 3, 2022 21:28
Shelly authentication without challenge
#!/usr/bin/env python3
from __future__ import annotations
import asyncio
import hashlib
import logging
import secrets
import time
from typing import Any
@kzyapkov
kzyapkov / antenna.nec
Created May 18, 2018 11:21
necpp collinear antenna error
CM --- NEC2 Input File created or edited by xnec2c 3.5 ---
CM GW 2 25 0.00000E+00 6.90000E-02 4.00000E-03 0.00000E+00 6.90000E-02 -4.00000E-03 1.50000E-03
CM tag segs x1 y1 z1 x2 y2 z2
CE
GW 1 1 0.00000E+00 5.30000E-02 -4.00000E-03 0.00000E+00 5.30000E-02 4.00000E-03 7.50000E-04
GW 3 25 0.00000E+00 0.00000E+00 4.00000E-03 0.00000E+00 5.30000E-02 4.00000E-03 7.50000E-04
GW 4 15 0.00000E+00 5.30000E-02 4.00000E-03 0.00000E+00 6.90000E-02 4.00000E-03 7.50000E-04
GW 5 15 0.00000E+00 0.00000E+00 -4.00000E-03 0.00000E+00 5.30000E-02 -4.00000E-03 7.50000E-04
GW 6 15 0.00000E+00 5.30000E-02 -4.00000E-03 0.00000E+00 6.90000E-02 -4.00000E-03 7.50000E-04
GA 10 35 4.00000E-03 9.00000E+01 2.70000E+02 7.50000E-04 1.38921E-01 0.00000E+00 0.00000E+00
#include "mgos.h"
void sayit(void *arg) {
LOG(LL_INFO, ("TICK!"));
}
IRAM void _timer_cb(void *arg) {
static uint32_t count = 0;
if (((++count) % 1000) == 0) {
mgos_invoke_cb(sayit, NULL, true);
@kzyapkov
kzyapkov / Makefile
Last active May 25, 2017 07:01
esp_udp_send_crash
APP = esp_crash
APP_PLATFORM = esp8266
MGOS_PATH = ../mongoose-os
APP_CONF_SCHEMA = $(CURDIR)/src/conf_schema.yaml
# This defines "all" and "clean" targets.
include $(MGOS_PATH)/fw/platforms/$(APP_PLATFORM)/Makefile
@kzyapkov
kzyapkov / build-log
Last active May 22, 2016 08:34
heekscad-build
==> Making package: heekscad-git 1441.2254f21-1 (Sun May 22 11:25:06 EEST 2016)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Updating heekscad-git git repo...
Fetching origin
==> Validating source files with md5sums...
heekscad-git ... Skipped
==> Extracting sources...
-> Creating working copy of heekscad git repo...
TARGET=$(notdir $(shell pwd))
ARDUINO_DIR ?= /opt/arduino-1.6.7
ARDUINO_BUILDER ?= $(ARDUINO_DIR)/arduino-builder
ARDUINO_HARDWARE ?= $(ARDUINO_DIR)/hardware
MKSPIFFS ?= $(ARDUINO_DIR)/hardware/esp8266com/esp8266/tools/mkspiffs/mkspiffs
ESPOTA_PY ?= $(ARDUINO_DIR)/hardware/esp8266com/esp8266/tools/espota.py
PYTHON ?= python2
@kzyapkov
kzyapkov / mem_usage.sh
Last active August 29, 2015 14:26 — forked from igrr/mem_usage.sh
Get memory usage from elf file (esp8266 toolchain, using linker script from SDK)
#!/bin/bash
# Print data, rodata, bss sizes in bytes
#
# Usage:
# OBJDUMP=../xtensa-lx106-elf/bin/xtensa-lx106-elf-objdump ./mem_usage.sh app.out [total_mem_size]
#
# If you specify total_mem_size, free heap size will also be printed
# For esp8266, total_mem_size is 81920
#