Commit Graph

675 Commits

Author SHA1 Message Date
SpudGunMan ddb9c8b4bf Update mesh_bot.py 2025-10-07 20:34:17 -07:00
SpudGunMan 73f3175705 Update mesh_bot.py 2025-10-07 20:18:12 -07:00
SpudGunMan b4a2149815 enhance 2025-10-07 20:00:22 -07:00
SpudGunMan 320f41e05a documentation 2025-10-07 17:58:19 -07:00
SpudGunMan 48a57e875f QuizMaster
let me know if this is cool
2025-10-07 17:48:22 -07:00
SpudGunMan 00280e351c Update mesh_bot.py 2025-10-07 14:04:07 -07:00
SpudGunMan 0e8bb197a9 Update mesh_bot.py 2025-10-07 13:59:49 -07:00
SpudGunMan d825c0fa15 Update mesh_bot.py
what happened here? I forget now but sheesh!
2025-10-07 13:57:00 -07:00
SpudGunMan 6abe73c1bc Update mesh_bot.py
ack
2025-10-07 13:54:32 -07:00
SpudGunMan b8e9adb223 fixMessagesCommand
thanks @mesb1  https://github.com/SpudGunMan/meshing-around/issues/200
2025-10-07 13:48:23 -07:00
SpudGunMan cfaf652852 Update mesh_bot.py 2025-10-06 20:02:36 -07:00
SpudGunMan 6c27b5d5de xoxo
enhance
2025-10-06 18:03:22 -07:00
SpudGunMan a9da8336cc enhance 2025-10-06 14:40:08 -07:00
SpudGunMan 4ba60ed276 correctLogLevel 2025-10-06 14:25:13 -07:00
SpudGunMan e137420138 patch-2 2025-10-06 14:08:07 -07:00
SpudGunMan 2045bf98f7 🧩 2025-10-06 13:45:02 -07:00
SpudGunMan c36ce2c3a6 Update mesh_bot.py 2025-10-06 13:09:47 -07:00
SpudGunMan 7ff36a3d5f Update mesh_bot.py 2025-10-06 13:05:32 -07:00
SpudGunMan ae1a3040b5 patches
dont need no stinking patches. thanks again.
2025-10-06 12:54:41 -07:00
Martin Bogomolni 84b6b48d60 feat: Add tic-tac-toe game with compact messaging
🎮 New Tic-Tac-Toe Game Features:
- Compact 3x3 board display using ASCII art
- Smart AI opponent with win/block/random strategy
- All messages under 200-character meshtastic limit (tested: 10-50 chars)
- Player vs Bot gameplay with X (player) vs O (bot)
- Win detection for rows, columns, and diagonals
- Tie game detection when board is full
- Game statistics tracking (games played, won)

🔧 Integration Features:
- Follows established game patterns from hangman/hamtest
- Added to restrictedCommands (DM-only like other games)
- Integrated with game tracker system for memory cleanup
- Added configuration option in config.template
- Automatic cleanup of stale game sessions

🎯 Game Mechanics:
- Players pick positions 1-9 corresponding to board layout
- Simple input parsing (extracts first digit from message)
- Graceful error handling for invalid moves
- 'end' command to quit game
- Automatic game cleanup on completion

📊 Message Examples:
- New game: 39 chars
- Game moves: 50 chars
- Win/lose: 40 chars
- Invalid move: 23 chars
- All well under 200-char limit

Tested: Complete game scenarios, AI behavior, message lengths
Follows: Existing game implementation patterns and memory management
2025-10-06 00:08:56 -07:00
Martin Bogomolni 9f3446b605 feat: Implement comprehensive memory management and stability improvements
🔧 Memory Management Enhancements:
- Add memory cleanup constants (MAX_CMD_HISTORY=1000, MAX_SEEN_NODES=500, MAX_MSG_HISTORY=100)
- Implement cleanup_memory() function to prevent unbounded list growth
- Add periodic cleanup every hour via watchdog process
- Clean up stale game tracker entries automatically
- Limit cmdHistory and msg_history sizes to prevent memory bloat

🚀 Async Task Management Improvements:
- Fix async task management in both mesh_bot.py and pong_bot.py
- Implement proper task cleanup and cancellation on shutdown
- Add task names for better debugging and monitoring
- Use asyncio.gather() with return_exceptions=True for better error handling
- Prevent task hanging and resource leaks

