Skip to content

Instantly share code, notes, and snippets.

View bbartling's full-sized avatar

Ben Bartling bbartling

  • https://slipstreaminc.org/
  • Madison, WI
View GitHub Profile
@bbartling
bbartling / main.py
Last active April 8, 2024 13:32
PID logic sim for a HVAC VAV box
class VavBoxController:
'''
TODO add in -
state machines for sensor reliability
air flow PID control for damper
integral windup prevention
occupancy state for unoc setpoints
'''
def __init__(
@bbartling
bbartling / tester.py
Last active February 19, 2024 19:20
An handy dandy compilation and then some of the bapypes3 sample apps with the bacpypes console
"""
I may expand on this so lets say this one is v0.0.1
Bring up the bacpypes3 console with debug
$ python3 tester.py --debug
run on static IP for UDP port 47820 with passing in Address arg
$ python3 tester.py --address 10.7.6.201/24:47820 --debug
See all available commands
@bbartling
bbartling / valve_select_prompt_template.py
Last active October 10, 2023 00:40
concept idea prompt engineering template for controls hardware or application engineering to select valves for a job
import openai
import json
# Example usage of a valve for a job:
flow_rate = 5 # GPM
delta_p = 3 # PSI
specific_gravity = 1
fluid_type = "water"
is_three_way = False
@bbartling
bbartling / Dockerfile
Last active February 9, 2024 17:15
bacpypes3 example of a BACnet server ran Docker on rasp pi hardware with Alpine Linux. App is a make over of legacy bacpypes mini_device.py from repo samples directory but in bacpypes3 asyncio version
# Use an Alpine Linux base image for Raspberry Pi
FROM arm32v7/alpine:latest
# Set the working directory in the container
WORKDIR /app
# Install necessary packages and dependencies
RUN apk --no-cache add python3 python3-dev py3-pip
# Install BACpypes and any other required dependencies
@bbartling
bbartling / bacnet_test.py
Last active September 18, 2023 14:58
simple BAC0 scripts
import requests
import BAC0
import time
import random
bacnet = BAC0.lite()
while True:
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.