Mqtt connection problems

Hello,

I am using an mqtt connection to send commands to the farmbot with celeryscript. Everything worked fine yesterday when i left, but this morning i noticed that my farmbot wouldn’t receive any mqtt commands anymore. I also didn’t receive the subscribed messages back from the farmbot. ’

This is my current situation:

  • I can control the farmbot using the webapp
  • When connecting to the farmbot using mqtt (in python) i get result code 0, which should mean that there is a connection
  • My my client doesn’t disconnect, i programmed that a message would show up in the console on farmbotclient.on_disconnect
  • The backup i made a week earlier (which definitly worked) doesn’t work anymore

My guess is that this is a hardware related problem, but i’m not sure, does anyone know what the problem could be or what to look for?

Regards,
Niek

NiekN,

You might want to review this post: Switch to RabbitMQ Message Broker

R/

Mike

We recently switched message brokers. If you use token_data['token']['unencoded']['mqtt'] for the broker address in client.connect(), you should be able to communicate with FarmBot again.

Thanks for your reply,

I’m still not sure what to change when you say to use: token_data[‘token’][‘unencoded’][‘mqtt’] for the broker address in client.connect(). Do you have a small example on how to connect in python with the new RabbitMQ?

Regards, Niek

@NiekN

You would need to update line 50 of subscribe_example.py to look like this:

client.connect("brisk-bear.rmq.cloudamqp.com", 1883, 60)

The URL shown above (brisk-bear.rmq.cloudamqp.com) can be found by accessing the “MQTT” claim of your JSON Web Token.

EDIT: I have updated the Python examples to reflect the new MQTT server URL.