Skip to content

Instantly share code, notes, and snippets.

Andrew Elwell Elwell

Block or report user

Report or block Elwell

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Elwell
Elwell / publish.ino
Last active Aug 29, 2015
testcase for pubsubclient retained
View publish.ino
// Reed Switch to MQTT publisher for home
// Andrew Elwell, May 2015
#include <SPI.h>
#include <Ethernet.h>
#include <PubSubClient.h>
byte mac[] = { 0x00, 0x04, 0xA3, 0x2C, 0x1D, 0xF1 };
byte server[] = { 10, 1, 1, 251 };
@Elwell
Elwell / gist:35dea60bf32e02ed9fcf
Created May 16, 2015
Arduino Ethernet to MQTT publisher
View gist:35dea60bf32e02ed9fcf
// Reed Switch to MQTT publisher for home
// Andrew Elwell, May 2015
#include <SPI.h>
#include <Ethernet.h>
#include <PubSubClient.h>
byte mac[] = { 0x00, 0x04, 0xA3, 0x2C, 0x1D, 0xF1 };
byte server[] = { 10, 1, 1, 251 };
View keybase.md

Keybase proof

I hereby claim:

  • I am Elwell on github.
  • I am elwell (https://keybase.io/elwell) on keybase.
  • I have a public key whose fingerprint is 86FE 807B 075D 6A0E 9D02 A0DE B252 F8D8 F822 3247

To claim this, I am signing this object:

@Elwell
Elwell / log
Created May 11, 2014
nanode uip
View log
#include <UIPEthernet.h>
EthernetClient client;
signed long next;
int led = 6;
void setup() {
pinMode(led, OUTPUT);
digitalWrite(led, HIGH);
Serial.begin(115200);
View roundup issue.item.html patch
--- issue.item.html-orig 2011-03-20 00:24:03.049357938 +0800
+++ issue.item.html 2014-04-15 01:41:32.974950437 +0800
@@ -74,7 +74,16 @@
<tr>
<th i18n:translate="">Assigned To</th>
- <td tal:content="structure context/assignedto/menu">assignedto menu</td>
+ <td>
+ <select name="assignedto">
+ <option value="-1">- no selection -</option>
@Elwell
Elwell / gist:6505599
Created Sep 10, 2013
mosquitto debugging
View gist:6505599
read_pv was failing when publishing (hangs after publish), so knocked up a dummy test client with static dictionary
andrew@guruplug:~$ ./debug_mqtt.py
{'AC_Hz': 2925, 'PV_A': 11, 'Out_W': 3428, 'PV_W': 3355, 'PV_V': 3014, 'kWh_Total': 1851, 'timestamp': 1378793395.40962, 'pid': 6573, 'kWh_today': 17, 'AC_V': 11}
loop start
^C
^C
^Z
[2]+ Stopped ./debug_mqtt.py
andrew@guruplug:~$ killall debug_mqtt.py
@Elwell
Elwell / read_values.py
Last active Dec 22, 2015
simple test script to poll serial modbus
View read_values.py
#!/usr/bin/python
# script to poll growatt PV inverter and spit out values
# Andrew Elwell <Andrew.Elwell@gmail.com> 2013-09-01
from pymodbus.client.sync import ModbusSerialClient as ModbusClient
import time
import sys
start = int(sys.argv[1])
View gist:5663508
ldapsearch -LLL -x -h localhost -p 2170 -b GLUE2GroupID=grid,o=glue '(&(objectClass=GLUE2ComputingShare)(GLUE2ComputingShareMaxCPUTime=999999999))' | perl -p00e 's/\r?\n //g' | grep dn: | cut -d"=" -f5 | cut -d"," -f1 | sort | uniq
View ow_parsename.c.patch
diff -u -r1.220 ow_parsename.c
--- ../../..//owlib/src/c/ow_parsename.c 24 Jul 2012 01:47:31 -0000 1.220
+++ ../../..//owlib/src/c/ow_parsename.c 8 May 2013 14:39:46 -0000
@@ -343,11 +343,11 @@
return parse_nonreal;
} else if (strcasecmp(pathnow, "text") == 0) {
- pn->state |= ePS_json;
+ pn->state |= ePS_text;
return parse_first;
@Elwell
Elwell / gist:5145625
Created Mar 12, 2013
Peering wierdness between AS24904 and AS13030
View gist:5145625
$ traceroute -a zurich.aprs2.net
traceroute to zurich.aprs2.net (213.144.138.93), 64 hops max, 52 byte packets
1 [AS28513] router (192.168.1.1) 1.596 ms 0.908 ms 0.774 ms
2 [AS24904] border1-sgp.kwaoo.net (178.250.215.254) 1.491 ms 1.817 ms 1.612 ms
3 [AS24904] border1-cixp.kwaoo.net (178.250.208.6) 1.733 ms 1.857 ms 1.636 ms
4 [AS513] cixp.init7.net (192.65.185.193) 6.125 ms 2.067 ms 12.666 ms
5 [AS13030] r1qls1.core.init7.net (77.109.128.65) 2.762 ms 2.529 ms 13.410 ms
6 [AS13030] r1ber1.core.init7.net (77.109.128.181) 3.754 ms 3.736 ms 3.861 ms
7 [AS13030] r1zba1.core.init7.net (77.109.128.173) 6.119 ms 12.326 ms 4.891 ms
8 [AS13030] r1zlz1.core.init7.net (77.109.128.229) 4.996 ms 5.397 ms 13.835 ms
You can’t perform that action at this time.