Skip to content

Instantly share code, notes, and snippets.

@benemorius
benemorius / wiegand-rpi.txt
Last active January 10, 2022 08:32
wiegand-rpi parts
relay $0.35 https://lcsc.com/product-detail/Power-Relays_Omron-Electronics-G5NB-1A-E-DC12_C225714.html
relay fet $0.03 https://lcsc.com/product-detail/MOSFETs_FUXINSEMI-2N7002KD_C880912.html
relay diode $0.01 https://lcsc.com/product-detail/Switching-Diode_TWGMC-BAV70_C727123.html
relay output polyfuse 750mA $0.06 https://lcsc.com/product-detail/Resettable-Fuses_BHFUSE-BSMD0805-075-16V_C976303.html
wiegand 12v output polyfuse 750mA $0.06 https://lcsc.com/product-detail/Resettable-Fuses_BHFUSE-BSMD0805-075-16V_C976303.html
wiegand input zener $0.03 https://lcsc.com/product-detail/Zener-Diodes_PANJIT-International-BZX84B2V7_R1_00001_C188540.html
total cost (just for those parts) for an 8 channel board: $4.16
no excuse anymore for using 8-bit $1.05 https://lcsc.com/product-detail/ST-Microelectronics_STMicroelectronics-STM32G030F6P6_C724040.html

python3 -m venv venv # maybe need apt install python3-venv

. venv/bin/activate

pip -r requirements.txt

@benemorius
benemorius / raspberry-wifi-conf.sh
Last active August 27, 2020 20:32
install script for raspberry-wifi-conf
#
# run these commands as root to install raspberry-wifi-conf on any pi zero through 4
#
# update apt and install npm and git
apt update
apt install npm git -y
# install bower
npm install bower -g
@benemorius
benemorius / rpi-kw41z-slip.sh
Created November 12, 2019 01:51
configure a raspberry pi for a kw41z-slip module
#!/bin/bash
set -x
# This script enables the UART and disables kernel output and getty on it
# and installs OpenOCD from source and compiles RIOT from source and flashes
# the gnrc_border_router example onto a kw41z-slip module.
#
# It takes about 5 minutes on rpi4 up to maybe an hour on rpi0.
#
# A reboot is required if /dev/serial0 isn't already enabled.
@benemorius
benemorius / rpiweather.py
Created February 6, 2017 18:46
receives data from Argent 80422 and other sensors and sends it to Weewx over UDP
#!/usr/bin/python3
import threading
import Adafruit_ADS1x15
import RPi.GPIO as GPIO
import time
from datetime import datetime
import json
import socket
import Adafruit_BMP.BMP280 as BMP280
@benemorius
benemorius / netlistener.py
Created February 6, 2017 18:44
generic Weewx station driver listens on a UDP port for JSON weather sensor data
from __future__ import with_statement
import math
import time
import json
import socket
import weedb
import weewx.drivers
import weeutil.weeutil
#!/bin/bash
iwpan phy0 set channel 0 11
iwpan dev wpan0 set pan_id 0x777
ip link add link wpan0 name lowpan0 type lowpan
ifconfig wpan0 up
ifconfig lowpan0 up
(load (build-path geda-rc-path "gschem-colormap-lightbg"))
(load (build-path geda-rc-path "print-colormap-lightbg"))
(output-color "enabled")
;(undo-panzoom "disabled")
;(zoom-with-pan "disabled")
(fast-mousepan "disabled")
;(scroll-wheel "gtk")
(warp-cursor "disabled")
2014-11-11 12:30:38,670 - [1] DHT - INFO - Trying handshake with new peer: "Default" tcp://<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Status</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
<link rel="icon" type="image/ico" href="/favicon.ico" />
<link rel="stylesheet" type="text/css" href="/baseINID.css" />
<link rel="stylesheet" type="text/css" href="/INID.css" />
<script language="javascript" type="text/javascript"><!--
function isWinIE6() {
Traceback (most recent call last):
File "/usr/lib64/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib64/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "node/trust.py", line 45, in get_history
history = bitcoin.history(addr)
File "/home/stilwellt/projects/OpenBazaar/env/lib/python2.7/site-packages/bitcoin/bci.py", line 114, in history
(addr, offset))
File "/home/stilwellt/projects/OpenBazaar/env/lib/python2.7/site-packages/bitcoin/bci.py", line 21, in make_request