MQTT ACCESS DENIED Device is rate limited

This is on https://my.farmbot.io/ not my local dev instance, although I think restarting my dev instance too many times trying to solve a NervesHub error may have triggered the rate limiting from the FBOS as it tried to access NervesHub.

Could someone please remove the rate limit and I try to refrain from the restarts?

1 Like

@whitecaps I’ve de-rate-limited your account. If you are rate limited on NervesHub, that is not something I have control of unfortunately- is that the case? Please let me know and I can contact the NervesHub folks about it.

1 Like

I am getting the same error: MQTT ACCESS DENIED Device is rate limited device_10735

This happened when I was using the JS API to send commands.

Is this a safety feature for the hardware?
What are the risks of de-rate-limiting my account?
Also could I re-enable it after I finish testing with API?
Do I enable it from my side? or from your end only?

Thanks.

1 Like

@Jack

That’s a safety feature for the webserver. It is controlled by FarmBot, Inc. to prevent denial of service attacks by malicious users. In the past, some power users tried some things that resulted in poor server performance for all other users. We’ve unfortunately had to add this protection for real-world, non-speculative reasons. If you see this when writing custom FarmBot software, it can be a sign you have chosen the wrong architecture. I can take a look at a code snippet if you have one, but it generally happens inside of loops (eg: trying to create a FarmBot instance 1,000 times inside a loop that has no pauses).

I can remove the rate limit from your account this one time. For future reference, the following actions will trigger a rate limit:

  • Your device has some sort of problem (hardware, bad configuration, low network quality, etc…) that is causing it to send error rates beyond the allowed rate limit. I am happy to help you solve this problem if you think that’s the case. Since you mentioned you are using FBJS, this is less likely.
  • Logging in too many times, even if you have a correct username/password. The reasons for this one are complicated, but you should try to keep your MQTT sessions stable.
  • You have low WiFi quality, so the MQTT client continually re-connects to the server.
  • You are sending too many send_message commands (common).
  • You are sending an abnormally high number of requests (like read_status), usually inside of a loop or via recursion. Limits will be described below.
  • You are hitting the /sync HTTP endpoint too often.

The rules that will trigger a rate limit will vary, but generally speaking, they will trigger under the following circumstances:

  • 60 MQTT messages per min
  • 3600 MQTT messages per hour
  • 86400 MQTT messages per day

If your device violates the “one minute” rule, it will be unthrottled on the next minute.
If it violates the “one hour” rule, it will be unthrottled at the top of the next hour, etc…

Please let me know if you need help identifying the source of the rate limiting.

4 Likes

@Jack It looks like your device already unthrottled itself.

2 Likes