A bot for meshtastic nodes - UNSUPPORTED
I coded this bot in the passing, so take it or leave it. Cheers. Attention: The bot will not work, if you do not read the instructions below closely
You need meshtastic[cli], flask, toml
If you connect via WiFi to the node, you must edit the file config.toml first and enter the IP-Address of the node. If you use a serial connection, you can skip this step.
Run:
python nodebot.py
Write down the channel indexes. Press Ctrl+C several times to exit
nano config.toml
Edit the channels section, set private admin and infochannels. You will see all channel indexes at the first start of the bot. Edit other values on your behalf. In general section set chanexit to false. Save the file and run with python nodebot.py
Find a weather service, open the source code of the url that contains the text, set weather.split_left to the unique html text left of the text, the same for the right part. Set url and enable the service. Restart the bot.
This is available in Germany only. You need the 2-digit code of your state. Enter it into ninawarnings.state. You need an online json file containing all region keys. Enter that url into ninawarnings.keyurl. Now you need the URL to the NINA-Dashboard. Enter it into ninawarnings.dashurljson with a trailing slash. DO NOT include a filename like 12345.json. Now you need the URL to the NINA-Warning-Details. Enter it into ninawarnings.detailurljson with a trailing slash. DO NOT include a filename like 12345.json. Under [ninawarnings.regionnames] add the regionkey and the corresponding Name of each "Landkreis". Enable the service. There is no warranty for reliability, correctness and completeness of this warning system. Use on own risk.
If not already done, enable the rc.local service. Thereafter edit/create the file /etc/rc.local:
#!/bin/sh -e
cd /home/pi/nodebot
python /home/pi/nodebot/nodebot.py &
exit 0
(Adjust the paths)
- /info - Bot information
- /warnings - See list of warnings
- /stats - Bot statistics
- /ping - Request a pong
- /help - Help
- /echo - Requet an echo response
- test - Bot responds with a test message
- greetings - Sometimes (!) the bot answers a greeting
- /ban {12345677890} - Ban a user from the bot (the user can not issue any commandy) and the messages do not appear in the history API
- /unban {12345677890} - Self explaining
- /banlist - List banned users
- /weathertest - Works in admin channel, tests weather retrieval
- /reboot - reboots the server (yep the server, not the bot)