Short version: How do I send an I2C command from a python script
Long version: I have a project in mind using an RPi and an SDR as part if an alarm system. Running on the RPi will be an app (rtl_433) that logs to syslog and a python script that reads the syslog (continuously) and if a match is found, sends a message to a hat via the I2C interface.
rtl_433 sample code for the latter is
I want it to say
or something like that. I am not a python programmer. I'm a long time assembly language programmer and recent C/C++ programmer (Arduino), but not a python programmer.
This will also be my first real experience with an RPi. I'm fundamentally a Windows guy, but am pretty comfortable with Linux.
Any hints appreciated.
Long version: I have a project in mind using an RPi and an SDR as part if an alarm system. Running on the RPi will be an app (rtl_433) that logs to syslog and a python script that reads the syslog (continuously) and if a match is found, sends a message to a hat via the I2C interface.
rtl_433 sample code for the latter is
Code:
if "closed" in data: if data["closed"] == 0: print(label + ' Battery empty!')Code:
if "closed" in data: if data["closed"] == 0: send_I2C(1):This will also be my first real experience with an RPi. I'm fundamentally a Windows guy, but am pretty comfortable with Linux.
Any hints appreciated.
Statistics: Posted by alan-bc — Sat Aug 09, 2025 4:54 pm