How njgraham/things2c works
Project type and purpose
• This is an IoT surveillance/notification system built around Raspberry Pis. It uses NFC tags to arm/disarm motion detection, records video on motion events, publishes messages via MQTT, controls an LED indicator, uploads video clips to S3 or ownCloud, and pushes mobile alerts via Pushover.
• Its primary purpose is home monitoring: turning off motion alerts when the owner’s NFC keyfob is present, flashing a status LED, recording clips, pushing notifications, and storing video.
File structure
• Top‐level scripts and configs:
• Dockerfile_broker, Dockerfile_motion, Dockerfile_things2c: containerize Mosquitto, Motion daemon, and the things2c Python tool.
• build_*.sh, run_*.sh: build and launch containers.
• config.py, version.py: shared configuration and version info.
• deployment/ subdirectory:
• ansible playbook (playbook.yml) plus service config fragments for mosquitto, motion, motionctl, nfc_scan, blinkctl, filemanager, watchdog.
• hosts example, udev rules for the NFC reader.
• Python modules and CLI:
• things2c.py: entry point with subcommands (nfc_scan, motionctl, watchdog, blinkctl, notify, publish, snoop, filemanager).
• mqtt_client.py: abstracts MQTT publish/subscribe.
• nfc_interface.py, nfc_write_rnd.py: read NFC tags.
• pushover_notify.py: mobile alerts.
• file_manager.py: upload/delete video clips.
• Shell helpers: update_motion_conf.sh.
• Requirements.txt lists dependencies like nfcpy, blink(1) tools, mosquitto client, etc.
README for additional insights
• High‐level design: NFC reader and motion sensor feed into things2c via MQTT. things2c orchestrates state, notifies via Pushover, controls blink(1), triggers uploads.
• External services: Amazon S3 or ownCloud for storage, Pushover for mobile push.
• Deployment uses Docker optionally and Ansible.