Technimal

EDGE 4IO — Modbus I/O Module

4-input / 4-output digital module · Modbus TCP & RTU · mDNS discovery
Model: E04XXXX REV.A FW 1.0.3 24 Vdc Ethernet + RS-485 24-pin terminal

Datasheet & User Manual · MODEL E04XXXX REV.A · Document rev 1.1 · 2026-06-18

1. Overview

The EDGE 4IO Modbus I/O Module is an industrial I/O device with 4 digital inputs and 4 digital outputs. It is exposed simultaneously over Modbus TCP (Ethernet) and Modbus RTU (RS-485), sharing one register map, and is discoverable on the LAN via mDNS / Zeroconf. A supervisory platform browses mDNS, reads capability metadata from TXT records, then polls/controls the device — no static IP or manual register-map documentation required for integration.

The EDGE 4IO is the all-digital sibling of the EDGE 2IO module (2 analog/digital in, 1 analog out).

2. Key Features

I/O

  • digital inputs (debounced)
  • digital outputs (on/off)
  • Single-colour status LED

Connectivity

  • Modbus TCP over Ethernet, port 502
  • Modbus RTU over RS-485 (concurrent)
  • mDNS service advertisement
  • DHCP client (static IP optional)

Configuration

  • All params via Modbus registers
  • NVS persistence (survives reboot)
  • SoftAP web portal for provisioning

Safety

  • Per-output fail-safe state (bitmask) on link/master loss
  • All outputs OFF at boot until first write

3. Specifications

ParameterValue
Power supply24 Vdc
Firmwaree04_modbus v1.0.3
Inputs4 × digital, 24 / 0 Vdc type, debounced (3 consistent reads @ 10 ms)
Outputs4 × digital, 24 Vdc / 0 Vdc (on/off)
Ethernet10 Mbps, full-duplex (RJ45)
SerialRS-485 half-duplex (terminals A / B)
ProtocolsModbus TCP (port 502) + Modbus RTU, concurrent; mDNS
AddressingDHCP client; static IP fallback configurable

4. Pin Layout (MODEL E04XXXX REV.A)

24-pin terminal block. Ethernet is on the separate RJ45 jack.

NoSymbolTypeDescription
1VssPowerPower supply ( 24 Vdc )
2GNDGND ( 0 Vdc )
3VssPower supply ( 24 Vdc )
4GNDGND ( 0 Vdc )
5O1+Digital OutputPositive signal output ( 24Vdc/0Vdc )
6O1-Negative signal output ( 24Vdc/0Vdc )
7O2+Positive signal output ( 24Vdc/0Vdc )
8O2-Negative signal output ( 24Vdc/0Vdc )
9O3+Positive signal output ( 24Vdc/0Vdc )
10O3-Negative signal output ( 24Vdc/0Vdc )
11O4+Positive signal output ( 24Vdc/0Vdc )
12O4-Negative signal output ( 24Vdc/0Vdc )
13J1DebugFor setting ( connect J1 and J2 for setup mode )
14J2For setting ( connect J1 and J2 for setup mode )
15AModbusD+ ( modbus rtu signal )
16BD- ( modbus rtu signal )
17DI1+Digital InputPositive signal digital input ( 24/0 Vdc type )
18DI1-Negative signal digital input ( 24/0 Vdc type )
19DI2+Positive signal digital input ( 24/0 Vdc type )
20DI2-Negative signal digital input ( 24/0 Vdc type )
21DI3+Positive signal digital input ( 24/0 Vdc type )
22DI3-Negative signal digital input ( 24/0 Vdc type )
23DI4+Positive signal digital input ( 24/0 Vdc type )
24DI4-Negative signal digital input ( 24/0 Vdc type )

Connect J1–J2 at power-on to enter setup/provisioning mode.

5. I/O Channels

5.1 Inputs

All 4 inputs are digital. Each is debounced (3 consistent reads at a 10 ms poll interval) and reported over Modbus as 0 / 1 in its input register.

Invert: any input can be inverted (report 0↔1) via the config portal — set the Invert inputs bitmask (bits 0–3 = inputs 1–4). Use it when the field wiring/sensor is active-low. Default off.

5.2 Outputs

Each of the 4 outputs is driven from its output register: any non-zero value sets the output ON (24 Vdc), zero sets it OFF (0 Vdc). Writes take effect immediately. At boot and during fail-safe the outputs are forced to a defined state.

6. Network & Discovery

TXT records (capability advertisement):

KeyExampleMeaning
modele04_modbusDevice model
fw1.0.0Firmware version
i4Input channels
o4Output channels
unit1Modbus unit/slave ID
protomodbus-tcpProtocol identifier
macB4E62DDE225DWiFi MAC (no colons)

7. Modbus Interface

