A BBS server for Meshtastic for posting bulletins, sending mail to users, and channel directory.
Find a file
2024-09-24 15:12:32 +03:00
docker Revert "Merge pull request #16 from upchui/main" 2024-06-28 11:34:20 -04:00
examples Created Examples directory and added the Ferengi Rules of Acquisition 2024-07-05 15:32:36 -07:00
.gitignore Add JS8Call capability 2024-07-14 18:52:06 -04:00
command_handlers.py Update command_handlers.py 2024-09-22 23:19:47 +03:00
config_init.py Added Reply option and some fixed 2024-07-09 17:46:34 -04:00
db_admin.py Update db_admin.py 2024-07-11 10:52:17 -04:00
db_operations.py Added Reply option and some fixed 2024-07-09 17:46:34 -04:00
example_config.ini Update example_config.ini 2024-07-29 06:18:17 -04:00
fortunes.txt Rename example_fortunes.txt to fortunes.txt 2024-07-10 23:26:41 -04:00
js8call_integration.py Add ability to add "x" to commands 2024-07-23 16:07:13 -04:00
LICENSE Initial commit 2024-06-25 08:13:23 -04:00
mesh-bbs.service Updates for systemd 2024-06-28 08:18:12 -04:00
message_processing.py make send message and receive message use same lingo 2024-09-24 13:57:22 +03:00
README.md Update README.md 2024-08-07 16:47:04 -04:00
requirements.txt Add files via upload 2024-06-25 08:50:52 -04:00
server.py Add JS8Call capability 2024-07-14 18:52:06 -04:00
utils.py messages are now wantAck=True to improve reliability 2024-09-24 15:12:32 +03:00

TC²-BBS Meshtastic Version

ko-fi

This is the TC²-BBS system integrated with Meshtastic devices. The system allows for message handling, bulletin boards, mail systems, and a channel directory.

Docker

If you're a Docker user, TC²-BBS Meshtastic is available on Docker Hub!

Docker HUB

Setup

Requirements

  • Python 3.x
  • Meshtastic
  • pypubsub

Update and Install Git

sudo apt update
sudo apt upgrade
sudo apt install git

Installation

  1. Clone the repository:

    cd ~
    git clone https://github.com/TheCommsChannel/TC2-BBS-mesh.git
    cd TC2-BBS-mesh
    
  2. Set up a Python virtual environment:

    python -m venv venv
    
  3. Activate the virtual environment:

    • On Windows:
    venv\Scripts\activate  
    
    • On macOS and Linux:
    source venv/bin/activate
    
  4. Install the required packages:

    pip install -r requirements.txt
    
  5. Rename example_config.ini:

    mv example_config.ini config.ini
    
  6. Set up the configuration in config.ini:

    You'll need to open up the config.ini file in a text editor and make your changes following the instructions below

    [interface]
    If using type = serial and you have multiple devices connected, you will need to uncomment the port = line and enter the port of your device.

    Linux Example:
    port = /dev/ttyUSB0

    Windows Example:
    port = COM3

    If using type = tcp you will need to uncomment the hostname = 192.168.x.x line and put in the IP address of your Meshtastic device.

    [sync]
    Enter a list of other BBS nodes you would like to sync messages and bulletins with. Separate each by comma and no spaces as shown in the example below.
    You can find the nodeID in the menu under Radio Configuration > User for each node, or use this script for getting nodedb data from a device:

    Meshtastic-Python-Examples/print-nodedb.py at main · pdxlocations/Meshtastic-Python-Examples (github.com)

    Example Config:

    [interface]  
    type = serial  
    # port = /dev/ttyUSB0  
    # hostname = 192.168.x.x  
    
    [sync]  
    bbs_nodes = !f53f4abc,!f3abc123  
    

Running the Server

Run the server with:

python server.py

Be sure you've followed the Python virtual environment steps above and activated it before running.

Command line arguments

$ python server.py --help

