New: the AI firewall watches the whole platform and explains each incident in plain words. See how it works

Kevin Y.

kevin.sec

@kevin-young · Joined February 2025

Newcomer

IT and security admin · energy · 17 years in the field

Topics
4
Replies
16
Points
0
Newcomer10 points to Member

Forum Replies Created

Viewing 15 posts – 1 through 15 (of 16 total)

Moved both boards to SPI0 with CE0/CE1, removed the two overlays, three days without a crash and the readings match the old ones within 0.1 °C. Thanks Aoife. @Keisha the offline alarm wouldn’t help there since the Pi is still online. A threshold rule can’t see a missing key either, as far as I know. We’re looking at a flow watchdog for that.

♥ 0

Good, that’s the same setup we use for a few signal lamps. Three pieces:

  1. Device profile of the relay, Commands tab: add a command light.set, tier Basic, one parameter on of type Yes / no. Tier matters, because an API key can only send methods that are in the profile’s catalog.
  2. Firmware: subscribe to v1/rpc/req/+, switch GPIO12 (the relay on the Basic R2), answer on the same id, and report the new state.
void onMsg(char* topic, byte* p, unsigned int n) {
  // topic: v1/rpc/req/42
  String id = String(topic).substring(11);
  StaticJsonDocument<128> d; deserializeJson(d, p, n);
  bool on = d["params"]["on"];
  digitalWrite(12, on ? HIGH : LOW);
  mqtt.publish(("v1/rpc/res/" + id).c_str(), "{"ok":true}");
  mqtt.publish("v1/telemetry", on ? "{"relay":1}" : "{"relay":0}");
}
  1. Your script: an API key from API Keys (Developer menu) with only what it needs. The send route wants iot_rpc.read plus the tier’s permission, so tick those two and nothing else, fill the IP allowlist with the lab PC’s address and keep the 90-day expiry.
import requests
r = requests.post(
    f"https://{HOST}/tenant/{TENANT}/api/iot/devices/{DEVICE}/rpc",
    headers={"Authorization": f"Bearer {KEY}"},
    json={"method": "light.set", "params": {"on": True}, "timeoutMs": 10000},
)
print(r.status_code, r.json()["rpc"]["status"])

A two-way command with a timeout of 30 s or less waits and comes back 200 with SUCCESSFUL. Reference: Commands API

The ESP8266 does TLS, but memory is tight; use BearSSL with smaller buffers if the connect fails.

Accepted solution♥ 4

Exactly what I needed for the meeting. I explained the trapped air and stuck spool cases with Laura’s wording and management stopped asking about removing a part. I also told them no cloud product, Hermetry Safe included, takes over the safety chain, it stays hardwired. We added the aux contact and the dump valve pressure switch as telemetry, plus an alarm when the e-stop is active and the dump has not vented within 5 seconds. Tested it on Friday with the engineer present.

♥ 0
Viewing 15 posts – 1 through 15 (of 16 total)