High RAM Usage on Raspberry Pi Zero W with ChirpStack Gateway OS and MQTT Python Script

Hello everyone,

I have installed ChirpStack Gateway OS on a Raspberry Pi Zero W. Everything works well until I run my Python script, which is responsible for sending data to the server via MQTT.

The problem I am facing is that as soon as the script starts running, the RAM usage on the Pi Zero W suddenly spikes. This causes the ChirpStack to consume almost all available RAM, making the device unresponsive. I am unable to access the Pi through SSH or any other means, requiring a physical restart.

Here are some details about my setup:

  • Device: Raspberry Pi Zero W
  • OS: ChirpStack Gateway OS (Version: v4.7.1)
  • Python Version: 3.11
  • MQTT Library Used: paho-mqtt
  • RAM Usage Before Running the Script: 50%
  • RAM Usage After Running the Script: 93%

Try to enable zram. It’s a long shot. You never loose something trying. In my setup - completely different from yours, you triple your available RAM.

I suppose your latency will drop. Maybe so much that will be catastrophic for LoRaWAN requirements.