You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 9, 2019. It is now read-only.
Copy file name to clipboardExpand all lines: readme.md
+8-7
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# PLEASE READ
2
2
3
-
You might not need to install this software. This software is used by the FarmBot team and advanced users who run their own FarmBot servers. We highly recommend that you use our publicly hosted server at [my.farmbot.io](http://my.farmbot.io), which elimintes the need for server setup.
3
+
You might not need to install this software. This software is used by the FarmBot team and advanced users who run their own FarmBot servers. We highly recommend that you use our publicly hosted server at [my.farmbot.io](http://my.farmbot.io), which eliminates the need for server setup.
4
4
5
5
# How It Works
6
6
@@ -9,23 +9,24 @@ Farmbot uses [MQTT](https://en.wikipedia.org/wiki/MQTT) for realtime events. On
9
9
## Our MQTT Implementation
10
10
11
11
* Log in to the broker using the same email as on the web app. A JSON Web Token from the API can be used as a password.
12
-
* Messages are sent using [JSON RPC](https://en.wikipedia.org/wiki/JSON-RPC).
12
+
* Messages are sent using [Celery Script](https://github.com/RickCarlino/farmbot-js/blob/master/src/corpus.ts), which is a domain-specific JSON format used to send messages (and sequences) to FarmBot. If you would like documentation or specifics, please let me know via an issue. CeleryScript transmission is usually handled by [FarmBotJS](https://github.com/FarmBot/farmbot-js), a wrapper library that eliminates the need to write Celery Script directly.
13
13
14
14
## Available MQTT Topics
15
-
16
15
*`bot/device_{ BOT_ID }/from_clients`: Commands originated from browsers and clients.
17
16
*`bot/device_{ BOT_ID }/from_device`: This is where the bot publishes messages.
17
+
*`bot/${uuid}/status`: Everytime bot state changes (Eg: a pin is flipped, movement, etc.) a JSON representation of the bot status is sent.
18
+
*`bot/${uuid}/logs`: General log messages. The same ones seen on the nav bar of the FarmBot Web App.
18
19
19
-
Subscribing to `bot/{ BOT_UUID }/*` via 3rd party MQTT client (Such as [MQTT FX](http://mqttfx.jfx4ee.org/index.php/download)) is useful for debugging and monitoring.
20
+
Subscribing to `bot/{ BOT_UUID }/*` via 3rd party MQTT client (Such as [MQTT FX](http://www.mqttfx.org/)) is useful for debugging and monitoring.
20
21
21
22
# Installation
22
23
23
24
1. git clone THIS_REPO
24
25
2. cd THIS_REPO
25
26
3. npm install
26
27
4. Setup and run the [Web API](https://github.com/FarmBot/Farmbot-Web-API) locally. We recommend running it on `http://localhost:3000`
27
-
5.`WEB_API_URL=http://localhost:3000 node app/index.js`. See note below*.
28
-
6. Websocket MQTT is now available via `ws://localhost:3002` and `wss://localhost:443`. Raw MQTT (TCP connections) are available via `mqtt://localhost:1883`.
28
+
5.`WEB_API_URL=http://localhost:3000 npm start`. See note below*.
29
+
6. Websocket MQTT is now available via `ws://localhost:3002` and `wss://localhost:443`. Raw MQTT (TCP connections) are available via `mqtt://localhost:1883`.
29
30
30
31
\* The assumption is that you are running a [Web API](https://github.com/FarmBot/Farmbot-Web-API) instance on `localhost:3000`. If you are using a different API server, please change `WEB_API_URL` accordingly.
0 commit comments