Skip to content

Instantly share code, notes, and snippets.

View matthijskooijman's full-sized avatar

Matthijs Kooijman matthijskooijman

View GitHub Profile
DEBUG:root:Received message{
"app_id":"meet-je-stad",
"dev_id":"18",
"hardware_serial":"0000000000000012",
"port":10,
"counter":132,
"payload_raw":"AAAAAAAABRVD5qw=",
"metadata":{
"time":"2017-03-24T06:12:51.840194288Z",
"frequency":867.3,
hostname:
network.system:
- hostname: {{ grains['id'] }}
- require:
- file: patch-salt-network-module
include:
- .patch
From gateway traffic:
{
"gw_id": "eui-0000024b080e020a",
"payload": "ALoDANB+1bNwOQAAAAAAAAD5CgxrOqk=",
"dev_eui": "0000000000000039",
"lora": {
"spreading_factor": 7,
"bandwidth": 125,
"air_time": 61696000
},
@matthijskooijman
matthijskooijman / 00Results
Last active February 8, 2018 11:41
delayMicroseconds test - original implementation
>> Constants @24Mhz
delayMicroseconds(0): OK
delayMicroseconds(1): ERR: -17 cycles == -0.71us
delayMicroseconds(2): ERR: -17 cycles == -0.71us
delayMicroseconds(3): ERR: -17 cycles == -0.71us
delayMicroseconds(4): ERR: -18 cycles == -0.75us
delayMicroseconds(5): ERR: -17 cycles == -0.71us
delayMicroseconds(6): ERR: -19 cycles == -0.79us
delayMicroseconds(7): ERR: -17 cycles == -0.71us
delayMicroseconds(8): ERR: -19 cycles == -0.79us
@matthijskooijman
matthijskooijman / 00Results
Created February 8, 2018 11:57
delayMicroseconds test - Paul's implementation
>> Constants @16Mhz
delayMicroseconds(0): OK
delayMicroseconds(1): OK
delayMicroseconds(2): OK
delayMicroseconds(3): OK
delayMicroseconds(4): OK
delayMicroseconds(5): OK
delayMicroseconds(6): OK
delayMicroseconds(7): OK
delayMicroseconds(8): OK
// This approach is the simplest and does not fix the rounding issue, so
// this OK/-1/-2/-3 pattern repeats over and over (all delays are
// rounded down to a multiple of 3)
delayMicroseconds(0): ERR: 5 cycles == 5.00us
delayMicroseconds(1): ERR: 4 cycles == 4.00us
delayMicroseconds(2): ERR: 3 cycles == 3.00us
delayMicroseconds(3): ERR: 2 cycles == 2.00us
delayMicroseconds(4): ERR: 1 cycles == 1.00us
delayMicroseconds(5): OK
delayMicroseconds(6): ERR: -1 cycles == -1.00us
@matthijskooijman
matthijskooijman / gist:0bb6ef88d086b7dd2e01f669f75699a1
Created April 30, 2018 13:16
ICU symbols used by OpenTTD 1.8.0 from ICU 60
0000000000000000 DF *UND* 0000000000000000 icu_60::ParagraphLayout::Line::getWidth() const
0000000000000000 DF *UND* 0000000000000000 icu_60::BreakIterator::createCharacterInstance(icu_60::Locale const&, UErrorCode&)
0000000000000000 DF *UND* 0000000000000000 icu_60::LEFontInstance::unitsToPoints(LEPoint&, LEPoint&) const
0000000000000000 DF *UND* 0000000000000000 icu_60::LEFontInstance::~LEFontInstance()
0000000000000000 DF *UND* 0000000000000000 icu_60::Locale::~Locale()
0000000000000000 DF *UND* 0000000000000000 icu_60::LEFontInstance::yPixelsToUnits(float) const
0000000000000000 DF *UND* 0000000000000000 icu_60::Collator::createInstance(icu_60::Locale const&, UErrorCode&)
0000000000000000 DF *UND* 0000000000000000 icu_60::UMemory::operator new(unsigned long)
0000000000000000 DF *UND* 0000000000000000 icu_60::StringPiece::StringPiece(char const*)
%YAML 1.1
---
# meetjestad.sensors_measurement
-
id: 2591299
station_id: 122
message_id: 2560602
timestamp: "2018-05-17 07:00:57"
latitude: 52.1712
longitude: 5.3945
@matthijskooijman
matthijskooijman / gist:89e3fd69aaf714466524eb93f7197260
Created August 29, 2018 14:55
Read AVR / Atmega2560 signature byte area; signature is at addresses 0, 2, 4, calibration byte is at address 1
#include <avr/boot.h>
void setup() {
Serial.begin(115200);
// put your setup code here, to run once:
for (uint8_t i = 0; i < 16; ++i) {
Serial.print(i);
Serial.print(": ");
Serial.println(boot_signature_byte_get(i), HEX);
}
# Pinout based on http://doswa.com/2010/08/24/avrdude-5-10-with-ftdi-bitbang.html
# I could not use the builtin ft232r and others, since these all need
# different handshaking pins
programmer
id = "ftdi_cts_dtr";
desc = "FTDI adapter with CTS and DTR exposed";
type = "ftdi_syncbb";
connection_type = usb;
miso = 1; # RXD
sck = 3; # CTS