Skip to content

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
Juliana Mashon authored and Juliana Mashon committed Aug 6, 2024
1 parent 550574c commit f3d558f
Showing 1 changed file with 15 additions and 20 deletions.
35 changes: 15 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ python3 -m pip install paho-mqtt
```

## :seedling: Getting Started
Import `main.py` and create an instance of the Farmbot class:
```
from main.py import Farmbot
bot = Farmbot()
```

### Get your authentication token
To generate your authentication token and get started:
Expand All @@ -69,37 +64,40 @@ bot.get_token('email', 'password', 'server')
> Functions marked with [API] communicate with the Farm Designer web app via the [REST API](https://developer.farm.bot/v15/docs/web-app/rest-api.html) and those marked with [BROKER] communicate with the FarmBot via the [message broker](https://developer.farm.bot/v15/docs/message-broker).
| Authentication | Description |
| --- | --- |
| :--- | :--- |
| [API] `get_token()` | Generate user authentication token using your email and password. Server is https://my.farm.bot by default. |

| Publishing | Description |
| --- | --- |
| :--- | :--- |
| [API] `request()` | Send requests to the API using various methods. |
| [BROKER] `publish()` | Publish messages containing CeleryScript via the message broker. |

> [!CAUTION]
> Making requests other than `GET` to the API will permanently alter the data in your account. `DELETE` and `POST` requests may destroy data that cannot be recovered. Altering data through the API may cause account instability.
| Subscriptions | Description |
| --- | --- |
| :--- | :--- |
| [BROKER] `connect()` | Establish persistent connection with the message broker. |
| [BROKER] `disconnect()` | Disconnect from the message broker. |
| [BROKER] `start_listening()` | Establish persistent subscription to message broker channels. |
| [BROKER] `stop_listening()` | End subscription to all message broker channels. |

| Basic Commands | Description |
| --- | --- |
| :--- | :--- |
| [BROKER] `wait()` | Pauses execution for a certain number of milliseconds. |
| [BROKER] `e_stop()` | Emergency locks (E-stops) the Farmduino microcontroller and resets peripheral pins to OFF. |
| [BROKER] `unlock()` | Unlocks a locked (E-stopped) device. |
| [BROKER] `reboot()` | description |
| [BROKER] `shutdown()` | description |

| Camera | Description |
| --- | --- |
| :--- | :--- |
| [BROKER] `calibrate_camera()` | Performs camera calibration. This action will reset camera calibration settings. |
| [BROKER] `take_photo()` | Takes a photo using the device camera and uploads it to the web app. |
| [BROKER] `photo_grid()` | Returns metadata object about point grid required to perform a scan of the full garden. |

| Information | Description |
| --- | --- |
| :--- | :--- |
| [API] `get_info()` | Get information about a specific endpoint. |
| [API] `set_info()` | Change information contained within an endpoint. |
| [API] `safe_z()` | Returns the highest safe point along the z-axis. |
Expand All @@ -109,27 +107,24 @@ bot.get_token('email', 'password', 'server')
| [BROKER] `read_status()` | Returns the FarmBot status tree. |
| [BROKER] `read_sensor()` | description |

> [!CAUTION]
> Making requests other than `GET` to the API will permanently alter the data in your account. `DELETE` and `POST` requests may destroy data that cannot be recovered. Altering data through the API may cause account instability.
> [!NOTE]
> Not sure which endpoint to access? [Find the list here](https://developer.farm.bot/v15/docs/web-app/api-docs).
| Jobs | Description |
| --- | --- |
| :--- | :--- |
| [BROKER] `get_job()` | description |
| [BROKER] `set_job()` | description |
| [BROKER] `complete_job()` | description |

| Messages | Description |
| --- | --- |
| :--- | :--- |
| [API] `log()` | description |
| [BROKER] `message()` | description |
| [BROKER] `debug()` | description |
| [BROKER] `toast()` | description |

| Movement | Description |
| --- | --- |
| :--- | :--- |
| [BROKER] `move()` | description |
| [BROKER] `set_home()` | description |
| [BROKER] `find_home()` | description |
Expand All @@ -138,15 +133,15 @@ bot.get_token('email', 'password', 'server')
| [BROKER] `check_position()` | description |

| Peripherals | Description |
| --- | --- |
| :--- | :--- |
| [BROKER] `control_servo()` | description |
| [BROKER] `control_peripheral()` | description |
| [BROKER] `toggle_peripheral()` | description |
| [BROKER] `on()` | description |
| [BROKER] `off()` | description |

| Resources | Description |
| --- | --- |
| :--- | :--- |
| [BROKER] `mark_point()` | description |
| [BROKER] `sort_points()` | description |
| [BROKER] `sequence()` | description |
Expand All @@ -158,7 +153,7 @@ bot.get_token('email', 'password', 'server')
| [BROKER] `assertion()` | description |

| Tools | Description |
| --- | --- |
| :--- | :--- |
| [BROKER] `verify_tool()` | Verifies if a tool is mounted to the UTM. |
| [BROKER] `mount_tool()` | Mounts given tool and pulls it out of slot. |
| [BROKER] `dismount_tool()` | Dismounts currently mounted tool into assigned slot. |
Expand Down

0 comments on commit f3d558f

Please sign in to comment.