ParameterTCPRTU (RS-485)
RoleSlave / Server (always)Selectable: Off / Slave / Master
TransportEthernet (RJ45) or WiFi, port 502RS-485 (terminals A / B)
AddressUnit ID (MBAP)Slave address = Unit ID register
Default line9600 baud, 8N1 (configurable)
Function codes03 (read holding), 06 (write single holding); as a master it also issues 04 (read input)
Byte orderBig-endian (standard Modbus)

RS-485 mode, baud / parity / stop-bits and the unit/slave id take effect after a reboot (the Modbus controllers are created once at startup).

7.1 RS-485 modes

There is a single RS-485 port, so it is either a slave or a master — never both. Modbus TCP keeps serving as a slave in all three modes.

ModeValueBehaviour
Off0RS-485 idle; TCP only.
Slave1Default. A remote master reads/writes this device over RS-485, sharing the same registers as TCP.
Master2This device polls remote slaves and republishes what it reads into its own registers, so a TCP client reads local I/O and remote values from one table. See §8.1.

8. Register Map (Holding Registers)

Read with FC 03, write with FC 06. Layout: configuration block first, then live I/O.

AddrRegisterAccessPersistNotes
0Unit ID / RTU addressR/WNVS1–247; effective after reboot
1Fail-safe output bitmaskR/WNVSbits 0–3 → outputs 1–4
2Fail-safe timeout (s)R/WNVS0 = disabled
3RS-485 modeR/WNVS0=off, 1=slave, 2=master; effective after reboot
4RTU baud / 100R/WNVS96=9600 … 1152=115200
5RTU parityR/WNVS0=none, 1=odd, 2=even
6RTU stop bitsR/WNVS1 or 2
7Input 1 valueR0 / 1 (debounced)
8Input 2 valueR0 / 1
9Input 3 valueR0 / 1
10Input 4 valueR0 / 1
11Output 1R/W0 = OFF, non-zero = ON
12Output 2R/W0 / 1
13Output 3R/W0 / 1
14Output 4R/W0 / 1
15Status flagsRbitfield (below)
16Master poll statusRbit i = poll entry i failed (master mode only)
17–48Master poll resultsRremote registers, packed in entry order (master mode only)

Registers 16–48 exist on every build but read 0 unless RS-485 is in master mode. Addresses 0–15 are unchanged from earlier firmware.

Status flag bits (register 15)

BitMaskMeaning
00x01Ethernet link / IP up
10x02Modbus master polled recently (any transport)
40x10Outputs forced to fail-safe
50x20RS-485 running as a slave
60x40RS-485 running as a master (polling)

8.1 RS-485 master mode — polling plan

In master mode the device polls up to 8 entries, each a block read from one remote slave, repeating the whole sweep every sweep interval (default 1000 ms, min 100 ms). Entries are configured in the web portal (§11.2) as slave,fc,start,count.

FieldRangeMeaning
slave1–247remote device address on the RS-485 bus
fc3 or 43 = read holding registers, 4 = read input registers
start0–65535first register address on the remote device
count1–16how many consecutive registers to read

Results are packed in entry order starting at register 17, up to 32 registers in total. Example:

EntryConfigured asLands in
P05,3,100,4registers 17–20 (slave 5, holding 100–103)
P17,4,0,2registers 21–22 (slave 7, input 0–1)
If a remote device stops answering, its result registers keep their last good values and the entry's bit is set in register 16. Always check register 16 before trusting a value — a held reading is indistinguishable from a live one otherwise.

Unused or invalid entries are skipped and take no result registers; they are reported on the serial console at boot. A total exceeding 32 registers drops the overflowing entries.

Bits 2–3 (wire-break) are defined in the shared register layout but are only meaningful on the E02 (4–20 mA) variant; they read 0 on the E04.

9. Status LED

StateLEDMeaning
ProvisioningFast blinkConfig mode (SoftAP portal active)
InitializingSlow blinkBooting, network not ready
RunningSolid ONNormal operation (Modbus serving)

10. Fail-safe & Boot

Boot sequence: init I/O + safe outputs (LED slow-blink) → bring up Ethernet, acquire DHCP → start mDNS + Modbus TCP/RTU slaves (LED solid) → enter input-poll loop.

11. Configuration (Manual)

11.1 Via Modbus

Write configuration registers (0–6) with FC 06. Config values persist to NVS. Transport/serial params (unit id, RTU baud/parity/stop/enable) apply on the next reboot; fail-safe bitmask/timeout and the outputs apply live.

11.2 Config mode — SoftAP web portal

Every firmware (Converter and Timestamp) uses the same way to enter config mode; only the settings shown on the page differ by firmware.

