SpiegieMon / Spiegiemon_piedition

Chat Application over LoRa written in Python with serial bluetooth input

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spiegiemon_PiEdition

Chat app for RaspberryPi LoRa communication written in python with bluetooth communication or over console

Uses Raspberry Pi with LoRa module sx1262

Prerequisites

Package and ansiblescript should do everything automatically

In file /etc/bluetooth/main.conf

DiscoverableTimeout = 0
PairableTimeout = 0

In file /etc/systemd/system/dbus-org.bluez.service

Overwrite

ExecStart=/usr/lib/bluetooth/bluetoothd

with

ExecStart=/usr/lib/bluetooth/bluetoothd -C
ExecStartPost=/usr/bin/sdptool add SP

then restart services with

sudo systemctl daemon-reload
sudo systemctl restart bluetooth.service

to make Raspberry pi Bluetooth discoverable

Systemd unit-file

[Unit]
Description=SpiegieMon

[Service]
Type=simple
WorkingDirectory=/home/pi/git/Spiegiemon_piedition
ExecStart=/home/pi/git/Spiegiemon_piedition/main.py
Environment="PYTHONUNBUFFERED=1"
After=bluetooth
Requires=bluetooth

[Install]
WantedBy=multi-user.target

Message format

The message has the following format:

  • One 1-bit message ID (incrementing for each message)
  • One

Features

  • threaded Bluetooth communication to module
  • threaded LoRa communication
  • queue based sending of messages so everything send by bluetooth gets send by LoRa-Module
  • console input
  • create systemd unit-file
  • create -i flag for interactive mode (console input)
  • Kontroll-LED
  • autosend sendername over lora
  • ACK between lora modules so no Message gets lost
  • add configfile
  • add ! commands to change sessionconfig in API like mannor (e.g. !setName:name or !getName)
  • LoRa Repeater to increase range (first step of LoRa-Network)
  • add ansible setupscript
  • pack to dpkg package
  • force LoRa airtime restrictions

Tested with

  • Raspberry Pi 2 Model B Rev 1.2 using Raspbian 11 (with bluetooth dongle)
  • Raspberry Pi 4 Model B Rev 1.2 using Raspbian 10
  • Raspberry Pi Zero W Rev 1.1 using Raspbian 11 (LoRa not confirmed yet)

Contribution

If you want to contribute to this Project, you are welcome to fork this repository and submit a pull request.

About

Chat Application over LoRa written in Python with serial bluetooth input

License:GNU General Public License v3.0


Languages

Language:Python 100.0%