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

Aoife Lynch

lynchlab

@aoife_l22 · Joined April 2025

Newcomer

Engineering student · university

Topics
15
Replies
79
Points
0
Newcomer10 points to Member

Forum Replies Created

Viewing 15 posts – 61 through 75 (of 79 total)

Not the same network everywhere sadly. Two buildings are on a separate IoT SSID, one lab has its own router, and the passwords get rotated each term. Plus the tokens have to be different per node anyway.

Timestamps in UTC or it didn't happen.
♥ 2

Liam’s half right. avr-libc’s printf family is built without float support by default to save flash, so %f prints ?. You can link the float version (-Wl,-u,vfprintf -lprintf_flt) but it costs about 1.5 KB of flash and the Arduino IDE makes the flags annoying.

What I do on Nanos is convert the floats with dtostrf first, then format strings:

char ts[8], hs[8], buf[96];
dtostrf(t, 0, 2, ts);      // width 0 = no padding
dtostrf(h, 0, 1, hs);
snprintf(buf, sizeof(buf), "{"temp_c":%s,"rh":%s,"seq":%lu}", ts, hs, seq);

Or send integers: temp_c10 as 2154 and scale it back later. Same quota, zero float formatting. Also check for NaN when the SHT31 read fails: dtostrf prints nan, which isn’t valid JSON, and the whole message gets stored as raw text. Skip the key when the read fails.

Timestamps in UTC or it didn't happen.
Accepted solution♥ 5

Both fixed. The society bought the isolated carrier for the pH circuit and the 0.3 jumps are gone. The JSON rule with the any group saved fine, and the pump ran three times today without a single alarm. Then I dropped the probe in pH 4 buffer to test and it opened after five minutes, as expected.

Timestamps in UTC or it didn't happen.
♥ 1

Really helpful, thank you. Supervisor accepted “public CA on card, secrets in encrypted NVS”. The X.509 bit saved me a week, I had already started generating a CA with openssl. Funny enough I had cloned the card for a second board last week and the data was patchy, it was exactly the takeover thing.

Timestamps in UTC or it didn't happen.
♥ 1

Did our final-year project on almost exactly this (smart meters over 2G, we sniffed our own). Everything Laura said. Here’s what I’d do in your position, in this order.

First, split the profile. Make a new profile for the 38 TLS units and leave it on the default, TLS only on 8883. Move them over. That profile’s devices can’t log in on 1883 at all, so even if somebody pokes at them nothing goes in clear.

Second, the 12 old ones get their own profile with plain MQTT allowed, and you lock it down hard:

  • Allowed networks: put in only the address range your operator’s traffic comes from. Ask the operator for a private APN if you can, then it’s their private range. Anything outside gets refused (CONNACK 5).
  • Commands allowed without TLS: leave it empty, or at most sys.info. Never sys.reboot. Other commands just wait for a TLS session, which these units will never have, so they expire.
  • Allowed authentication: only access token if that’s all they use.

Third, rotate the token of the cabinet the tester captured, and honestly all 12, because they’ve been crossing the internet in clear for two years.

Firmware updates and device settings are never sent in clear anyway, so you’re not leaking those. Everything above is on this page: Device transport security. For IT, the honest answer is “38 are encrypted end to end, 12 are not and are fenced in until they’re replaced”.

Timestamps in UTC or it didn't happen.
Accepted solution♥ 2

Power save was on. Added the conf file, restarted NetworkManager, and it’s been online for 3 days straight now, no keepalive_timeout in the Log tab since. SSH is instant too, which I hadn’t even realised was related. Thank you Ciaran!

Timestamps in UTC or it didn't happen.
♥ 0

Got it running yesterday, everyone in the lab loves it. Had to ask IT nothing, which was a win. Only thing: I first used status=active and it kept repeating acknowledged alarms after a restart because my seen-set was empty, switched to OPEN like you wrote. Also had to change device names from “frz-03” to “freezer three” because piper read it as “frz”.

Timestamps in UTC or it didn't happen.
♥ 1

I fought the Edison breakout for a lab last year. Opening /dev/ttyMFD1 isn’t enough on that board: pins 0 and 1 go through a pin multiplexer and the level shifters, and until those are set up the UART isn’t connected to the header at all, the pins are plain GPIO. That’s why it opens fine and reads nothing.

The easy way is the mraa library, which sets the mux for you when you open the UART by its board number:

import mraa
u = mraa.Uart(0)            # pins 0/1 on the Arduino breakout, sets the mux
u.setBaudRate(115200)
u.setMode(8, mraa.UART_PARITY_NONE, 1)
while True:
    if u.dataAvailable(1000):
        line = u.readStr(64).strip()     # "caps_ok=1823;caps_rej=12"
        vals = dict(kv.split("=") for kv in line.split(";"))
        # add to the payload the Edison already sends:
        payload["caps_ok"] = int(vals["caps_ok"])
        payload["caps_rej"] = int(vals["caps_rej"])

Also check the wiring is crossed: OpenMV TX to the Edison’s RX (pin 0), OpenMV RX to the Edison’s TX (pin 1). Pin 0 is RX on the breakout, so if what you wrote is exactly how it’s wired, swap them.

Timestamps in UTC or it didn't happen.
Accepted solution♥ 9
Viewing 15 posts – 61 through 75 (of 79 total)