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 – 1 through 15 (of 79 total)

Had the exact same thing in a lab last term with a fridge logger. Modbus registers are just 16 bits, they don’t know about signs. Your Arduino stores -125 as two’s complement, which is 0xFF83, and as an unsigned number that’s 65411. The Pi then reads it as unsigned.

So convert it back on the Pi:

raw = rr.registers[0]
if raw > 32767:          # top bit set means negative in int16
    raw -= 65536
temp = raw / 10           # -12.5

Or let pymodbus do it, the client has a helper for this (in 3.x):

temp = client.convert_from_registers(rr.registers, data_type=client.DATATYPE.INT16) / 10

On the Arduino side, cast before the register so rounding is explicit: holdingRegisters[0] = (uint16_t)(int16_t)lround(temp * 10);. With int16 x10 you have -3276.8 to 3276.7 C, plenty for a freezer.

If a gateway polls it instead of your script, set that register’s type to signed 16-bit in the gateway config and it does the same conversion.

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

I did a module on this last term, and then spent a summer placing gateways at a dairy, so here goes.

Mesh works at home because the routers are mains powered and always listening. LoRaWAN end devices are battery sensors that sleep almost all the time and only open short receive windows after they send. A sleeping node can’t forward anyone else’s traffic, so the network is a star of stars instead: every gateway in range hears every uplink, and the network server throws away the duplicates. More gateways means more coverage, and on Hermetry a device message is stored once no matter how many gateways heard it.

James, the Pending status is real, it’s for relay gateways that were seen but not accepted yet. A relay is still one more box to place and power though, and for four sensors behind one warehouse a second gateway is simpler.

Your two heard devices are joining at SF12 with SNR around -15, which is at the edge. The join request gets through, but the join accept has to come back to the device 5 s later in RX1, or 6 s in RX2 at 869.525 MHz (DR0), and at that margin the downlink often doesn’t make it. The other two probably never reach the gateway at all.

Put a second gateway on the warehouse itself, ideally on the side facing those sensors. It can be another Basics Station gateway or a licensed router with a LoRa radio. Both register to the same network server and the sensors just use whichever hears them best.

Relays and the other ways to extend coverage: Local mode and relays

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

The sample source is perfect timing for me. My sensors for my final year project arrive in two weeks and I have to demo the board before that. Anything to watch out for if I leave sample cards on it?

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

Both of them are partly right. U.FL is Hirose’s name. IPEX makes a family called MHF, and the original MHF (sometimes MHF1 or MHF I) mates with U.FL, so those pigtails are interchangeable. MHF4 is a smaller connector (about the size of a W.FL) and does not mate with U.FL at all, which is what Aisha hit. Newer LTE modules use MHF4 a lot to save space, sometimes only on the main antenna.

So check the mechanical drawing of the modem, not the word “IPEX”. Height around 2.5 mm is MHF1/U.FL, around 1.2 mm is MHF4.

Two other things. These connectors are rated for only about 30 mating cycles, so don’t plug and unplug them for every test. And keep pigtails short: the thin 1.13 mm cable loses a fair bit at LTE frequencies, a 30 cm pigtail where 10 cm would do costs you signal.

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

Built it with load cells (two per bed, HX711, ESP32) and the Rules card. Test last night with my supervisor lying on a spare bed and getting up at 23:10: the alarm opened at 23:20 and the carer got it in the chat app.

One thing I got wrong first: I left my old alarm rule on the profile switched on, so the 3 p.m. lounge alarms kept coming. Deleted it, only the Rules card is left. And Rachel, the manager is getting written consent from the families before we put the other two in.

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

We did this in our control systems module last term and I’ve since drawn a few panels for a summer job, so here’s the IEC way as we were taught it.

Designation: IEC 81346 letter codes, terminal strips are X. First strip -X1, second -X2. A single terminal is the strip plus its number with a colon: -X1:3. Equipment gets its own code too: power supply -T1, fuses -F1, the gateway maybe -A1.

Symbol: IEC 60617 draws a terminal as a small circle (or a small square, many CAD libraries use that for terminal blocks) with the number next to it, on the wire where it passes through the strip. You don’t draw the whole strip as one box in the circuit diagram, each terminal appears where its wire is.

Then a separate terminal diagram (terminal plan) per strip: a table, one row per terminal, with internal destination on one side (e.g. -A1:A+) and external cable/core on the other (W12 core 1). Electricians wiring on site work almost only from that list.

A few habits that made my drawings get fewer questions:

  • Keep field power and signals on separate strips like you do, and say so in the strip’s title (X1 24 V field, X2 RS485 + 4-20 mA).
  • Draw jumpers between terminals explicitly.
  • For the RS485 terminals, mark A/B and the shield terminal clearly and note where the 120 Ω termination sits.
Timestamps in UTC or it didn't happen.
Accepted solution♥ 2
Viewing 15 posts – 1 through 15 (of 79 total)