Commit Graph

132 Commits

Author SHA1 Message Date
SpudGunMan 16dcc96037 consolidate time to wait 2025-10-14 09:38:38 -07:00
SpudGunMan 0c8fb0c243 cleanup 2025-10-11 07:54:20 -07:00
SpudGunMan 4ba60ed276 correctLogLevel 2025-10-06 14:25:13 -07:00
SpudGunMan ae1a3040b5 patches
dont need no stinking patches. thanks again.
2025-10-06 12:54:41 -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 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 4c7fe55b43 hopFix 2025-08-18 18:54:02 -07:00
SpudGunMan df6a1cfb66 Update pong_bot.py
better MQTT handler
2025-08-17 20:25:40 -07:00
SpudGunMan 748652ac62 onDisconnect
correcting multiple issues adding config.ini feature for dont_retry_disconnect

https://github.com/SpudGunMan/meshing-around/issues/137
https://github.com/SpudGunMan/meshing-around/issues/156
2025-07-21 20:10:59 -07:00
SpudGunMan 3f882dcfcd fix message.log
fixing issue for log in https://github.com/SpudGunMan/meshing-around/pull/161

Co-Authored-By: SudoRand <25190078+sudorand@users.noreply.github.com>
2025-07-15 09:41:34 -07:00
SpudGunMan 0bc3d392cf fix Interface logic
a condition where TCP interfaces can fail leaving a none condition. this should resolve the errored interface better.
2025-06-25 07:30:46 -07:00
SpudGunMan 4f115c9c21 Update pong_bot.py 2025-01-22 22:02:42 -08:00
SpudGunMan 7ae0d5e927 Update pong_bot.py 2025-01-12 12:39:37 -08:00
SpudGunMan 49b8206e76 Update pong_bot.py 2025-01-12 12:36:08 -08:00
SpudGunMan db9b89d0ac Update pong_bot.py 2025-01-02 22:08:59 -08:00
SpudGunMan b4168214b6 #hints 2025-01-02 21:02:14 -08:00
SpudGunMan 1df3a7aaa2 enhance 2025-01-01 11:35:49 -08:00
SpudGunMan 8ac9c53f1a enhance groupPing 2024-12-19 18:29:35 -08:00
SpudGunMan 6296150677 Update pong_bot.py 2024-12-19 17:40:10 -08:00
SpudGunMan 99c404f479 moveThisShakeThat 2024-12-13 20:12:40 -08:00
SpudGunMan 659ee2959c cleanup 2024-12-13 20:10:59 -08:00
SpudGunMan 1ac9f3b0d6 loop detector 2024-12-13 20:04:20 -08:00
SpudGunMan e438c82a11 enhance 2024-12-13 14:19:22 -08:00
SpudGunMan 0439db2ec0 sysinfo
returns telemetry info
2024-12-13 12:59:12 -08:00
SpudGunMan eeffc6361a enhance@🏓 2024-12-13 11:45:50 -08:00
SpudGunMan e2be3c20b7 enhance🏓 2024-12-13 10:30:18 -08:00
SpudGunMan e115f33d47 pingEnhancments🏓
added autoPingInChannel = False
 # Allows auto-ping feature in a channel, False forces DM

also added node short name to all channel ping
2024-12-13 10:07:14 -08:00
SpudGunMan a9c2660ec1 MQTT Logic for ping 2024-12-12 22:44:24 -08:00
SpudGunMan 92e1e3168e Update pong_bot.py 2024-12-06 11:35:06 -08:00
SpudGunMan 2b7a20f8d9 Update pong_bot.py 2024-12-05 23:19:55 -08:00
SpudGunMan ce74f910a7 Update pong_bot.py 2024-09-24 19:32:26 -07:00
SpudGunMan e7e2c9604e 2.5firmware PKI enhance 2024-09-22 18:15:24 -07:00
SpudGunMan edaf6875ef Update pong_bot.py 2024-09-22 17:45:42 -07:00
SpudGunMan e7976a0a88 packetDebug 2024-09-22 17:45:33 -07:00
Nestpebble 7a071c33cd Merge branch 'SpudGunMan:main' into main 2024-09-13 23:28:47 +01:00
SpudGunMan b12cf6219a responseDelay 2024-09-06 09:31:30 -07:00
Nestpebble 6e7e89c2d0 Update pong_bot.py 2024-09-06 13:31:46 +01:00
SpudGunMan e968173f61 Update pong_bot.py 2024-09-01 21:53:01 -07:00
SpudGunMan 473eccbdea fix BLE 2024-08-27 20:31:00 -07:00
SpudGunMan 22e16db1f2 typos 2024-08-27 18:10:29 -07:00
SpudGunMan 9d7e42aa60 onDisconnect
add monitor for ondisconnect
2024-08-27 13:08:59 -07:00
SpudGunMan 066f451a4d orderLogs 2024-08-16 02:37:38 -07:00
SpudGunMan c50776b991 aarg 2024-08-15 23:25:31 -07:00