mirror of
https://github.com/TheCommsChannel/TC2-BBS-mesh.git
synced 2025-12-16 00:03:53 -05:00
Merge d2914c0913 into 295fb35c92
This commit is contained in:
commit
f3bbb6f4fb
2 changed files with 10 additions and 2 deletions
|
|
@ -11,7 +11,7 @@ RUN git clone https://github.com/TheCommsChannel/TC2-BBS-mesh.git
|
||||||
|
|
||||||
####
|
####
|
||||||
|
|
||||||
FROM --platform=$BUILDPLATFORM python:alpine
|
FROM --platform=$BUILDPLATFORM python:3.13.9-alpine
|
||||||
|
|
||||||
# Switch to non-root user
|
# Switch to non-root user
|
||||||
RUN adduser --disabled-password mesh
|
RUN adduser --disabled-password mesh
|
||||||
|
|
|
||||||
10
server.py
10
server.py
|
|
@ -37,6 +37,8 @@ js8call_formatter = logging.Formatter('%(asctime)s - JS8Call - %(levelname)s - %
|
||||||
js8call_handler.setFormatter(js8call_formatter)
|
js8call_handler.setFormatter(js8call_formatter)
|
||||||
js8call_logger.addHandler(js8call_handler)
|
js8call_logger.addHandler(js8call_handler)
|
||||||
|
|
||||||
|
continue_running = True
|
||||||
|
|
||||||
def display_banner():
|
def display_banner():
|
||||||
banner = """
|
banner = """
|
||||||
████████╗ ██████╗██████╗ ██████╗ ██████╗ ███████╗
|
████████╗ ██████╗██████╗ ██████╗ ██████╗ ███████╗
|
||||||
|
|
@ -70,7 +72,13 @@ def main():
|
||||||
def receive_packet(packet, interface):
|
def receive_packet(packet, interface):
|
||||||
on_receive(packet, interface)
|
on_receive(packet, interface)
|
||||||
|
|
||||||
|
def on_connection_loss(interface):
|
||||||
|
logging.error("Connection to Meshtastic device lost.")
|
||||||
|
global continue_running
|
||||||
|
continue_running = False
|
||||||
|
|
||||||
pub.subscribe(receive_packet, system_config['mqtt_topic'])
|
pub.subscribe(receive_packet, system_config['mqtt_topic'])
|
||||||
|
pub.subscribe(on_connection_loss, 'meshtastic.connection.lost')
|
||||||
|
|
||||||
# Initialize and start JS8Call Client if configured
|
# Initialize and start JS8Call Client if configured
|
||||||
js8call_client = JS8CallClient(interface)
|
js8call_client = JS8CallClient(interface)
|
||||||
|
|
@ -80,7 +88,7 @@ def main():
|
||||||
js8call_client.connect()
|
js8call_client.connect()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
while True:
|
while continue_running:
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue