Guia de Instalação Installation Guide
De zero a nó funcional: flash do RNode, configuração do Raspberry Pi, Reticulum, Wi-Fi hotspot e MeshChat. From zero to a working node: RNode flash, Raspberry Pi setup, Reticulum, Wi-Fi hotspot and MeshChat.
Visão geral Overview
RNode (radio LoRa) RNode (LoRa radio)
Flash do firmware RNode no dispositivo LoRa para comunicação a longa distância (868 MHz). Flash RNode firmware on the LoRa device for long-range communication (868 MHz).
Raspberry Pi + Reticulum Raspberry Pi + Reticulum
Configuração do sistema operativo, Reticulum Network Stack e MeshChat. OS setup, Reticulum Network Stack and MeshChat configuration.
Wi-Fi Hotspot + Portal Wi-Fi Hotspot + Portal
Hotspot Wi-Fi aberto "ONDORA-EMERGÊNCIA" com captive portal para acesso automático ao MeshChat. Open Wi-Fi hotspot "ONDORA-EMERGÊNCIA" with captive portal for automatic MeshChat access.
Nota: Note: Para repeaters (Tipo 1), basta o Passo 1 — o RNode funciona sozinho como retransmissor. Os passos seguintes são para nós Tipo 2 e Tipo 3 com Raspberry Pi. For repeaters (Type 1), only Step 1 is needed — the RNode works standalone as a relay. The following steps are for Type 2 and Type 3 nodes with Raspberry Pi.
Flash do Firmware RNode Flash RNode Firmware
Instala o Reticulum Network Stack e usa o rnodeconf para flashar o firmware no dispositivo LoRa. Liga o dispositivo via USB ao computador.
Install the Reticulum Network Stack and use rnodeconf to flash the firmware on the LoRa device. Connect the device via USB to your computer.
# Instalar o Reticulum Network Stack
pip install rns
# Ligar dispositivo LoRa via USB e executar:
rnodeconf --autoinstall
# Seleccionar o modelo correcto quando perguntado.
# A frequência será configurada para 868 MHz (Europa).
Verificar que o flash foi bem sucedido: Verify the flash was successful:
rnodeconf -p /dev/ttyUSB0 --info
Repeaters (Tipo 1): Repeaters (Type 1): Durante o autoinstall, responder Yes a "Enable Transport on this device?". Isto ativa a retransmissão automática de pacotes. During autoinstall, answer Yes to "Enable Transport on this device?". This enables automatic packet relay.
Preparar o Raspberry Pi Prepare the Raspberry Pi
Instalar o sistema base, Reticulum, LXMF e MeshChat no Raspberry Pi. Começar com Raspberry Pi OS Lite. Install the base system, Reticulum, LXMF and MeshChat on the Raspberry Pi. Start with Raspberry Pi OS Lite.
# Atualizar o sistema
sudo apt update && sudo apt upgrade -y
# Instalar dependências
sudo apt install -y python3-pip git hostapd dnsmasq nodejs npm
# Instalar Reticulum e LXMF
pip install rns lxmf --break-system-packages
# Clonar e instalar MeshChat
cd /home/pi
git clone https://github.com/liamcottle/reticulum-meshchat.git
cd reticulum-meshchat && npm install
Configurar o Reticulum Configure Reticulum
Criar o ficheiro de configuração do Reticulum em ~/.reticulum/config. Esta configuração define a interface LoRa e o servidor TCP local.
Create the Reticulum config file at ~/.reticulum/config. This configuration defines the LoRa interface and local TCP server.
[reticulum]
enable_transport = True
share_instance = Yes
[interfaces]
[[RNode LoRa]]
type = RNodeInterface
interface_enabled = True
port = /dev/ttyUSB0
frequency = 869525000
bandwidth = 125000
spreadingfactor = 8
codingrate = 5
txpower = 14
[[TCP Server]]
type = TCPServerInterface
interface_enabled = True
listen_ip = 0.0.0.0
listen_port = 4242
| Parâmetro Parameter | Valor Value | Explicação Explanation |
|---|---|---|
frequency |
869525000 | 869.525 MHz — sub-banda P, 10% duty cycle (banda ISM europeia) 869.525 MHz — sub-band P, 10% duty cycle (European ISM band) |
spreadingfactor |
8 | SF8 = equilíbrio ideal alcance/velocidade (~3 kbps, 5-10 km) SF8 = ideal balance of range/speed (~3 kbps, 5-10 km) |
bandwidth |
125000 | 125 kHz — largura de banda padrão LoRa 125 kHz — standard LoRa bandwidth |
txpower |
14 | 14 dBm — potência de transmissão (máximo legal 25 mW) 14 dBm — transmit power (legal maximum 25 mW) |
listen_port |
4242 | Porto TCP para acesso local do MeshChat ao Reticulum TCP port for local MeshChat access to Reticulum |
Configurar Hotspot Wi-Fi Configure Wi-Fi Hotspot
Configurar o Raspberry Pi como hotspot Wi-Fi aberto "ONDORA-EMERGÊNCIA" com captive portal. Todos os pedidos DNS são redirecionados para 192.168.4.1 (MeshChat). Configure the Raspberry Pi as an open Wi-Fi hotspot "ONDORA-EMERGÊNCIA" with captive portal. All DNS requests are redirected to 192.168.4.1 (MeshChat).
hostapd.conf
interface=wlan0
driver=nl80211
ssid=ONDORA-EMERGÊNCIA
hw_mode=g
channel=7
wmm_enabled=0
auth_algs=1
wpa=0 # Rede aberta — sem password
dnsmasq.conf
interface=wlan0
dhcp-range=192.168.4.2,192.168.4.50,255.255.255.0,24h
address=/#/192.168.4.1 # Captive portal: todo o DNS redireciona para o no
dhcpcd.conf
interface wlan0
static ip_address=192.168.4.1/24
nohook wpa_supplicant
Captive portal:
Captive portal:
A configuração address=/#/192.168.4.1 no dnsmasq faz com que qualquer pedido DNS seja resolvido para o IP do nó. Quando um telemóvel se liga ao Wi-Fi, o sistema detecta o captive portal e abre automaticamente o MeshChat no browser.
The address=/#/192.168.4.1 setting in dnsmasq resolves all DNS requests to the node's IP. When a phone connects to the Wi-Fi, the system detects the captive portal and automatically opens MeshChat in the browser.
Serviços Systemd Systemd Services
Criar serviços systemd para que o Reticulum e o MeshChat iniciem automaticamente com o Raspberry Pi. Create systemd services so that Reticulum and MeshChat start automatically with the Raspberry Pi.
reticulum.service
[Unit]
Description=Reticulum Network Stack
After=network.target
[Service]
Type=simple
User=pi
ExecStart=/home/pi/.local/bin/rnsd -v
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
meshchat.service
[Unit]
Description=Reticulum MeshChat
After=reticulum.service
[Service]
Type=simple
User=pi
WorkingDirectory=/home/pi/reticulum-meshchat
ExecStart=/usr/bin/node meshchat.js --headless --port 80
Restart=always
[Install]
WantedBy=multi-user.target
Ativar e iniciar os serviços: Enable and start the services:
# Ativar serviços para arranque automático
sudo systemctl enable reticulum.service
sudo systemctl enable meshchat.service
sudo systemctl enable hostapd
sudo systemctl enable dnsmasq
# Iniciar serviços
sudo systemctl start reticulum.service
sudo systemctl start meshchat.service
sudo systemctl start hostapd
sudo systemctl start dnsmasq
Testar Test
Verificar que tudo funciona corretamente. Usar um telemóvel para testar o fluxo completo. Verify everything works correctly. Use a phone to test the complete flow.
Ligar ao Wi-Fi "ONDORA-EMERGÊNCIA" Connect to Wi-Fi "ONDORA-EMERGÊNCIA"
No telemóvel, procurar a rede Wi-Fi "ONDORA-EMERGÊNCIA" e ligar (sem password). On your phone, find the "ONDORA-EMERGÊNCIA" Wi-Fi network and connect (no password).
Captive portal abre automaticamente Captive portal opens automatically
O MeshChat deve abrir automaticamente no browser. Se não redirecionar, abrir manualmente: http://192.168.4.1
MeshChat should open automatically in the browser. If it doesn't redirect, open manually: http://192.168.4.1
Definir nome e enviar mensagem Set name and send message
Definir o teu nome no MeshChat, clicar em "Announce" para anunciar a tua presença na rede, e enviar uma mensagem de teste. Set your name in MeshChat, click "Announce" to announce your presence on the network, and send a test message.
Verificar logs do sistema Check system logs
No terminal do Raspberry Pi, verificar os logs em tempo real. On the Raspberry Pi terminal, check real-time logs.
# Ver logs do Reticulum em tempo real
journalctl -u reticulum -f
# Verificar estado das interfaces
rnstatus
# Listar todos os destinos conhecidos
rnstatus -a
Criar Imagem SD Replicável Create Replicable SD Image
Depois de tudo configurado e testado, criar uma imagem do cartão SD para replicar rapidamente novos nós. Cada novo nó precisa apenas de uma identidade única. After everything is configured and tested, create an SD card image to quickly replicate new nodes. Each new node only needs a unique identity.
# Criar imagem do cartão SD (no computador, não no Pi)
sudo dd if=/dev/sdX of=ondora_v2.img bs=4M status=progress
# Comprimir a imagem
gzip ondora_v2.img
# Para cada novo nó: apagar a identidade antiga
# (executar no novo Pi depois de flashar a imagem)
rm ~/.reticulum/storage/identity
Importante:
Important:
Apagar ~/.reticulum/storage/identity em cada novo nó é essencial. Cada nó precisa de uma identidade criptográfica única na rede Reticulum. Sem este passo, haverá conflitos de identidade.
Deleting ~/.reticulum/storage/identity on each new node is essential. Each node needs a unique cryptographic identity on the Reticulum network. Without this step, there will be identity conflicts.
Tudo pronto. All set.
O teu nó ONDORA está funcional. Consulta a página de hardware para escolher os componentes certos, ou junta-te à comunidade para ajudar a expandir a rede. Your ONDORA node is operational. Check the hardware page to choose the right components, or join the community to help expand the network.