• Stars
    star
    1,056
  • Rank 43,682 (Top 0.9 %)
  • Language
    HTML
  • Created about 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A (paused) work-in-progress long-range, low-bandwidth wireless disaster recovery mesh network powered by the sun.

disaster.radio is currently not actively developed and seeks a new maintainer

It is a work-in-progress long-range, low-bandwidth wireless disaster recovery mesh network powered by the sun.

Build Status

Table of contents

Getting Started

The quickest way to get started with disaster.radio is to buy a preinstalled device or

  • Download the latest release
  • Unzip the disaster-radio-0.X.X.zip file
  • Follow the included instructions for flashing it to your device

If you would rather test the latest, cutting-edge developments, you can compile the firmware yourself by cloning this repo and following the initial setup instructions.

Layout and Flow

The Disaster Radio firmware is made up of a single "server" and a number of "clients", as well as "middleware" that sits between the clients and server. These are a"server" and "clients" in the logical, software sense, not a literal, networking sense.

Here are the modules currently implemented with descriptions of their purpose:

  • DisasterServer:

    • DisasterRadio: the main "server" that takes messages from clients and sends them to other clients
  • DisasterClient:

    • LoRaClient: interfaces with LoRaLayer2
    • WebSocketClient: WebSocket connections from the web app
    • StreamClient: for Arduino Stream, currently used for serial console
    • TCPClient: for a telnet-like server
    • HistoryRecord: records messages to SD card (or bounded queue in memory)
    • OLEDClient: displays messages on the screen (mostly for debugging purposes, but eventually I'd like to use this for a mobile Disaster Radio terminal of some kind)
    • GPSClient: proof-of-concept, interfaces with a serial GPS module to beacon your current location periodically
  • DisasterMiddleware:

    • WelcomeMessage: (very simple, in main.cpp) shows a welcome message to clients when they connect
    • HistoryReplay: shows history to clients when they connect
    • Console: implements a simple console with chat (similar to the web app) plus some /commands (I went with a more IRC-like syntax but you could easily implement a getopt version)
  • DisasterHistory:

    • HistorySD: records history to SD card
    • HistoryMemory: records history to a bounded queue in memory (default limit 10 messages)

The server and clients communicate with each other using "datagrams" that include a destination address, a message type, and a message. Read more about the disaster radio networking stack on our wiki, https://github.com/sudomesh/disaster-radio/wiki/Layered-Model.

Hardware Connections

For supported development boards see the Devices & Hardware wiki page.

The pinouts for supported boards can be found in firmware/esp32/config.h.

DIO0 sends an interrupt from the LoRa transceiver upon Tx/Rx Ready on the radio.
Chip selects can be used to explicitly switch between the LoRa tranceiver and the SD card; however, the SD card should be enabled by default, as the LoRa interrupt appears to handle enabling the transceiver (note: this still needs to be thoroughly tested, what happens if you receive an interrupt while loading from the SD?).

Initial Setup with PlatformIO

pip install -U platformio

Edit platformio.ini to suit your needs. If you are flashing a ESP32 LILY TTGO board then you will probably not have to edit anything in platformio.ini but make sure upload_port is set to the correct device which may vary depending on your operating system and which other devices you have connected.

Building firmware

To test that the firmware is compiling correctly without flashing it to a device, run

pio run

This will compile all libraries and main firmware files. The resulting binary is stored as .pio/build/ttgo-lora32-v1/firmware.bin

Flashing firmware

For dev boards

Connect your computer to the board using a usb cable,

In platformio.ini make sure upload_port, upload_speed, etc are correct for your device.

Then run:

pio run -t upload

By default, PlatformIO builds and flashes firmware for the LILY's ESP32 TTGO V2 dev board. If you would like to build for another supported board, select the corresponding build environment. For example to build and flash the firmware and file system for the ESP32 TTG0 V1 board, use the following,

pio run -e ttgo-lora32-v1 -t upload -t uploadfs

Developing firmware

Some useful hints for developing this firmware using platformio are included here,

  • It may be a good idea to delete the libdeps folder prior to rebuilding, as old, out-dated libraries could case conflits. To do this, rm -rf .pio/libdeps.
  • If you would like to make changes to a specific library, such as LoRaLayer2, you can clone the library into the firmware/lib folder that is created after running pio run and then comment it out or remove it from the lib_deps list in the platformio.ini file.

Building Web App

First, build the web app using npm, instructions for can be found in web/README.md.

If you have trouble building the web app with npm, you can download a pre-built version of web app as part of the latest release. Then, copy the files in web/static/ from the zipped release to the web/static/ directory in the cloned repo.

Building and uploading SPIFFS image

Next, build the binary for the SPIFFS and upload it to your board.

To only build:

pio run -t buildfs

To build and upload:

pio run -t uploadfs

If using an SD card, copy the contents of web/static/ to the root of a fat32 formatted SD card, then insert the SD card.

Testing Firmware

Once the firmware and SPIFFS image has been successfully flashed, you can test it by logging into the disaster.radio <node-address> wireless network and navigating to http://192.168.4.1 in a browser to access the demo chat app.

You can also try connecting to the device via serial or telnet with commands like,

pio device monitor

or

telnet 192.168.4.1

After pressing enter once, you should be greeted with a banner and presented with a prompt to enter a nick or send an anonymous message,

     ___              __                            ___    
 ___/ (_)__ ___ ____ / /____ ____      _______ ____/ (_)__ 
/ _  / (_-</ _ `(_-</ __/ -_) __/ _   / __/ _ `/ _  / / _ \
\_,_/_/___/\_,_/___/\__/\__/_/   (_) /_/  \_,_/\_,_/_/\___/
v1.0.0-rc.2
LoRa transceiver connected
Local address of your node is 1d69bd4c
Type '/join NICKNAME' to join the chat, or '/help' for more commands.
< > 

See firmware/README.md for more debugging information.

Adding Libraries

If you're including new libraries in the firmware, for PlatformIO, you wil need to add them to platformio.ini under lib_deps.

Creating Binary for Release

A full binary image can be created by reading the flash contents of a ESP32 that is flashed with the latest release of the firmware. To do this, run the following command,

esptool.py -p /dev/ttyUSB0 -b 921600 read_flash 0 0x400000 esp_flash.bin

This can then be flashed to a new device like so,

esptool.py -p /dev/ttyUSB0 --baud 460800 write_flash 0x00000 esp_flash.bin

License

  • firmware/: Dual licensed under both GPLv3 and AGPLv3
  • web/: AGPLv3

More Repositories

1

LoRaLayer2

Layer 2 routing protocol for LoRa connected devices
C++
86
star
2

sudowrt-firmware

Scripts to build the sudo mesh OpenWRT firmware.
Shell
74
star
3

ql570

Linux program for thermal sticker printing using the Brother QL-570 and QL-700 printers.
C
52
star
4

disaster-radio-website

Builds the Disaster Radio website.
SCSS
46
star
5

disaster-radio-simulator

A javascript network simulator for the disaster.radio routing protocol
JavaScript
31
star
6

mdnssd-min

dnssd-mini is a minimal client for mDNS and DNS-SD
C
24
star
7

peoplesopen-front

Front landing page for the peoplesopen.net website.
CSS
17
star
8

propaganda

artwork, logos, stickers, related to peoplesopen and sudomesh
17
star
9

disaster-radio-map

A collaborative mapping app for disaster.radio
JavaScript
14
star
10

node-whisperer-program

Node Whisperer Program is designed to help guide what you need to know to tell others how to operate a mesh network
14
star
11

sudowrt-web-ui

The new sudowrt client side web UI that uses ubus-mod-httpd instead of luci
JavaScript
13
star
12

babeld-lab

virtual network lab for babeld experiments
Shell
12
star
13

solar-nodes

Solar + battery powered 4G LTE mesh nodes
HTML
12
star
14

network-lab

Write JSON to build lightweight networks of nodes with variable link quality.
Shell
10
star
15

peoplesopen-dash

JavaScript
9
star
16

bugs

report sudomesh bugs or other issues here if you don't know where to put them
9
star
17

gardenmesh

a mesh for your garden
Python
9
star
18

disaster-radio-nodemcu

Attempt at using an ESP8266 as a Disaster Radio wifi gateway
CSS
8
star
19

lora-iface

Creates a network interface for a LoRa chip connected over serial
C
8
star
20

meshnode-database

A minimal mesh node database with an admin web gui and a RESTful json API
JavaScript
8
star
21

makenode

Configures new sudo mesh nodes
JavaScript
8
star
22

foutun

Foo-over-UDP tunneling
C
7
star
23

node-configurator

The client and server for individually configuring newly flashed nodes
JavaScript
6
star
24

exitnode

Configuration, script and instructions for exit nodes.
Shell
6
star
25

service-browser

A web app for browsing services available on the People's Open Network.
JavaScript
6
star
26

tp-flasher

A flasher utility for TP-Link routers and routers that need a tftp server
JavaScript
6
star
27

everythingisdownredirect

An OpenWRT package to issue HTTP 303 redirects and reverse-proxy HTTP connections for whitelisted URLs.
C
5
star
28

merakiflasher

A script for flashing meraki outdoor units
Python
5
star
29

mounting

related to all things mounting - equipment, prep, knowledge share
5
star
30

peoplesopen-deprecated

Website for peoplesopen.net, a child theme based on wp-foundation using the foundation framework 3.0 with bones
CSS
5
star
31

ipk-builder

A node.js library for building IPK packages.
JavaScript
5
star
32

monitor

a way to monitor health of (people's open) network
JavaScript
5
star
33

tunneldigger-lab

experiments on digging tunnels
Shell
4
star
34

luci-app-peopleswifi

A small admin site for managing hosted mesh nodes.
Lua
4
star
35

antenna-workshop

Antenna making workshop research and materials
4
star
36

sudowrt-packages

Build scripts and init scripts for the sudo mesh OpenWrt packages
Shell
4
star
37

connect-to-mesh

Convenience tool for connecting your computer to an exitnode
Shell
3
star
38

patches

find and deploy patches related to sudomesh bugs
Shell
3
star
39

ubus-https-forwarder

Forward local ubus request to a remote ubus instance via https to the remote uhttpd-mod-ubus
3
star
40

peoples-map

Beginnings of an ultra simple mesh map and monitoring tool
CSS
3
star
41

ubi-flasher

This is an automated firmware flasher for ubiquiti devices. It uses the web-interface to flash.
JavaScript
3
star
42

wiregraft

Minimal python server and shell client for automatically granting access for wireguard clients to a wireguard server
Shell
3
star
43

services-registry-client

A web application for adding DNS entries and browsing services
JavaScript
2
star
44

openwrt-to-sudowrt

openwrt to sudowrt converter [deprecated]
Shell
2
star
45

stdsudo

repository for all sudo libraries
Lua
2
star
46

svg-animations

Some SVG animations, especially using various Sudo Mesh diagrams https://sudoroom.org/wiki/Mesh/Diagrams generate in Inkscape with the Sozi extension
2
star
47

relaynode

Configuration, script and instructions for relay nodes
Shell
2
star
48

garden-gnome

Fake walled garden for only capturing OS-level internet access probes
JavaScript
2
star
49

watchpuppy

A watchdog utility that let's you activate, configure and deactivate a hardware watchdog
C
2
star
50

openwrt-firmware-config

Config Package for Firmware Generator
Shell
1
star
51

captive-portal-splash

The splash page that is presented by our fake captive portal.
HTML
1
star
52

remote-makenode

Auto-configure newly flashed nodes using makenode over ssh
JavaScript
1
star
53

shovelcat

Tunnel daemon for ppp over netcat
JavaScript
1
star
54

gumbyport

a port for gumby-based designed pages to a very very simple wordpress theme.
CSS
1
star
55

disaster-radio-git-ssb

Links to disaster.radio repos hosted on git-ssb
1
star
56

disaster-ping-pong

helps locate friendly ssids
Lua
1
star
57

node-watchdog

watchdog service for mesh nodes.
Lua
1
star
58

simple-service-advertisement

JavaScript
1
star
59

sudomesh-flasher

New multi-flasher with sticker printing capability.
JavaScript
1
star
60

governance

1
star
61

quarterlies

How to build quarterly reports for Sudo mesh
Shell
1
star
62

sudowrt-firmware-images

An easy place for us to keep the newest version of built images
1
star
63

luci-app-simple-design

Static files for tweaking admin gui design without needing a dev environment.
CSS
1
star
64

airos-config-tool

peoplesopen configuration automater for AirOS
Shell
1
star
65

procd

A fork of openwrt procd that actually closes the watchdog device when the watchdog is stopped
C
1
star
66

sudowrt-flash

Script to flash routers for the people's open network https://peoplesopen.net/ using sudowrt https://github.com/sudomesh/sudowrt. Learn more at:
Shell
1
star