Do I first communicate with the Web API? Then the Web API talks with the Raspberry PI through MQTT? And then the Raspberry PI control the FarmBot? Or could I directly communicate with the Raspberry PI through MQTT from my software?
I’ve written a common use case document here which covers these use cases.
If you want to store or manage device data, use the REST API.
If you want to directly control the bot, use the MQTT message broker
I’m happy to clarify (or update the documentation) if you are still having trouble deciding.
For your application, you would most likely need to:
Import a C++ MQTT library
rpc_request to the device over the
rpc_error responses on the
Examples (written in Python) can be found here.
Is there a library I can use to accomplish this?
There is currently no C++ library available, so you will need to handle MQTT connections manually. As you have mentioned, there is FarmbotJS and also Farmware Tools (Python).
I found information here and there, such as CeleryScript, and Farmbot JS, However, I could not put everything into one piece solution yet.
The docs serve as a guide (rather than an API reference or reference manual). The best way to read it is to start from the begining and read the topics in order. They are still very much a work in progress though- if you are still having issues understanding the material, let me know. I am happy to help with whatever questions you have.