🛡️ Enhanced Resource Management:
- Improve exit_handler() with proper interface cleanup
- Add atexit.register() for automatic graceful shutdown
- Ensure all meshtastic interfaces are properly closed
- Save persistent data (BBS, email, SMS, game scores) on exit
- Perform final memory cleanup during shutdown

🔍 Better Exception Handling:
- Replace bare except: blocks with specific exception handling
- Add proper error logging throughout the codebase
- Improve BBS database operations with better error recovery
- Add try/catch blocks for file operations and imports

📈 System Stability Improvements:
- Prevent memory leaks from growing lists and dictionaries
- Add automatic cleanup of stale player tracking data
- Improve error recovery in watchdog and async loops
- Better handling of interface connection failures

These changes address critical memory management issues that could cause
the bot to consume increasing memory over time, eventually leading to
system instability. The improvements ensure long-term reliability and
better resource utilization.

Fixes: Memory leaks, async task hanging, resource cleanup issues
Improves: System stability, error handling, resource management
Tested: Code analysis and review completed
2025-10-05 23:45:40 -07:00
SpudGunMan 0578c0b233 more enhancing metadata 2025-10-05 19:00:34 -07:00
SpudGunMan ebe2636104 refactor riverflow 2025-10-03 15:34:03 -07:00
SpudGunMan 971a421d01 riverflow refactor 2025-10-03 15:15:40 -07:00
SpudGunMan 5209092928 better riverflow logic 2025-10-03 14:54:12 -07:00
SpudGunMan 2e8206d4ec x:ShellCommands
this x: is a direct shell access from DM, to enable it needs the enable_runShellCmd, allowXcmd, xcmdChannel set. Make sure your secure.
2025-10-02 18:58:27 -07:00
SpudGunMan 9d96c02870 catch em all 2025-09-29 16:59:13 -07:00
SpudGunMan c87dba1e06 fixWikiErrors 2025-09-29 16:58:34 -07:00
SpudGunMan 1c3d2f7f18 Update mesh_bot.py 2025-09-29 16:16:33 -07:00
SpudGunMan 99e74ae8c0 lower! 2025-09-28 18:22:56 -07:00
SpudGunMan 1bdfc3828f cleanup 2025-09-28 18:20:42 -07:00
SpudGunMan 26f39e76e6 somdays tabs killl me 2025-09-28 17:41:13 -07:00
SpudGunMan c49dcfbfc8 aarg 2025-09-28 17:38:59 -07:00
SpudGunMan 1008ec6afa yarp 2025-09-28 17:36:57 -07:00
SpudGunMan 6e3d83401f enhance echo
enhance echo
2025-09-28 16:28:31 -07:00
SpudGunMan f9ab6a79d3 echo
echo command will just echo, off by default its handy for things like making a demo or node speak
2025-09-28 15:04:56 -07:00
SpudGunMan 53ff37c782 howtall
is this handy? I thought it might be for tree tower use
2025-09-26 19:02:02 -07:00
SpudGunMan f79026a95f enhance
DEBUGpackets, debugMetadata hidden config.ini values
2025-09-24 15:16:37 -07:00
SpudGunMan 642738e3b6 noisyNodeLogging
telemetry logger idea
2025-09-16 17:09:47 -07:00
SpudGunMan 5703cfb381 🗺️ howfar 2025-09-09 12:42:03 -07:00
SpudGunMan 19935d9f08 howfar
initial idea goofin to see if this works
2025-09-07 19:12:57 -07:00
SpudGunMan f0e8b2c057 🐛 2025-09-02 11:19:23 -07:00
SpudGunMan 08c2c668f9 EarthQuake
from USGS data seismicportal.eu wont let me set a radius on lookups but looking into it
2025-08-26 14:21:10 -07:00
SpudGunMan c1adca7db0 Update mesh_bot.py 2025-08-18 18:55:23 -07:00
SpudGunMan 4c7fe55b43 hopFix 2025-08-18 18:54:02 -07:00
SpudGunMan 9994446510 better MQTT handler 2025-08-17 20:24:09 -07:00
dludwig 8ff7a0bf3c typo fix detetec -> detected 2025-08-13 15:18:34 -07:00
SpudGunMan 8f69c4d93c Update mesh_bot.py
aarg
2025-08-12 12:03:43 -07:00
SpudGunMan bc9ada91b4 Update mesh_bot.py 2025-08-12 11:54:17 -07:00
SpudGunMan 6c1f7940ca refactor coastal weather
changes to config.ini template if you use tide or mwx
2025-08-12 11:35:42 -07:00