You can also configure a running device over the network. The same page is served on the device's normal LAN address (http://<device-ip>/) during operation — no jumper needed. It asks for a password (any user name; default edge12345, change it under Security on that page), because it shows the stored WiFi and MQTT passwords. Use the SoftAP route below when the device has no usable network yet.

Enter config mode (identical for all firmwares):

  1. Short J1–J2 (terminals 13–14) at power-on / reset — the LED blinks fast.
  2. Join WiFi AP E04-xxxxxx (password edge12345).
  3. Open http://192.168.4.1/.
  4. Save & Reboot → settings persist to NVS and the device reboots into normal operation.

Common to all firmwares — network:

FieldPurpose
WiFi SSID / PasswordWiFi STA join (blank SSID = WiFi off)
WiFi static IP + IP / Gateway / Subnet / DNS1 / DNS2fixed IP on WiFi (unchecked = DHCP)
Ethernet static IP + IP / Gateway / Subnet / DNS1 / DNS2fixed IP on Ethernet (unchecked = DHCP)

Converter firmware — Modbus settings (shown only on the Converter build):

FieldPurpose
Unit ID / RTU addressModbus slave id
Fail-safe outputs bitmask (0–15)outputs applied on Modbus loss / boot (bit 0 = output 1 … bit 3 = output 4)
Fail-safe timeout s0 = disabled
Invert inputs (bitmask)bit 0 = input 1 … bit 3 = input 4 (report 0↔1)
RS-485 Modbus RTU modeOff / Slave / Master (applies on reboot) — see §7.1
Baud / Parity / Stop bitsRS-485 line settings, both modes (applies on reboot)
Sweep interval msMaster mode: how often the whole polling plan repeats (min 100)
P0 … P7Master mode: polling plan, one entry per box as slave,fc,start,count; blank = unused. See §8.1

The 4 inputs are always digital on the E04SD — there is no input-mode field.

Timestamp firmware — MQTT / event settings (shown only on the Timestamp build): broker host/port, client id, username, password, device code, NTP server and Input edge. See §14 · Provisioning for the full list.

Security: Modbus is unauthenticated (per the standard). Deploy only on trusted networks. Change the default SoftAP password per site policy.

12. Firmware Update

Update the firmware over USB from a Chrome / Edge browser — no tools to install. Open the web flasher, pick the model and version, connect, and flash:

flasher.technimal.co.th

Stored configuration (unit id, RS-485, fail-safe, etc.) is preserved across an update unless you choose Erase device.

13. Troubleshooting

SymptomCheck
No IP / not discoverableEthernet cable & RJ45 link; DHCP server present; LED stuck slow-blink = no IP yet
TCP master can't connectConfirm the device IP, port 502 open, only the needed master polling
RTU no responseRS-485 mode = 1 (slave) in reg 3; matching baud/parity/stop & slave address; A/B terminals (15/16) & ground
Master poll fails (bit set in reg 16)RS-485 mode = 2; remote slave address / FC / register range correct; matching line settings; A/B wiring & termination
Input always 0 or 1Verify field wiring & 24/0 Vdc signal level on the DI± terminals
Output doesn't switchWrite to registers 11–14; check fail-safe isn't active (status bit 4)
Can't enter config modeShort J1–J2 (terminals 13–14) at power-on; LED should switch to fast blink

14. Timestamp Firmware (variant)

An alternative firmware for the same board that timestamps input edges (proximity / counting sensors) and streams each event to the new_owl IIoT platform over MQTT — instead of the Modbus register interface. Select Timestamp Firmware in the web flasher. Same pinout & terminals.

ItemBehaviour
InputsAll 4 digital inputs are edge event inputs with a selectable capture edge (rising / falling / both, set in the config portal). No input-mode selection — single fixed function. (Outputs are unused in this firmware.)
Per eventPublishes {"tags":{"inK":1},"ts":<epoch_ms>} to device/<device_code>/telemetry (K = input 1–4).
TimestampEach edge is stamped locally from an SNTP-synced clock (epoch ms). The server honours the device timestamp, so buffered / back-dated events keep their real event time.
Store-and-forwardRAM ring buffer (2048 events) retries on network / broker outage or backpressure; QoS 1 with delivery ack (an event leaves the buffer only after the broker confirms).
BrokerMQTT (EMQX), plain TCP port 1883.

Throughput & buffering

Two independent ceilings apply — how fast edges can be captured, and how fast events can be delivered to the server. Event timestamps are stamped in the interrupt at microsecond resolution, so timing stays accurate even when delivery lags.

