Il SMEL-BPI-6204-485-BRIDGE รจ un gateway industriale basato sulla piattaforma BananaPi BPI-6202/6204, progettato da SM Electronics per acquisizione dati, bridge Modbus RTU/TCP e accesso remoto a dispositivi seriali.
Basato sul SoC Rockchip RK3568 (quad-core ARM Cortex-A55 @ 2.0 GHz, GPU Mali-G52, NPU 0.8 TOPS), con 4 porte RS485, 1 RS232, doppia Ethernet Gigabit, VPN IKEv2, e pannello web integrato. Fanless, guida DIN, DC 12-48V, -20ยฐC ~ +70ยฐC.
| Processore | |
|---|---|
| SoC | Rockchip RK3568, Quad-core Cortex-A55 @ 2.0 GHz |
| GPU | Mali-G52 |
| RAM | 2 GB DDR4 |
| Storage | 16 GB eMMC + MicroSD |
| Connettivitร | |
|---|---|
| Ethernet | 2ร Gigabit (eth0: WAN, eth1: LAN) |
| RS485 | 4ร half-duplex, isolate, morsettiera |
| RS232 | 1ร full-duplex (TX/RX/GND) |
| USB | 1ร USB 3.0 + 1ร USB 2.0 |
| Alimentazione e ambiente | |
|---|---|
| Tensione | DC 12โ48V |
| Consumo | โค 10W |
| Temperatura | -20ยฐC ~ +70ยฐC |
| Montaggio | Guida DIN 35mm / parete |








| Etichetta | Tipo | Device | Pinout |
|---|---|---|---|
| RS485-1 | RS485 | /dev/ttyS2 | A+ / Bโ / GND |
| RS485-2 | RS485 | /dev/ttyS1 | A+ / Bโ / GND |
| RS485-3 | RS485 | /dev/ttyS3 | A+ / Bโ / GND |
| RS485-4 | RS485 | /dev/ttyS4 | A+ / Bโ / GND |
| RS232 | RS232 | /dev/ttyS0 | TX / RX / GND |
In modalitร bridge il gateway collega un datalogger/master RTU ai dispositivi slave RTU, permettendo accesso TCP simultaneo da SCADA/HMI.
TX del gateway โ RX del dispositivo e viceversa. GND sempre collegato. Distanza max 15m.
Collegare DC 12-48V ai morsetti V+/Vโ. Protezione inversione polaritร inclusa.
Il software si installa in un solo passaggio dal repository del sistema di monitoraggio (cartelle gateway/, gateway_setup/, gateway_api/): copiare gateway/gateway.conf.example in gateway.conf, compilarlo (hostname, password del pannello, VPN, indirizzo del server di monitoraggio, modalitร delle porte, CCI) ed eseguire sudo gateway/install.sh -c gateway.conf. Lo script installa pacchetti, mbusd, servizi, pannello, Telegraf, API contatori, VPN e salva lo snapshot di fabbrica. A fine installazione mostra seriale e codice di abbinamento del gateway (vedi sez. 10). Si puรฒ rilanciare; la modalitร di rete non viene cambiata.
http://<IP-DISPOSITIVO>

| Campo | Default |
|---|---|
| Username | admin |
| Password | admin (o quella di gateway.conf) |
Hostname, machine-id, device-id e chiavi SSH del dispositivo. Dopo aver installato la stessa immagine su piรน dispositivi, per ciascuno: impostare un hostname univoco, rigenerare machine-id, device-id e chiavi SSH, poi riavviare.


