Skip to content

Instantly share code, notes, and snippets.

View AlphaSierraHotel's full-sized avatar

Allen Hubble AlphaSierraHotel

  • Toronto, Canada
View GitHub Profile
@AlphaSierraHotel
AlphaSierraHotel / mqtt_basic_receive_process_in_loop.ino
Created May 29, 2022 04:07
pubsubclient MQTT Basic example receiving a message, process it in the main loop()
/*
The link below was the starting point for this program. Compare this gist with that to see the changes made.
https://github.com/knolleary/pubsubclient/blob/2d228f2f862a95846c65a8518c79f48dfc8f188c/examples/mqtt_basic/mqtt_basic.ino
*/
/*
Basic MQTT example
This sketch demonstrates the basic capabilities of the library.
It connects to an MQTT server then:
@AlphaSierraHotel
AlphaSierraHotel / read_hex.py
Created January 12, 2021 01:56
Read binary data from a serial port and output each byte in hexadecimal.
#!/usr/bin/python
import serial
import signal
import sys
# Specify your communication parameters here
ser = serial.Serial(
port="/dev/ttyUSB0",
baudrate = 9600,
@AlphaSierraHotel
AlphaSierraHotel / grabserial.commit_3f4f5b4
Last active January 20, 2021 15:51
To illustrate what I did for outputting HEX from grabserial -- SEE MY COMMENTS BELOW THE CODE
#!/usr/bin/python
# -*- coding: utf-8 -*-
# vim: set ts=4 sw=4 et :
#
# grabserial - program to read a serial port and send the data to stdout
#
# Copyright 2006,2020 Sony Corporation
#
# This program is provided under the Gnu General Public License (GPL)
# version 2 ONLY. This program is distributed WITHOUT ANY WARRANTY.
@AlphaSierraHotel
AlphaSierraHotel / Log_Parser.html
Last active December 19, 2019 23:25
HTML for MySensors Log Parser in MyController Dashboard
Interpreting the logs from your node or gateway can be a bit tedious. On this page you can paste the output and get a more human readable output. [<a href="https://www.mysensors.org/apidocs/group__MyTransportgrp.html#details">More details about the log messages</a>]
<div id="parser">
<h4>Paste log from gateway or node here:</h4>
<textarea class="form-control" @change="parse" rows="10" v-model="source"></textarea>
<button @click="parse" class="btn btn-primary">Parse</button>
<button @click="copy" class="btn btn-primary">Copy this log URL to clipboard</button>
<button @click="source=''" class="btn btn-default">Clear</button>
<h4>Human readable output:</h4>
Interpreting the logs from your node or gateway can be a bit tedious. On this page you can paste the output and get a more human readable output. [More details about the log messages](https://www.mysensors.org/apidocs/group__MyTransportgrp.html#details).
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.1.10/vue.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<div id="parser">
<h4>Paste log from gateway or node here:</h4>
<textarea class="form-control" @change="parse" rows="10" v-model="source"></textarea>
<button @click="parse" class="btn btn-primary">Parse</button>
<button @click="copy" class="btn btn-primary">Copy this log URL to clipboard</button>
<button @click="source=''" class="btn btn-default">Clear</button>