LimitValueSet by
Capture rate (per input)set by the configurable debounce (default 1 ms → up to 1 kHz): edges closer together than the debounce on the same input are discarded. Max rate per input ≈ 1000 / debounce_ms. Inputs are debounced independently, so the aggregate is 4× that across the 4 inputs.debounce setting (config portal)
Timestamp resolutionmicrosecond (captured in the ISR) — buffered / back-dated events keep their true event timehardware timer
Sustained delivery (to server)one QoS 1 publish at a time (waits for the broker PUBACK before the next), so the continuous rate ≈ 1 / broker round-trip: ~200–1000 ev/s on the same LAN, ~65–200 ev/s over WiFi to a LAN broker, ~10–30 ev/s across the internetQoS 1 ack round-trip (network)
Burst headroom2048 events — short bursts above the sustained rate are buffered in RAM and drained later. If the average input rate stays above the sustained delivery rate, the buffer fills and the oldest events are dropped.RAM ring buffer size

Typical proximity / counting use (< 50 Hz) sits well within every limit. For higher sustained rates: shorten the debounce (cleaner signals only), or batch several events per MQTT message (requires a matching change on new_owl).

Provisioning

Create the device on the new_owl server, then copy its MQTT fields into the config portal (short J1–J2 at boot → http://192.168.4.1/):

Portal fieldFrom the new_owl device
Broker host / portyour EMQX broker (platform host : 1883)
Client IDmqtt_client_id
Usernamemqtt_username
Passwordmqtt_password
Device codedevice_code → topic device/<code>/telemetry
NTP servera reachable NTP host (default pool.ntp.org) — needed for event epoch time
Input edgecapture edge: 0=rising, 1=falling, 2=both (default 0)
Debounce msblanking time after an accepted edge, per input (default 1, 0=off, max 10000) — see below

Tuning the debounce

A noisy or bouncing sensor can register several edges for one real pulse, inflating counts. Raising the Debounce ms value ignores further edges on that input for the given time.

Do not set it higher than needed. The debounce is also a hard rate limit: real pulses arriving closer together than the debounce are silently discarded. Keep it below the shortest genuine gap between pulses — max rate ≈ 1000 / debounce_ms (e.g. 50 ms caps that input at ~20 Hz).

The device log (viewable in the web flasher) prints a status line every 5 seconds:

status: link=1(eth=1,wifi=0) mqtt=1 time=1 | in=[0101] buf=0 captured=12 sent=12 dropped=0 bounced=37
SymptomMeaningAction
bounced rising, counts now correctdebounce is filtering the noisekeep the current value
bounced ~0 but counts still too highthe extra counts are not bounce (wiring / EMI / wrong edge)check wiring and Input edge, not the debounce
real pulses missingdebounce exceeds the pulse intervallower it
Inputs use no internal pull — the board's input circuit drives the level (idle high, pulled low when 24 Vdc is applied across DI+/DI−). Pick the Input edge to match your sensor: capture on the assertion (24 V applied → falling) with 1, or on release (rising) with 0; both give the same pulse count. WiFi & static IP are configured as usual; the device also connects over Ethernet. Events captured before the clock syncs or while offline are buffered and sent with their correct timestamp once connected.

15. Edge-MQTT Firmware (variant)

A third firmware for the same board. It samples the I/O on a fixed interval and publishes the readings as named tags to the new_owl platform over MQTT — what the legacy Edge firmware did over CoAP, but with every setting entered in the web portal instead of being pushed by the server. Select Edge-MQTT Firmware in the web flasher. Same pinout & terminals.

ItemBehaviour
Sourcesthe 4 local inputs, plus any registers read from remote slaves in RS-485 master mode. Only channels you give a tag name to are published.
Per publish{"tags":{"<your_tag>":<value>,...},"ts":<epoch_ms>} to device/<device_code>/telemetry — the same shape the Timestamp firmware uses, so new_owl auto-creates the tags from the names you choose.
IntervalPublish interval s in the portal (default 60 s, range 1–3600).
Store-and-forwardRAM ring of 48 payloads; samples taken while the broker is unreachable are sent later with their original timestamp. QoS 1 — a payload leaves the buffer only once the broker confirms it. Oldest is dropped if the buffer fills.
Not includedno Modbus slave interface (nothing reads this device), and no commands from the server — it only publishes.

Naming the tags

Portal fieldMeaning
Input 1–4 tagtag name for that local input. Blank = not published.
Poll entry P0..P7one remote read per box, written as tag,slave,fc,start,count,dtype,order. fc: 3=holding, 4=input. dtype: 0=u16, 1=s16, 2=u32, 3=s32, 4=float32. order: 0=high word first (Modbus default), 1=low word first. count is how many registers make up the value (1 for 16-bit, 2 for 32-bit). Each entry becomes one tag; a blank tag is not published.
An entry whose last sweep failed is skipped rather than published with a stale value, so a dead slave leaves a gap in the series instead of a flat line. MQTT, NTP, WiFi and static IP are configured exactly as for the Timestamp firmware (§14).