mesh-api icon indicating copy to clipboard operation
mesh-api copied to clipboard

Stability Issues Over Time

Open omgitsgela opened this issue 1 year ago • 11 comments

I'm noticing there's some issues with stability over a long period of time running the chat agent. After hours of running it, I've noticed parts of messages sent over to Meshtastic truncated from the original text intended, or I've also noticed ollama will resolve text, and it appears from the log that it is scheduling it to be sent to Meshtastic, but it gets stuck and doesn't come through.

I wish I had better logging to show you on this, but I'm not confident that the log is actually picking up this problem. Everything reads okay, but the execution of the text information on the Meshtastic bridge side is failing over time.

Please let me know if there's anything I can do to help you with more information.

omgitsgela avatar Sep 10 '25 10:09 omgitsgela

I have noticed ollama is the least agreeable to this system - like this is how it handles function calls and JSON...

LMStudio for me has been rock solid as the AI provider - and has been the main focus of my development thus far - ollama was an afterthought - and is only there to support platforms LMStudio doesn't... like ARM and Raspberry Pi servers.

If LM would release an ARM friendly version - I'd personally just nuke Ollama entirely from support... to be honest.

Are you running on an ARM platform or on x64? If on x64 - give LMStudio a try - as my system has been up for months now and stable as a rock!

mr-tbot avatar Sep 10 '25 23:09 mr-tbot

But yes - I'll put this on my check list - I have a ARM server built as well for testing - I'll try to set it up with a node and stress test it from time to time - but - so far I have as well noticed ollama spewing nonsense and just not responding well.

You can also try running LMStudio on a separate machine if you are hosting the Mesh-AI software on a Pi - forward it to a different x64 based server and see if LMStudio plays nicer - I have a feeling that's the real problem you might be experiencing.

Any additional info you can provide would be helpful though!

mr-tbot avatar Sep 10 '25 23:09 mr-tbot

I'm running this on Windows 10, with ollama. it was honestly the easiest environment for my use case, since this is also a windows gaming PC, and ollama is dead simple to setup. Someday I'd like to try this on a Raspberry Pi that has enough power to run an LLM, but I wanted the bandwidth to handle gpt-oss:20b queries for now from a fixed base station.

I can check out LM Studio, but I'd love to keep support for ollama just for ease of end user use.

I'll let the program run for a while, do some queries and send you the full log, see if you notice anything out of place.

omgitsgela avatar Sep 11 '25 07:09 omgitsgela

I'm running this on Windows 10, with ollama. it was honestly the easiest environment for my use case, since this is also a windows gaming PC, and ollama is dead simple to setup. Someday I'd like to try this on a Raspberry Pi that has enough power to run an LLM, but I wanted the bandwidth to handle gpt-oss:20b queries for now from a fixed base station.

I can check out LM Studio, but I'd love to keep support for ollama just for ease of end user use.

I'll let the program run for a while, do some queries and send you the full log, see if you notice anything out of place.

I think you will find LMStudio is far easier and nicer to use over ollama - I don't intend on dropping ollama support - but it is inherently a lot less feature rich than LMStudio - so - obviously milage may vary depending on what LLM provider you use.

Personally? LMStudio has been rock solid - and it is extremely easy to deploy and use. Especially on windows! I highly suggest trying it out.

mr-tbot avatar Sep 11 '25 07:09 mr-tbot

v0.6.0 Pre-Release code is up. Please download and test - I added new features to hopefully stabilize ollama.

mr-tbot avatar Sep 27 '25 22:09 mr-tbot

I'm running this on Windows 10, with ollama. it was honestly the easiest environment for my use case, since this is also a windows gaming PC, and ollama is dead simple to setup. Someday I'd like to try this on a Raspberry Pi that has enough power to run an LLM, but I wanted the bandwidth to handle gpt-oss:20b queries for now from a fixed base station.

I can check out LM Studio, but I'd love to keep support for ollama just for ease of end user use.

I'll let the program run for a while, do some queries and send you the full log, see if you notice anything out of place.

I am running Ollama outside docker on a Orange PI was to use the NPU but Ollama doesnt support this. I have stability issues as well with running mesh-ai inside docker. Generally a restart fixes the issue but I disabled debug to quieten the logs.

droidblastnz avatar Oct 01 '25 19:10 droidblastnz

Do either of you by chance have other software that reads COM ports or serial? Anything on that host machine?

I had stability issues initially because I had other programs trying to grab the serial port of the mesh node.

Try a couple things.

  1. Try over Wi-Fi - if this seems more stable overall - likely it's apps fighting over the serial device.

  2. You can "lock" a USB device to a specific container in docker... here's the gist on doing that...

Here's how to lock /dev/ttyUSB0 or /dev/ttyACM0 (or /dev/tty0 if that’s the actual target) to mesh-ai so nothing else can use it:

🧩 Step 1: Identify your device

First, confirm which port your hardware is actually on:

ls /dev/tty* dmesg | grep tty

Example result might be /dev/ttyUSB0.

⚙️ Step 2: Grant permissions (optional but important)

Add your user to the dialout group so you can access serial devices:

sudo usermod -aG dialout $USER

Then log out/in to apply.

🚢 Step 3: Bind the port into your container

You can pass the USB/TTY device directly into the container at runtime:

docker run -it --name mesh-ai
--device=/dev/ttyUSB0:/dev/ttyUSB0
mesh-ai:latest

That --device flag gives the container exclusive access to that TTY.

If the container is already running:

docker stop mesh-ai docker rm mesh-ai docker run ... (with the --device flag)

🔒 Step 4: Prevent host access (optional)

To fully “lock” the port to that container and keep the host or other containers from touching it:

sudo chmod 000 /dev/ttyUSB0

Then restart the container (Docker will still have access since it’s mapped before the chmod takes effect).

Alternatively, you can udev-bind it permanently by creating a rule:

sudo nano /etc/udev/rules.d/99-mesh-ai.rules

Add:

SUBSYSTEM=="tty", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", MODE="0660", GROUP="docker"

(Replace idVendor/idProduct with the actual USB device values from lsusb.)

That ensures the device always shows up with Docker-safe permissions and can be auto-bound to mesh-ai.

⚙️ Step 5: Verify in container

Once mesh-ai is running:

docker exec -it mesh-ai bash ls /dev/tty*

You should see /dev/ttyUSB0 inside. Then test your serial communication (e.g., via screen, minicom, or your Python script).

💡 Tip: If you want to make it permanent in a docker-compose.yml, include:

services: mesh-ai: image: mesh-ai:latest devices: - "/dev/ttyUSB0:/dev/ttyUSB0"

mr-tbot avatar Oct 06 '25 14:10 mr-tbot

Bump? Closing soon.

mr-tbot avatar Jan 21 '26 23:01 mr-tbot

I dont mine is a orange PI running Mesh-AI locally with Ollama LLM local. Runs for some time and then has issues

droidblastnz avatar Jan 21 '26 23:01 droidblastnz

About to push a PR3 version which includes some new throttling features specifically aimed at ollama users on lower power hardware. Give it a try once it goes live and let me know how you fare!

I dont mine is a orange PI running Mesh-AI locally with Ollama LLM local. Runs for some time and then has issues

mr-tbot avatar Feb 08 '26 22:02 mr-tbot

v0.6.0 is coming out today with more fixes for this issue - please test and report back if you continue to have problems with ollama!

mr-tbot avatar Mar 08 '26 23:03 mr-tbot