> For the complete CircleCI developer hub index, see [llms.txt](https://circleci.com/developer/llms.txt)

# f0cal/farm

F0cal Farm Orb simplifies interactions with the F0cal device farm allowing you to  run your builds on a variety of edge compute  devices including the Raspberry Pi, Jetson Nano, and the Jetson TX1 and TX2 and many more.
To gain access to the F0cal device farm please visit https://www.f0cal.com
Orb source: https://github.com/f0cal/farm-orb


## Commands

### copy_files

Copy files needed for the build to the edge device


| Parameter | Type | Default | Description |
|---|---|---|---|
| `path` | string | * | The path for the files should be copied to the edge device. Recursive |

### f0cal_run

Run commands over on the edge device via ssh


| Parameter | Type | Default | Description |
|---|---|---|---|
| `command` | string | * | The command to run on edge device |

### install

Get the f0cal cli and other dependencies


### request_device

Use the f0cal cli to request an edge device and wait for it to be ready


| Parameter | Type | Default | Description |
|---|---|---|---|
| `device_type` | string |  | The type of the device, should be one of { nano, tx2, tx1, pi } |
| `ssh_key_name` | string |  | The name of the ssh key in f0cal. Should correspond to the private key env var set here. See docs for more info |

### setup

Setup F0cal CLI, VPN key, and  SSH keys


| Parameter | Type | Default | Description |
|---|---|---|---|
| `api_key` | string |  | Your f0cal api key |
| `ssh_key_fingerprint` | string |  | The fingerprint of the private key. This needs to first be added to the project in circle |

### stop_instance

Stop the current device listed in .f0cal_instance


## Jobs

### with_f0cal_device

Run steps on an edge device on the F0cal device farm


| Parameter | Type | Default | Description |
|---|---|---|---|
| `api_key` | env_var_name | F0CAL_API_KEY | Your f0cal api key. Populate via the F0CAL_API_KEY environment variable |
| `device_type` | string |  | The type of the device, should be one of {nano, tx2, tx1, raspi } |
| `path` | string | * | The path for the files should be copied to the edge device. Recursive |
| `ssh_key_fingerprint` | string |  | The fingerprint of the private key. This needs to first be added to the project in circle |
| `ssh_key_name` | string |  | The name of the ssh key in f0cal. Should correspond to the ssh key added to your project. See docs for more info |
| `steps` | steps |  | Build steps to run on the edge device. Use the  farm/f0cal_run command to run them on the edge device |

## Executors

### default

This is the executor that must get used with a f0cal job since we need a vpn at the moment


## Examples

### test_on-raspberry-pi

This sample shows how to use the F0cal orb to run a build and tests on a Raspberry PI


```yaml
orbs:
  farm: f0cal/farm@1.0.0
version: 2.1
workflows:
  build-test-deploy:
    jobs:
      - farm/with_f0cal_device:
          api_key: <YOUR F0CAL API KEY ENV VAR >
          device_type: raspi
          name: test_device
          ssh_key_fingerprint: <YOUR SSH_KEY FINGER PRINT>
          ssh_key_name: my_key_pair
          steps:
            - farm/f0cal_run:
                command: cmake .
            - farm/f0cal_run:
                command: make
            - farm/f0cal_run:
                command: ./bin/test
```