Skip to content

Instantly share code, notes, and snippets.

@djdunc
djdunc / d1mini-neopixel.ino
Created April 28, 2024 22:44
Arduino sketch for neopixel client responding to MQTT messages
// works with D1 Mini 8266 and 12 Neopixel ring
// https://adafruit.github.io/Adafruit_NeoPixel/html/class_adafruit___neo_pixel.html
#include <Adafruit_NeoPixel.h>
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#include <ArduinoJson.h>
#include "arduino_secrets.h"
@djdunc
djdunc / neopixel-via-mqtt.html
Last active April 28, 2024 22:27
a web page to control a 12 neopixels ring
<!-- Note: this html / js below is missing the standard html / head / body tags -->
<script src="/assets/js/paho-mqtt-min.js"></script>
<h2>Testing Neopixel from web colour pickers</h2>
<!-- this text will update depending on the value in the dropdown -->
<p id="mqttTopic">Connecting to "student/CASA0014/light/1/pixel/"</p>
<!-- This form displays if the user does not have the MQTT password saved in localstore -->
<div id="passwordForm" style="display:none;">
@djdunc
djdunc / solar2mqtt.py
Created February 4, 2024 08:54
script for sending solar inverter data to mqtt
import requests
from bs4 import BeautifulSoup
import paho.mqtt.client as mqtt
url = "http://192.168.1.232/monitor.htm"
username = 'xxx'
password = 'xxx'
# MQTT broker details
mqtt_broker = 'mqtt.cetools.org'
@djdunc
djdunc / TTNunoTMP36.ino
Created March 10, 2023 15:27
TTN Arduino Things Uno (Leonardo) with TMP36 sending to TTN
/*
Circuit:
* TMP36 middle pin attached to pin A0, left to VCC, right to GND
created Feb 2023
by Duncan Wilson
*/
#include <TheThingsNetwork.h>
// Set your AppEUI and AppKey
@djdunc
djdunc / TTN_Uno_TMP36.ino
Created March 10, 2023 12:57
TTN Uno Example for sending temperature from TMP36
/*
Circuit:
* TMP36 middle pin attached to pin A0, left to VCC, right to GND
created Feb 2023
by Duncan Wilson
*/
#include <TheThingsNetwork.h>
// Set your AppEUI and AppKey
@djdunc
djdunc / BIOS0031tmp36MQTT.ino
Last active January 22, 2024 12:19
BIOS0031 TMP36 to MQTT sketch
/*
WiFi TMP to MQTT
Circuit:
* LED attached to pin 9
* TMP36 attached to pin A0
created Feb 2023
by Duncan Wilson
*/
@djdunc
djdunc / ProjectIdeas.md
Last active March 16, 2023 01:40
Project Ideas

Connected Environments Dissertation Project Ideas

Contact Duncan Wilson if you are interested in these projects.

Patient Journeys in a Pop Up eye clinic

CASA have been working with Moorfields Eye Hospital to explore the potential for the use of pop-up eye clinics in retail outlets (Brent Cross) to catch up on COVID appointment backlog. Time motion data (x,y data ever 10 seconds) from approximately 4000 patient journies and 4 different activity layouts are available. This project would explore different ways of analysing trends in patient throughput over time and space. Requires data visualisation to inform communication of trends and or data analysis to extract meaning from the data.

[2023]

/*
* Testing reading from MQTT feed into JSON object in arduino
*
* Dependencies:
* WiFi101 library for connectivity
* ArduinoMqttClient library for subscribing to MQTT topic
* ArduinoJson library for parsing JSON
*
* Tested on Adafruit Feather MO Wifi with ATWINC500
*
@djdunc
djdunc / ttn-gw-console-parser.ipynb
Created January 3, 2023 18:19
TTN-GW-console-parser.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@djdunc
djdunc / student-random-list-generator.ipynb
Last active October 24, 2023 10:18
student-random-list-generator.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.