Python – Google Cloud IoT Python MQTT “out of memory” error

Google Cloud IoT Python MQTT “out of memory” error… here is a solution to the problem.

Google Cloud IoT Python MQTT “out of memory” error

I find Google Cloud IoT hard to track bugs. I set up 2 IoT API-enabled projects. I used the same Quick Start instructions for testing by setting up My Registry and My Device. We call them Projects A and B. Then I run the python and node examples pulled directly from git. The node example works well for both projects A and B, using gcloud for pull validation. However, the Python example works for Project A, but Project B appears “When disconnected. 1. Out of memory” error. B never has a “connection accepted” message, but A is. “Out of memory” seems to be a general error and not really a problem. It can represent various problems in the connection. Nothing on the server side Has anyone come across this before? Thanks for any help with fixing or at least tracking down the bug.

Solution

It turned out to be the Python version. Debugging is almost impossible. I ended up trying on many different devices/OS to slowly isolate the issue. It looks like the newly created project relies on newer versions of the Google Cloud SDK and Python. Must have Python 2.7.14.

Related Problems and Solutions