Skip to content

Instantly share code, notes, and snippets.

@alferz
alferz / gist:4ff1433ae43d15b2b4a26c51a3ec569c
Created February 5, 2018 23:08
Python Coinbase API with API-Key Auth Example (SHA256 HMAC Signature)
def getCoinbaseData(path):
import urllib2, json
import hmac
import hashlib
import base64
import time
apiKey = '<YOUR API KEY>'
apiSecret = '<YOUR API SECRET>'
@alferz
alferz / jksimple.py
Last active January 18, 2024 16:33
Simple Python Script to Query a JKBMS (JiKong Battery Management System) over TTL / RS-485
# This script reads the data from a JK BMS over USB-TTL and formats
# Credit to https://github.com/PurpleAlien/jk-bms_grafana
# Instructions:
# Change Serial port on line 17 and run with python3+. Dumps register 0x83 (total pack voltage) to verify BMS communication.
import time
import sys, os, io
import struct
@alferz
alferz / lgairctrl.py
Last active March 2, 2024 17:46
LG Air Conditioner Infrared Control Python Script with pigpio
#!/usr/bin/env python
# lgairctrl.py
# 2024-03-01
# Public Domain
"""
A utility to send an infrared command to certain, unknown models of LG Air Conditioners equipped with infrared. This utility currently supports the United States model LW1022IVSM with Fahrenheit temperature control (and probably many others). This script is meant to be run on a Raspberry Pi with pigpiod installed and an infrared LED module, or a bare IR LED with NPN transistor base connected to one of the GPIO pins.
To send a command use the following format. All options are required.