feat(uno-q): wire i2c_scan into the relay, allowlist, and modulino skill
- matrix-relay/relay.py: handle the `i2c` command → Bridge.call("i2c_scan").
- config.template: allow + auto-approve i2c_scan on the default risk profile.
- modulino skill: point "confirm a module is present" at i2c_scan (MCU Qwiic
bus) instead of the Linux i2cdetect.
Completes the container-native path: the three canned prompts (list I2C /
matrix pattern / scroll text) all run through the RouterBridge responder —
no /dev/i2c, no flash — so they work in the App Lab container node.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
c12f40837b
commit
8ce8474d33
@@ -82,8 +82,8 @@ prompt_injection_mode = "compact"
|
|||||||
# without a human approver (the webhook path is non-interactive).
|
# without a human approver (the webhook path is non-interactive).
|
||||||
[risk_profiles.default]
|
[risk_profiles.default]
|
||||||
level = "supervised"
|
level = "supervised"
|
||||||
allowed_tools = ["matrix_pattern", "matrix_text", "uno_q_flash", "sysfs_led", "camera", "network", "i2cdetect", "read_skill", "file_read", "content_search"]
|
allowed_tools = ["matrix_pattern", "matrix_text", "i2c_scan", "uno_q_flash", "sysfs_led", "camera", "network", "i2cdetect", "read_skill", "file_read", "content_search"]
|
||||||
auto_approve = ["matrix_pattern", "matrix_text", "uno_q_flash", "sysfs_led", "camera", "network", "i2cdetect", "read_skill", "file_read", "content_search"]
|
auto_approve = ["matrix_pattern", "matrix_text", "i2c_scan", "uno_q_flash", "sysfs_led", "camera", "network", "i2cdetect", "read_skill", "file_read", "content_search"]
|
||||||
|
|
||||||
[runtime_profiles.unoq]
|
[runtime_profiles.unoq]
|
||||||
agentic = true
|
agentic = true
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
# ping -> pong
|
# ping -> pong
|
||||||
# matrix <0-7> -> Bridge.call("matrix_set", id) preset animation
|
# matrix <0-7> -> Bridge.call("matrix_set", id) preset animation
|
||||||
# text <words...> -> Bridge.call("matrix_text", str) scroll text
|
# text <words...> -> Bridge.call("matrix_text", str) scroll text
|
||||||
|
# i2c -> Bridge.call("i2c_scan") list I2C devices (MCU)
|
||||||
# gpio_write <p> <v>-> Bridge.call("digitalWrite", p, v)
|
# gpio_write <p> <v>-> Bridge.call("digitalWrite", p, v)
|
||||||
# gpio_read <p> -> Bridge.call("digitalRead", p) -> value
|
# gpio_read <p> -> Bridge.call("digitalRead", p) -> value
|
||||||
import socket
|
import socket
|
||||||
@@ -33,6 +34,9 @@ def handle(conn):
|
|||||||
elif cmd == "text" and len(parts) >= 2:
|
elif cmd == "text" and len(parts) >= 2:
|
||||||
Bridge.call("matrix_text", " ".join(parts[1:]))
|
Bridge.call("matrix_text", " ".join(parts[1:]))
|
||||||
conn.sendall(b"ok\n")
|
conn.sendall(b"ok\n")
|
||||||
|
elif cmd == "i2c":
|
||||||
|
r = Bridge.call("i2c_scan")
|
||||||
|
conn.sendall(f"{r}\n".encode())
|
||||||
elif cmd == "gpio_write" and len(parts) >= 3:
|
elif cmd == "gpio_write" and len(parts) >= 3:
|
||||||
Bridge.call("digitalWrite", int(parts[1]), int(parts[2]))
|
Bridge.call("digitalWrite", int(parts[1]), int(parts[2]))
|
||||||
conn.sendall(b"ok\n")
|
conn.sendall(b"ok\n")
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ description: Plug-and-play Modulino sensors/actuators for the Arduino Uno Q —
|
|||||||
|
|
||||||
Modulinos are Arduino's Qwiic (I²C) plug-and-play modules. Chain them into the
|
Modulinos are Arduino's Qwiic (I²C) plug-and-play modules. Chain them into the
|
||||||
Uno Q's **Qwiic connector (I2C4)** — no soldering, no pull-ups to add. Use the
|
Uno Q's **Qwiic connector (I2C4)** — no soldering, no pull-ups to add. Use the
|
||||||
`Modulino` Arduino library on the MCU, or scan the bus with the `i2cdetect` tool.
|
`Modulino` Arduino library on the MCU, or scan the bus with the `i2c_scan` tool.
|
||||||
|
|
||||||
## Default I²C addresses
|
## Default I²C addresses
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ void loop() { int v = knob.get(); /* ... */ }
|
|||||||
|
|
||||||
## Tips
|
## Tips
|
||||||
|
|
||||||
- Confirm a module is present with `i2cdetect` (scan the Qwiic bus) — the address
|
- Confirm a module is present with `i2c_scan` (scan the Qwiic/I2C bus on the MCU) — the address
|
||||||
should match the table above.
|
should match the table above.
|
||||||
- Qwiic is 3.3 V, like the rest of the Arduino headers.
|
- Qwiic is 3.3 V, like the rest of the Arduino headers.
|
||||||
- The Movement Modulino (0x6A) is an IMU — handy for the workshop's sense loop.
|
- The Movement Modulino (0x6A) is an IMU — handy for the workshop's sense loop.
|
||||||
|
|||||||
Reference in New Issue
Block a user