Python code to drive Nixie smart sockets
- ONLY can drive smart sockets at the moment.
- Gets time and date biased off Geo located IP.
- Supports ESP32 and local Linux serial port modes (can be driven from a serial port under linux or burnt into MicroPython F/W)
- Direct drive of any non smart socket nixie tube
- Way to much is hard coded
- H/V shutdown
- Smart socket tube setting / per tube / at all
- Reading temp/humidity sensors
- Machine UART pin number
- Serial device for PC/linux mode
- Time format 12/24h
- Date format (range of types supported)
- What to do on 10/15/3060min window intervals
- What time the intervals are
Basic tests are written, but needs more. Coverage is around 60% so pretty low at the moment.
You can run tests via:
tox
NOTE this is ONLY needed for ESP32 mode.
Uses Earthly.dev to build the latests MicroPython F/W based on a set tag of the Espressif framework.
earthly +firmware
earthly --build-arg SERIAL_PORT=/dev/ttyUSB0 +flash
** Where /dev/ttyUSB
is your ESP32 device.
import wifi_setup
import clock
wifi_setup = wifi_setup.WIFI_setup('AP_SSID','YOUR_PASSWORD')
wifi_setup.connect()
# Run in 24 Hour mode, with 6 sockets and date format of DD-MM-YY on an ESP32 device.
# Breakdown of the function: clock.MainLoop(DEVICE TYPE, SOCKET COUNT, TIME FORMAT, DATE FORMAT, SERIAL DEVICE)
run = clock.MainLoop('micropython','6','24h', 'DDMMYY', 'micropython')
run.main()
Set up your serial device and time preferences in the code and run modules/clock.py
.
- Smart sockets
- If using Micropython ( All from https://github.com/micropython/micropython-lib )