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

Michael Wilson

wilsonmaker

@wilson-m · Joined July 2025

Newcomer

Maker · home automation · Nottingham · new to IoT

Topics
14
Replies
70
Points
0
Newcomer10 points to Member

Forum Replies Created

Viewing 15 posts – 31 through 45 (of 70 total)

I’m a beginner too but I had exactly this with my weather station PC last winter, and the fix was to stop caring about the number. Find the port by what’s plugged into it instead. pyserial can list ports with their USB ids and serial number:

from serial.tools import list_ports

def find_arduino():
    for p in list_ports.comports():
        print(p.device, p.vid, p.pid, p.serial_number, p.description)
        if p.vid == 0x2341 and p.serial_number == "85736323838351F0B0E1":
            return p.device
    return None

port = find_arduino()
ser = serial.Serial(port, 9600, timeout=2)

Run it once to print yours and copy the serial number in. 0x2341 is the vendor id of genuine Arduino boards. If yours is a clone with a CH340 chip (vid 0x1A86), careful: those usually have no serial number, so with two clones you can’t tell them apart and you’d match on p.location (the USB socket) instead.

Also wrap the read loop so it looks for the port again after an error instead of dying, then people can replug whenever they like.

Ask me about 4–20 mA.
Accepted solution♥ 8

Yep did the same mistake on paper last winter at home. You want a dry contact, so either a relay module that’s volt-free (the Sonoff RE5V1C style board, or any ESP8266 plus a 5 V relay module wired COM/NO) across the thermostat terminals, in parallel with the old thermostat so it still works if your board dies.

The board side was easier than I thought once I found the catalogue. Open the device’s profile, Commands tab, Add command:

Method:  heat.set
Label:   Heating
Tier:    Basic
Parameters: on (Yes / no, required)

Only Basic tier commands from that list show up in the Switch settings. Then in the Switch: Run a command, pick the device and heat.set, value from “The control’s value”. Bind Current state to a telemetry key the board reports, I send heat_on as 0/1 with every reading so the switch shows what the relay is really doing, not what you clicked. For a light or heating you can turn “Ask before running” off. Reply on the same id or the card sits on “Sent; waiting for the device”:

// in callback, topic "v1/rpc/req/17"
String id = String(topic).substring(11);
digitalWrite(RELAY, on ? HIGH : LOW);
mqtt.publish(("v1/rpc/res/" + id).c_str(), "{"ok":true}");

Page I used: Control cards.

Ask me about 4–20 mA.
Accepted solution♥ 5

I looked into this for a friend’s small bakery. I couldn’t find a doc page for Forge either, so I can’t tell you what it does for quality or how it gets on a plan.

What works with the normal IoT part: have the sensor’s controller (or a small PLC) send the thickness of each piece, or the min/max/average per 10 s, as telemetry, e.g. {"thick_mm": 7.12, "rejects": 3}. Then an alarm rule on the profile for out of tolerance. There’s no “between” operator, but you can group conditions with any:

{ "any": [
  { "key": "thick_mm", "op": "<", "value": 6.0 },
  { "key": "thick_mm", "op": ">", "value": 8.0 }
] }

For counts per shift, send a growing rejects_total counter and chart it with the increase aggregate per hour. The reject gate itself must be driven locally by the sensor controller or PLC, not from the cloud; a belt at 0.4 m/s can’t wait on a round trip.

The conditions reference is Alarm conditions reference.

Ask me about 4–20 mA.
Accepted solution♥ 3

DNSServer + WiFiManager and the portal pops up on both phones now. Provisioning worked first time with pre-created names; I read the 30 chip IDs over serial into a CSV first. Forgot to save the token to NVS on my first build, so on reboot it tried to provision again and got device_exists. Fixed, and stickers are printed.

Ask me about 4–20 mA.
♥ 1

That was it. Guest network hands out the router as DNS fine, but my sketch was using a hardcoded NTP IP that a firewall blocked, so the clock never set and TLS failed. Switched it to pool.ntp.org and the sensor came back. All five are on the guest network now, isolation off, and the work laptop can’t see them.

Didn’t touch the port forwarding, Kevin, thanks anyway.

Ask me about 4–20 mA.
♥ 2
Viewing 15 posts – 31 through 45 (of 70 total)