From ac46778a85a5607c96c4326f6dc57fccec0a7f39 Mon Sep 17 00:00:00 2001 From: maximpertsov Date: Tue, 21 Mar 2023 15:10:46 -0400 Subject: [PATCH] RSDK-2062 Document build and run steps (#2) Co-authored-by: James Otting --- README.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/README.md b/README.md index 6fb86ac..594e0f7 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,43 @@ # wifi-sensor + A sensor that detects wifi strength + +## Usage + +### 1. Build binary + +If you clone this repository to the target environment where you run your Viam robot, then you can build a binary named `wifi` with: + +``` +go build -o wifi +``` + +Alternatively, if you want to build a binary for a different target environment, please use the [viam canon tool](https://github.com/viamrobotics/canon). + +### 2. Add to robot configuration + +Copy the binary to the robot (system where viam-server is running) and add the following to your configuration: + +``` + ... + "modules": [ + ..., + { + "executable_path": "", + "name": "wifisensor" + }, + ..., + ], + "components": [ + ..., + { + "name": "wifi", + "type": "sensor", + "model": "viam-labs:sensor:linux-wifi" + }, + ..., + ], + ... +``` + +For more information on how to configure modular components, [see this example](https://docs.viam.com/services/slam/run-slam-cartographer/#step-1-add-your-rdiplar-as-a-modular-component).