mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-03-28 17:32:36 +01:00
documentation
This commit is contained in:
75
etc/README.md
Normal file
75
etc/README.md
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
# etc Directory
|
||||||
|
|
||||||
|
This folder contains supporting files and resources for the Mesh Bot project. Typical contents include:
|
||||||
|
|
||||||
|
- **Images**: Visual assets used in documentation (e.g., `pong-bot.jpg`).
|
||||||
|
- **Custom Scripts**: Example or utility scripts for advanced configuration (e.g., `custom_scheduler.py` for scheduled tasks).
|
||||||
|
- **tmp**: Temp files for install
|
||||||
|
|
||||||
|
## db_admin.py
|
||||||
|
|
||||||
|
**Purpose:**
|
||||||
|
`db_admin.py` is a simple administrative tool for viewing the contents of the Mesh Bot’s data and high score databases. It loads and prints out messages, direct messages, email/SMS records, and game high score tables stored in the `/data` directory.
|
||||||
|
|
||||||
|
**Usage:**
|
||||||
|
Run this script from the command line to display the current contents of the bot’s databases. This is useful for debugging, verifying data integrity, or reviewing stored messages and game scores.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
python etc/db_admin.py
|
||||||
|
```
|
||||||
|
|
||||||
|
**What it does:**
|
||||||
|
- Attempts to load various `.pkl` and `.pickle` files from the `data` directory.
|
||||||
|
- Prints out the contents of BBS messages, direct messages, email and SMS databases.
|
||||||
|
- Displays high scores for supported games (Lemonade Stand, DopeWars, BlackJack, Video Poker, Mastermind, GolfSim).
|
||||||
|
- If a file is missing, it will print a message indicating so.
|
||||||
|
|
||||||
|
**Note:**
|
||||||
|
This tool is for administrative and debugging purposes only. It does not modify any data.
|
||||||
|
|
||||||
|
## eas_alert_parser.py
|
||||||
|
|
||||||
|
**Purpose:**
|
||||||
|
`eas_alert_parser.py` is a utility script for processing and cleaning up output from `multimon-ng` to extract and convert Emergency Alert System (EAS) messages for further use, such as with EAS2Text.
|
||||||
|
|
||||||
|
**Usage:**
|
||||||
|
This script is intended to be used with piped input, typically from `multimon-ng` decoding SAME/EAS messages. It filters and processes EAS lines, converts them to readable text using EAS2Text, and writes the results to `alert.txt`.
|
||||||
|
|
||||||
|
**Example usage:**
|
||||||
|
```sh
|
||||||
|
multimon-ng -a EAS ... | python etc/eas_alert_parser.py
|
||||||
|
```
|
||||||
|
|
||||||
|
**What it does:**
|
||||||
|
- Reads input line-by-line (supports piped or redirected input).
|
||||||
|
- Filters for lines starting with `EAS:` or `EAS (part):`.
|
||||||
|
- Avoids duplicate messages and only processes new alerts.
|
||||||
|
- Uses the EAS2Text library to convert EAS codes to human-readable messages.
|
||||||
|
- Writes completed alerts to `alert.txt` for further processing or notification.
|
||||||
|
|
||||||
|
**Note:**
|
||||||
|
This script is intended for experimental or hobbyist use and may require customization for your specific workflow.
|
||||||
|
|
||||||
|
## simulator.py
|
||||||
|
|
||||||
|
**Purpose:**
|
||||||
|
`simulator.py` is a development and testing tool that simulates the behavior of the Mesh Bot in a controlled environment. It allows you to prototype and test handler functions without needing real hardware or a live mesh network.
|
||||||
|
|
||||||
|
**Usage:**
|
||||||
|
Run this script from the command line to interactively test handler functions. You can input messages as if you were a mesh node, and see how your handler responds.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
python etc/simulator.py
|
||||||
|
```
|
||||||
|
|
||||||
|
**What it does:**
|
||||||
|
- Simulates node IDs, device IDs, and random GPS locations.
|
||||||
|
- Lets you specify which handler function to test (by setting `projectName`).
|
||||||
|
- Prompts for user input, passes it to the handler, and displays the response.
|
||||||
|
- Logs simulated message sending and handler output for review.
|
||||||
|
- Useful for rapid prototyping and debugging new features or message handlers.
|
||||||
|
|
||||||
|
**Note:**
|
||||||
|
Edit the `projectName` variable to match the handler function you want to test. You can expand this script to test additional handlers or scenarios as needed.
|
||||||
|
|
||||||
|
Feel free to add or update resources here as needed for documentation, configuration, or project support.
|
||||||
@@ -1,10 +1,16 @@
|
|||||||
# Logs and Reports
|
# Logs and Reports
|
||||||
Logs will collect here. Give a day of logs or a bunch of messages to have good reports.
|
|
||||||
|
|
||||||
## Reporting Note
|
This directory stores log files generated by the Mesh Bot. To generate useful reports, ensure you have at least a day's worth of logs or a substantial number of messages.
|
||||||
Reporting is via [../etc/report_generator5.py](../etc/report_generator5.py). The report_generator5 has newer feel and HTML5 coding. The index.html output is published in [../etc/www](../etc/www) there is a .cfg file created on first run for configuring values as needed (like moving web root)
|
|
||||||
- Make sure to have `SyslogToFile = True` and default of DEBUG log level to fully enable reporting! ‼️
|
## Reporting
|
||||||
- If you are in a venv and using launch.sh you can `launch.sh html5`
|
|
||||||
|
Reports are generated using [`../etc/report_generator5.py`](../etc/report_generator5.py), which produces modern HTML5 reports. The output (`index.html`) is saved in [`../etc/www`](../etc/www) by default. A `.cfg` configuration file is created on first run, allowing you to customize settings such as the web root directory.
|
||||||
|
|
||||||
|
- Ensure `SyslogToFile = True` and `sysloglevel = DEBUG` in your configuration to enable full reporting.
|
||||||
|
- If using a virtual environment and `launch.sh`, you can run:
|
||||||
|
```sh
|
||||||
|
launch.sh html5
|
||||||
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|||||||
60
script/README.md
Normal file
60
script/README.md
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
## script/runShell.sh
|
||||||
|
|
||||||
|
**Purpose:**
|
||||||
|
`runShell.sh` is a simple demo shell script for the Mesh Bot project. It demonstrates how to execute shell commands within the project’s scripting environment.
|
||||||
|
|
||||||
|
**Usage:**
|
||||||
|
Run this script from the terminal to see a basic example of shell scripting in the project context.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
bash script/runShell.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
**What it does:**
|
||||||
|
- Changes the working directory to the script’s location.
|
||||||
|
- Prints the current directory path and a message indicating the script is running.
|
||||||
|
- Serves as a template for creating additional shell scripts or automating tasks related to the project.
|
||||||
|
|
||||||
|
**Note:**
|
||||||
|
You can modify this script to add more shell commands or automation steps as needed for your workflow.
|
||||||
|
|
||||||
|
## script/runShell.sh
|
||||||
|
|
||||||
|
**Purpose:**
|
||||||
|
`runShell.sh` is a demonstration shell script for the Mesh Bot project, showing how to execute shell commands in the project environment.
|
||||||
|
|
||||||
|
**Usage:**
|
||||||
|
Run this script from the terminal to see a basic shell scripting example:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
bash script/runShell.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
**What it does:**
|
||||||
|
- Changes to the script’s directory.
|
||||||
|
- Prints the current directory path.
|
||||||
|
- Displays a message indicating the script is running.
|
||||||
|
|
||||||
|
**Note:**
|
||||||
|
You can use this as a template for your own shell scripts or to automate project-related tasks.
|
||||||
|
|
||||||
|
## script/sysEnv.sh
|
||||||
|
|
||||||
|
**Purpose:**
|
||||||
|
`sysEnv.sh` is a shell script that collects and displays system telemetry and environment information, especially useful for monitoring a Raspberry Pi or similar device running the Mesh Bot.
|
||||||
|
|
||||||
|
**Usage:**
|
||||||
|
Run this script from the terminal to view system stats and network info:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
bash script/sysEnv.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
**What it does:**
|
||||||
|
- Reports disk space, RAM usage, CPU usage, and CPU temperature (in °C and °F).
|
||||||
|
- Checks for available Git updates if the project is a Git repository.
|
||||||
|
- Displays the device’s public and local IP addresses.
|
||||||
|
- Designed to work on Linux systems, with special handling for Raspberry Pi hardware.
|
||||||
|
|
||||||
|
**Note:**
|
||||||
|
You can expand or modify this script to include additional telemetry or environment checks as needed for your deployment.
|
||||||
Reference in New Issue
Block a user