❮  Choose a controller Platform: Raspberry Pi · Link: Internet

Raspberry Pi — opening over the internet

Fill in a few parameters and the server builds a finished Python script for your board. All that is left is to copy it onto the Raspberry Pi and run it as a service: there is nothing to flash.

What the program does: The Raspberry Pi stays connected to the server, over Wi-Fi or a cable, whichever suits you. You press Open in the app from any distance and the board closes the contacts of your gate, barrier or intercom for a moment, just like an ordinary button. It does not switch power. For bistable drives and locks there is a mode below with separate open and close and position tracking.

1. Platform

Choose a platform — the fields that follow depend on it.

2. Ready presets

Tap a preset and its parameters drop into the form below. You can adjust them by hand afterwards.

Off-the-shelf Wi-Fi relays (replace the program)

Build it yourself on an ESP32

ESP8266 controller boards

Off-the-shelf ESP8266 Wi-Fi relays (Sonoff and the like) will not drive a gate: they switch mains voltage and have no dry contacts. You need a plain board plus a separate relay module (see "What else you will need" below) — that is what gives you a free pair of contacts that acts like a button.

Raspberry Pi

On an ordinary Pi the relay hangs off the GPIO — the same relay module as for the ESP (see "What else you will need" below). Or take a relay HAT that sits straight on the Pi's header.

What else you will need

These pictures are not clickable — they just show what the components look like.

Relay module Relay module The same one for an ESP32, an ESP8266 or a Raspberry Pi — any board without an on-board relay. Three wires to the controller: control, power and ground (GND). The relay output goes to the drive
USB-to-UART adapter USB-to-UART adapter Needed when there is no USB of your own: ready Shelly units and bare ESP32/ESP8266 modules. Boards with USB (DevKit, Wemos) do not need it
Smart plugs and Wi-Fi switches will not do here. Athom Plug, Shelly Plus Plug S and their kin are smart plugs: they switch mains voltage to a load and have no separate dry contacts for a button. A drive needs a relay with a free pair of contacts — a Shelly Plus 1, or an ESP32/ESP8266 board with a relay module.

3. WiFi

The network name and password are written into the device's program. If you change your Wi-Fi later, you will have to rebuild and upload the program with the new details.

3. Network

A Raspberry Pi connects to the network through the operating system — Wi-Fi or Ethernet is configured with the standard raspi-config, NetworkManager or /etc/wpa_supplicant/wpa_supplicant.conf. The script itself needs no Wi-Fi credentials.

Setting one up for the first time? On a Pi Zero W it is easiest to put the SSID and password on the SD card's boot partition in the file wpa_supplicant.conf. On a Pi 4 or 5 it is simpler with raspi-config nonint do_wifi_country RU and raspi-config nonint do_wifi_ssid_passphrase MyHomeWiFi secret.

4. Device credentials

In the app add an object of type "Device" — once registered, the app shows the device code. Paste it into the field below: the firmware uses it to connect to the server.

Paste the code exactly as the app shows it — one wrong character and the controller will not connect.

5. Relay

6. LEDs (optional)

You can drive two indicators: the server connection status and relay activity. Leave them at -1 if you do not need them.

Save this configuration

Download the file Download the source

If you want to read the source, tweak it by hand, download .ino or share a link, press "Open in the editor". It is exactly the code the server compiled into .bin.

Bind to the app

In the app open the Device object → "Bind to the app", copy the code (it starts with ENTX-BIND:), paste it below and press "Write to the controller". After that the controller opens only on a command from your app — the secret travels to it over USB, bypassing the network and the server.

The controller must already be flashed and connected over USB. If the app has reissued the key, repeat the binding with the new code.


Installing on a Raspberry Pi

Once you have downloaded the configured entrixy.py:

  1. Put the file in /opt/entrixy/entrixy.py on the Pi (you can use scp).
  2. Install the dependencies: sudo pip install websockets RPi.GPIO (on a Pi 5 use gpiod).
  3. Download the systemd service: entrixy.service, put it in /etc/systemd/system/.
  4. Enable it at boot: sudo systemctl enable --now entrixy.
  5. Check it: sudo journalctl -u entrixy -f → you should see [entrixy] auth OK.

The script reconnects by itself when the link drops and comes back after the Pi reboots.

Connecting the relay to the drive

You use two contacts on the device's output: NO (normally open) and COM (common). These two wires go to the "Open button" terminals on your drive's control board.

DriveWhere to connect NO/COM
BFT (Phobos, Deimos, Ares)Terminals START or OPEN (usually numbered 21–22 in the diagram)
CAME (BX, ATI, BK)Terminals 2–7 (open), or PED for a pedestrian gate
NICE (Robus, Run, Spin)Terminals 1–3 (step-by-step)
FAAC (740, 844, 391)Terminals OPEN A (open fully)
DoorHan (Sliding, Arm)Terminals CMD + GND
Boom barrierThe Open push-button post — in parallel with its contacts
Intercom (Cyfral, Vizit, Eltis)The relay in parallel with the door release button on the handset, or straight onto the magnetic lock terminals

Check the exact labels in your control board's manual. If the board is already wired and working, find the two wires running from the Open push-button post and connect NO/COM in parallel with them.

Getting to the UART on off-the-shelf Wi-Fi relays

The ready Shelly Plus 1 unit has no external USB. You have to open the case and connect to the UART pins with a USB-to-serial adapter — CP2102, CH340 or FTDI, any of them.

General wiring

USB-to-serial adapterDevice
GNDGND
3.3V3V3
TXRX
RXTX
EN/RESET — briefly to GND to reboot into the bootloader
GPIO0 — to GND while powering up, to enter the bootloader
Do not apply mains voltage to the device's mains terminals while the USB adapter is connected. Power it either from the adapter's 3.3 V or leave the mains supply fully disconnected. Otherwise the USB and mains grounds may sit at different potentials, and your computer's USB port will be destroyed.

Pinout by model

DeviceWhere the UART isEntering the bootloader
Shelly Plus 1 / 1PM (ESP32)The pads inside the case next to the ESP32 moduleTie GPIO0 to GND and briefly pull EN to GND

Uploading with esptool (if the browser route failed)

  1. Download .bin above.
  2. Install esptool: pip install esptool
  3. Connect the device to USB or to a USB-to-serial adapter.
  4. Flash it:
    esptool.py --chip auto --port /dev/ttyUSB0 write_flash 0x0 entrixy-ws.bin
  5. On Windows the port is usually COM3 or COM4.
After pressing the button, wait a moment — the file is usually ready in under a minute. Once the program is built, a download button appears.