████████╗ ██████╗██████╗       ██████╗ ██████╗ ███████╗
╚══██╔══╝██╔════╝╚════██╗      ██╔══██╗██╔══██╗██╔════╝
   ██║   ██║      █████╔╝█████╗██████╔╝██████╔╝███████╗
   ██║   ██║     ██╔═══╝ ╚════╝██╔══██╗██╔══██╗╚════██║
   ██║   ╚██████╗███████╗      ██████╔╝██████╔╝███████║
   ╚═╝    ╚═════╝╚══════╝      ╚═════╝ ╚═════╝ ╚══════╝
Meshtastic Version

usage: server.py [-h] [--config CONFIG] [--interface-type {serial,tcp}] [--port PORT] [--host HOST] [--mqtt-topic MQTT_TOPIC]

Meshtastic BBS system

options:
  -h, --help            show this help message and exit
  --config CONFIG, -c CONFIG
                        System configuration file
  --interface-type {serial,tcp}, -i {serial,tcp}
                        Node interface type
  --port PORT, -p PORT  Serial port
  --host HOST           TCP host address
  --mqtt-topic MQTT_TOPIC, -t MQTT_TOPIC
                        MQTT topic to subscribe

Automatically run at boot

If you would like to have the script automatically run at boot, follow the steps below:

  1. Edit the service file

    First, edit the mesh-bbs.service file using your preferred text editor. The 3 following lines in that file are what we need to edit:

    User=pi
    WorkingDirectory=/home/pi/TC2-BBS-mesh
    ExecStart=/home/pi/TC2-BBS-mesh/venv/bin/python3 /home/pi/TC2-BBS-mesh/server.py
    

    The file is currently setup for a user named 'pi' and assumes that the TC2-BBS-mesh directory is located in the home directory (which it should be if the earlier directions were followed)

    We just need to replace the 4 parts that have "pi" in those 3 lines with your username.

  2. Configuring systemd

    From the TC2-BBS-mesh directory, run the following commands:

    sudo cp mesh-bbs.service /etc/systemd/system/
    
    sudo systemctl enable mesh-bbs.service
    
    sudo systemctl start mesh-bbs.service
    

    The service should be started now and should start anytime your device is powered on or rebooted. You can check the status of the service by running the following command:

    sudo systemctl status mesh-bbs.service
    

    If you need to stop the service, you can run the following:

    sudo systemctl stop mesh-bbs.service
    

    If you need to restart the service, you can do so with the following command:

    sudo systemctl restart mesh-bbs.service
    
  3. Viewing Logs

    Viewing past logs:

    journalctl -u mesh-bbs.service
    

    Viewing live logs:

    journalctl -u mesh-bbs.service -f
    

Radio Configuration

Note: There have been reports of issues with some device roles that may allow the BBS to communicate for a short time, but then the BBS will stop responding to requests.

The following device roles have been working:

  • Client
  • Router_Client

Features

  • Mail System: Send and receive mail messages.
  • Bulletin Boards: Post and view bulletins on various boards.
  • Channel Directory: Add and view channels in the directory.
  • Statistics: View statistics about nodes, hardware, and roles.
  • Wall of Shame: View devices with low battery levels.
  • Fortune Teller: Get a random fortune. Pulls from the fortunes.txt file. Feel free to edit this file remove or add more if you like.

Usage

You interact with the BBS by sending direct messages to the node that's connected to the system running the Python script. Sending any message to it will get a response with the main menu.
Make selections by sending messages based on the letter or number in brackets - Send M for [M]ail Menu for example.

A video of it in use is available on our YouTube channel:

TC²-BBS-Mesh

Thanks

Meshtastic:

Big thanks to Meshtastic and pdxlocations for the great Python examples:

python/examples at master · meshtastic/python (github.com)

pdxlocations/Meshtastic-Python-Examples (github.com)

JS8Call:

For the JS8Call side of things, big thanks to Jordan Sherer for JS8Call and the example API Python script

License

GNU General Public License v3.0