-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ed76a5e
commit 85184d5
Showing
2 changed files
with
33 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,4 @@ | |
# vendor/ | ||
|
||
wifi | ||
module.tar.gz | ||
*.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,40 @@ | ||
# 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 | ||
A Viam sensor implementation that reads the system's wifi information. This is an example repo to show how to: | ||
1. Make a Viam module with Go | ||
1. Build it in CI and upload to the registry | ||
|
||
## Running this with local exec | ||
|
||
For iterative development, you can run a module locally (laptop or robot) and test it using a local instance of the RDK. | ||
|
||
Create the binary with `make wifi`. | ||
|
||
Your config will look something like this: | ||
|
||
```json | ||
{ | ||
"modules": [{ | ||
"executable_path": "/path/to/project/wifi", | ||
"name": "wifisensor" | ||
}], | ||
"components": [{ | ||
"name": "wifi", | ||
"type": "sensor", | ||
"model": "viam-labs:sensor:linux-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). | ||
Our docs for running local modules are [here](https://docs.viam.com/extend/modular-resources/configure/#local-modules). | ||
|
||
### 2. Add to robot configuration | ||
## What's in this repo | ||
|
||
Copy the binary to the robot (system where viam-server is running) and add the following to your configuration: | ||
- .github/workflows: CI and deploy logic | ||
- Makefile: instructions for building the binary and bundling it into a tarball | ||
- \*.go: the implementation | ||
- meta.json: module configuration file | ||
|
||
``` | ||
... | ||
"modules": [ | ||
..., | ||
{ | ||
"executable_path": "<path_to_binary>", | ||
"name": "wifisensor" | ||
}, | ||
..., | ||
], | ||
"components": [ | ||
..., | ||
{ | ||
"name": "wifi", | ||
"type": "sensor", | ||
"model": "viam-labs:sensor:linux-wifi" | ||
}, | ||
..., | ||
], | ||
... | ||
``` | ||
## Forking this repo | ||
|
||
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). | ||
If you fork this and want to deploy to the registry, you'll need to update namespaces and CI secrets. Full fork instructions are in the [Python module example](https://github.com/viam-labs/python-example-module#forking-this-repo). |