| Modalitร | Funzionamento |
|---|---|
| Bridge | eth0 ed eth1 unite nel bridge br0 (L2): il gateway รจ un nodo della rete d'impianto, IP in DHCP o statico. |
| Router (default di fabbrica) | eth1 = WAN (DHCP o statico), eth0 = LAN 192.168.10.1/24 con NAT e server DHCP (dnsmasq) per i dispositivi d'impianto. |
Le porte formano due coppie: RS485-1 โ RS485-3 e RS485-2 โ RS485-4. Le porte 3 e 4 sono il lato inverter, dove si collega anche il CCI (Controllore Centrale d'Impianto, delibera ARERA 385/2025) tramite Modbus TCP: porta 503 per la coppia 1/3, 504 per la coppia 2/4. Il CCI ha sempre la prioritร sul bus. Su ogni coppia si indica se il CCI รจ collegato (di solito una sola coppia).
| Modalitร | Servizio | Descrizione |
|---|---|---|
| Bridge | socat + proxy CCI | Datalogger esterno sulla porta 1/2 collegato direttamente agli inverter della porta 3/4. Quando il CCI si collega il bridge si ferma e il bus passa al CCI; riparte dopo il tempo di rilascio. |
| Slave | mbusd | Server Modbus TCP sulla seriale |
| Raw TCP | socat | Passthrough trasparente TCP โ seriale |
| Contatore | API contatori | Porta libera per la lettura DLMS/IEC dei contatori fiscali da parte del server (vedi sez. 10) |
| Off | โ | Nessun servizio: la porta puรฒ essere letta direttamente da Telegraf |

| Modalitร | Servizio | Descrizione |
|---|---|---|
| Monitoraggio | proxy CCI | Gli inverter vengono letti dal nostro sistema di monitoraggio (Telegraf) tramite la porta locale 127.0.0.1:1503 (o 1504), a bassa prioritร . Se il CCI รจ collegato o ha inviato richieste da meno del tempo di rilascio, Telegraf riceve "occupato" (eccezione Modbus 06) e salta la lettura: il CCI non aspetta mai il monitoraggio. |
| Slave / Raw TCP / Off | mbusd / socat / โ | Come per le porte 1 e 2 |
Con la porta 1 (o 2) in Bridge, la porta 3 (o 4) รจ gestita dal bridge e non si puรฒ cambiare: datalogger esterno e monitoraggio non condividono mai la stessa coppia.

Baudrate e modo (es. 8N1, 8E1) devono coincidere con quelli dei dispositivi sulla linea. Salvando i parametri il servizio attivo viene riavviato.
| Porta | mbusd | socat | CCI | Monitoraggio (locale) |
|---|---|---|---|---|
| RS485-1 (ttyS2) | 5021 | 5001 | 503 (bridge) | โ |
| RS485-2 (ttyS1) | 5022 | 5002 | 504 (bridge) | โ |
| RS485-3 (ttyS3) | 5023 | 5003 | 503 | 127.0.0.1:1503 |
| RS485-4 (ttyS4) | 5024 | 5004 | 504 | 127.0.0.1:1504 |

La porta RS232 (/dev/ttyS0) funziona in raw TCP tramite socat (default 9600 8N1, porta TCP 5005; la 5000 รจ dell'API contatori). Per collegarvi un contatore fermare il servizio con โ Ferma: la porta resta libera per l'API contatori.
Il tab Monitoraggio collega il gateway al server di monitoraggio.
Il gateway si registra da solo sul server indicato in Indirizzo del server (via VPN) e mostra seriale e codice di abbinamento (8 caratteri, valido 24 ore, rigenerabile). Nella scheda impianto del server, sezione Abbinamento gateway, scegliere il seriale tra i gateway in attesa e inserire il codice. Entro 5 minuti (o subito con Sincronizza ora) il gateway riceve credenziali MQTT, token API contatori e configurazione di Telegraf, cifrati con una chiave che esiste solo su questo dispositivo, e li riceve di nuovo a ogni modifica fatta sul server. Con il gateway abbinato il bundle e il token manuale sono disattivati.

Dopo l'abbinamento la scheda mostra l'impianto, l'ultimo contatto e l'ultimo aggiornamento della configurazione; il codice non serve piรน.

.tar.gz) e caricarlo qui. Vengono installati telegraf.conf, il certificato del broker, le credenziali MQTT ed eventualmente meter-api.env; Telegraf viene riavviato.127.0.0.1:1503/1504 per le porte in Monitoraggio, porta seriale /dev/ttySx per contatori e porte libere.Dalla stessa scheda si avviano, fermano e riavviano Telegraf e l'API contatori e si vedono le ultime righe del log di Telegraf.

Connessione IPsec (strongSwan) verso il server VPN, per l'accesso remoto e l'invio dei dati.

| Campo | Significato |
|---|---|
| Left ID | Identitร di questo dispositivo, come configurata sul server VPN |
| Right ID | Identitร del server VPN |
| Indirizzo server | Hostname o IP del server VPN |
| Username / Password EAP | Credenziali assegnate dall'amministratore della VPN (password vuota = invariata) |
Caricare il certificato CA (.pem) fornito dall'amministratore e, dopo ogni modifica, cliccare โณ Riavvia. Il servizio vpncheck controlla ogni 5 minuti che il server VPN risponda e, se non risponde, riavvia strongSwan.

Un solo account, admin. La password (minimo 8 caratteri) รจ salvata con PBKDF2. La sessione dura 8 ore e sopravvive al riavvio del pannello; Esci e il cambio password chiudono tutte le sessioni aperte.
Password dimenticata: via SSH sudo python3 /opt/bpi-config/app.py set-password <nuova>, oppure sudo rm /opt/bpi-config/credentials.json && sudo systemctl restart bpi-config per tornare ad admin/admin.

.zip con update.sh; lo script viene eseguito e il log รจ consultabile.admin/admin) e riavvia. Si attiva anche tenendo premuto il tasto su GPIO1 per 10 secondi.| Problema | Soluzione |
|---|---|
| Pannello non accessibile | Attendere 60s, verificare rete, provare entrambe le ETH (router: 192.168.10.1 su eth0) |
| Password dimenticata | Reset via SSH (sez. 12) |
| VPN sempre inattiva | Caricare CA cert, verificare credenziali, riavviare |
| Nessuna comunicazione Modbus | Verificare baudrate, modo, cablaggio A+/Bโ |
| Buchi nei dati di monitoraggio | Normali durante le sessioni del CCI (prioritร al CCI). Log: journalctl -u socat-modbus-proxy@ttyS3 |
| Telegraf non invia dati | Tab Monitoraggio: bundle installato, servizio attivo, log |
| Il server non legge il contatore | Porta in modalitร Contatore, token uguale a quello del server, API attiva |
The SMEL-BPI-6204-485-BRIDGE is an industrial gateway by SM Electronics. Rockchip RK3568 SoC, 4 RS485, 1 RS232, dual GbE, IKEv2 VPN, web panel. Fanless, DIN rail, DC 12-48V, -20ยฐC to +70ยฐC.
| Processor | |
|---|---|
| SoC | Rockchip RK3568, Quad-core Cortex-A55 @ 2.0 GHz |
| RAM | 2 GB DDR4 |
| Storage | 16 GB eMMC + MicroSD |
| Connectivity | |
|---|---|
| Ethernet | 2ร Gigabit |
| RS485 | 4ร half-duplex, isolated |
| RS232 | 1ร full-duplex |
| USB | 1ร USB 3.0 + 1ร USB 2.0 |
| Power | |
|---|---|
| Voltage | DC 12โ48V |
| Temperature | -20ยฐC to +70ยฐC |
| Mounting | DIN rail / wall |





