Skip to content

Instantly share code, notes, and snippets.

@thzinc
thzinc / hap.py
Created October 31, 2023 23:48
Minimum viable POC for mDNS to support HomeKit Accessory Protocol in CircuitPython 9.x with mDNS TXT record support
class Accessory:
aid: int
services: list = []
class Service:
type: str
iid: int
characteristics: list = []
hidden: bool

I have done this on Challenger LTE board link, which is RP2040 based.

You need to enable data serial at boot (boot.py), this is disabled by default. When the board boots you need to run file serial_passthrough.py the program.

Your computer will report new COM/Serial port. Use that to talk with the device connected to uart of the CircuitPython board.

Create files on CIRCUITPY

file: boot.py

@Neradoc
Neradoc / finderbug-cpy.md
Last active June 14, 2023 23:05
Finder bug when openning files with multiple boards connected

First, random bits from discord conversation:

has anyone encountered a situation on macOS (Catalina) where you double click "code.py" on one circuit python drive but it opens the code.py from another ? I often have multiple devices connected, usually with different drive names (CLUE, QTPY, etc). It happens with different apps, or using the open command line, but it does not happen when using the "open" dialog from within the apps.

let's say I have "BLUEREMOTE" (a feather nrf52) and "CIRCUITBLUE" (a CPB), typing open /Volumes/CIRCUITBLUE/code.py actually opens /Volumes/BLUEREMOTE/code.py

@Neradoc Yes. Lately in Finder, only one CIRCUITPY drive out of many shows up. And so it only opens the files from that drive if I'm opening through finder. I've had to go through command line to find them, or go into /Volumes in Finder.

@ryang14
ryang14 / code.py
Created May 12, 2020 22:39
Code to use CircuitPython over WiFi. Very rough around the edges, but seems to work pretty well
import storage
import adafruit_requests as requests
import networkInit # Board specific network connection
try:
from secrets import secrets
connectionString = secrets["ota_connection_string"]
except (ImportError, KeyError):
print("Connection string is kept in secrets.py, please add it there!")
This gist contains experimental builds of the NINA firmware for Adafruit products.
*** Please DO NOT USE THESE unless you are willing to accept the risks of bricking your hardware ***