Skip to content

Instantly share code, notes, and snippets.

View toxicantidote's full-sized avatar

toxicantidote

View GitHub Profile
@toxicantidote
toxicantidote / SolarInterface.py
Created April 25, 2022 11:32
MPP solar PIP-1012-MSE interfacing
#!/usr/bin/python3
## which serial port the MPP Solar inverter is connected to
serial_port = '/dev/ttyS0'
###
import serial ## provided by 'pyserial' from pip
import crc16 ## provided by 'crc16' from pip
import sys ## inbuilt library
@toxicantidote
toxicantidote / pinger.py
Last active June 22, 2021 01:26
Network host ping tool
## Site ping check tool ##
##
## Originally developed and tested on Win10 with Python 2.7. Updates made with
## Python 3.7, but should still work on Python 2.x provided the Tk install
## isn't ancient.
##
## Reads one or more files containing details of sites to ping, pings them at
## the defined frequency, and displays the result in a GUI.
##
## Within the host files, the last word on each line is considered to be the
@toxicantidote
toxicantidote / MCP2200 via websockets.py
Created October 26, 2018 11:23
Controlling MCP2200 (Denkovi relay) via Websockets and NanoPi switches
## Automation relay switcher server
## Allows control of MCP2200 based four port relay board via a websocket. Also interfaces with two pins
## on the NanoPi GPIO to read the state of two buttons using only two wires.
## Address to listen on. Set to 0.0.0.0 for all
listenAddress = '0.0.0.0'
## Port to listen on
listenPort = 8000
## Quick and dirty serial logger. Logs data received from a serial port.
## Port and baud rate selection
monitorPort = 'COM29'
monitorBaud = 115200
##
import serial
import time
import signal
#!/usr/bin/python3
##
## Interfacing with the MCP2200 GPIO via USB HID. Plays with the first four GPIO ports.
##
## Used for controlling 4 port USB relay board from Denkovi.
##
import usb.core
import usb.util
import time
@toxicantidote
toxicantidote / dir-505 shareport download.py
Last active September 8, 2017 15:13
Download from Dlink DIR-505 shareport service
## DIR-505 SharePort file download ##
##
## Written using a D-link DIR-505 running firmware version 1.09.
##
## This version seems to have a bug where read-only users can't list files in
## the 'folder view' mode. Because of this, the user specified needs to have
## read and write access.
##
## Note that this download is not recursive.
##