| Label | Type | Device | Pinout |
|---|---|---|---|
| RS485-1 | RS485 | /dev/ttyS2 | A+ / Bโ / GND |
| RS485-2 | RS485 | /dev/ttyS1 | A+ / Bโ / GND |
| RS485-3 | RS485 | /dev/ttyS3 | A+ / Bโ / GND |
| RS485-4 | RS485 | /dev/ttyS4 | A+ / Bโ / GND |
| RS232 | RS232 | /dev/ttyS0 | TX / RX / GND |
Connect 12-48V DC and wait 60s. Software: fill gateway/gateway.conf.example as gateway.conf and run sudo gateway/install.sh -c gateway.conf (packages, mbusd, services, panel, Telegraf, meter API, VPN, factory snapshot). Re-runnable; the network mode is not changed.
http://<DEVICE-IP> โ Default: admin/admin. Change password on first login. 5 failed attempts lock login for 5 minutes.
View/change hostname, machine-id, device-id, SSH keys. Regenerate after cloning.
Bridge (eth0+eth1 in br0, DHCP or static) or Router (eth1 WAN, eth0 LAN 192.168.10.1/24 with NAT and DHCP server โ factory default).
Pairs: RS485-1 โ RS485-3 and RS485-2 โ RS485-4. Ports 3/4 are the inverter side, where the plant controller (CCI, ARERA 385/2025) connects via Modbus TCP on 503 (pair 1/3) or 504 (pair 2/4). The CCI always has priority; enable it on the pair(s) it uses.
| Mode | Ports | Description |
|---|---|---|
| Bridge | 1/2 | External datalogger on port 1/2 bridged to inverters on 3/4; the CCI pre-empts the bridge |
| Monitor | 3/4 | Our Telegraf reads via 127.0.0.1:1503/1504 at low priority; "busy" (exception 06) while the CCI is active |
| Meter | 1/2 | Port reserved to the DLMS/IEC meter API |
| Slave / Raw TCP / Off | all | mbusd (502x) / socat (500x) / disabled |
/dev/ttyS0, raw TCP via socat. Default: 9600, 8N1, port 5005. Stop it to use the port for a meter.
Automatic pairing (recommended): the gateway registers itself on the server (set Server address, reachable through the VPN) and shows its serial and an 8-character pairing code (valid 24 h). In the plant page on the server (section Abbinamento gateway) pick the serial and enter the code: MQTT credentials, meter API token and Telegraf configuration then arrive automatically, encrypted for this device only, and are updated after every change on the server.
Without pairing: upload the gateway bundle (.tar.gz) from the server admin and paste the meter API token generated here into the plant page on the server. The tab also shows per-port hints and the Telegraf log.

| Field | Meaning |
|---|---|
| Left ID | Device identity |
| Right ID | VPN server identity |
| Server address | VPN hostname/IP |
| EAP credentials | Username + password |
Upload CA cert (.pem), then restart. vpncheck restarts strongSwan if the server stops answering.
Change password (min 8 chars, stored with PBKDF2). Logout and password change close all sessions. Reset: sudo python3 /opt/bpi-config/app.py set-password <new>
Update (.zip with update.sh), reboot, factory reset (also GPIO1 held 10s).
| Issue | Solution |
|---|---|
| Can't access panel | Wait 60s, check network, try both ETH |
| VPN inactive | Check CA cert, credentials, restart |
| No Modbus data | Check baudrate, mode, A+/Bโ |
| Monitoring gaps | Expected during CCI sessions |