config.ini

This commit is contained in:
SpudGunMan
2024-07-10 19:38:04 -07:00
parent 4340a0a5ab
commit c29edac349
2 changed files with 15 additions and 11 deletions
+13 -6
View File
@@ -38,16 +38,23 @@ other features
- `launch.sh` will activate and launch the app in the venv if built
### Configurations
Currently config modifications is edit to code. Be sure to uncomment the appropriate interface for your method (serial/BLE/TCP). Only one at a time is supported to a single node at a time.
Some config is via code, converting to `config.ini` set the appropriate interface for your method (serial/ble/tcp).
Only one at a time is supported to a single node at a time.
```
# Uncomment the interface you want to use depending on your device connection
interface = meshtastic.serial_interface.SerialInterface() #serial interface
# you can specify SerialInterface('/dev/ttyUSB0')
#config.ini
# type can be serial, tcp, or ble
# port is the serial port to use, commented out will try to auto-detect
# hostname is the IP address of the device to connect to for tcp type
# mac is the MAC address of the device to connect to for ble type
#interface=meshtastic.tcp_interface.TCPInterface(hostname="192.168.0.1") # IP of your device
#interface=meshtastic.ble_interface.BLEInterface("AA:BB:CC:DD:EE:FF") # BLE interface
[interface]
type = serial
# port = '/dev/ttyUSB0'
# hostname = 192.168.0.1
# mac = 00:11:22:33:44:55
```
The following pair of settings determine how to respond, default action is to not spam the default channel. Setting DM_ONLY will force all DM which may not be wanted. Setting the Default channel is the channel which wont be spammed by the bot.
```
+2 -5
View File
@@ -10,17 +10,13 @@ import meshtastic.tcp_interface
import meshtastic.ble_interface
from datetime import datetime
from dadjokes import Dadjoke # pip install dadjokes
import configparser
# Import all the functions from the modules in the repo if you want to use them otherwise make waffles #
from modules.solarconditions import * # from the spudgunman/meshing-around repo
from modules.locationdata import * # from the spudgunman/meshing-around repo
from modules.bbstools import * # from the spudgunman/meshing-around repo
# Uncomment the interface you want to use depending on your device connection
interface = meshtastic.serial_interface.SerialInterface() #serial interface (specify port) default is first found
#interface=meshtastic.tcp_interface.TCPInterface(hostname="192.168.0.1") # IP of your device
#interface=meshtastic.ble_interface.BLEInterface("AA:BB:CC:DD:EE:FF") # BLE interface
# A basic list of strings to trap and respond to
trap_list = ("ping", "pinging", "ack", "testing", "pong", "motd", "cmd", "lheard", "sitrep", "joke")
@@ -35,6 +31,7 @@ MOTD = "Thanks for using PongBOT! Have a good day!" # Message of the Day
RESPOND_BY_DM_ONLY = False # Set to True to respond messages via DM only, False uses smart response
DEFAULT_CHANNEL = 0 # Default channel on your node, also known as "public channel" 0 on new devices
#Get the node number of the device, check if the device is connected
try:
myinfo = interface.getMyNodeInfo()