Skip to content

Commit

Permalink
Merge pull request #20 from Pinoccio/release-wip
Browse files Browse the repository at this point in the history
2014102701
  • Loading branch information
jingman committed Oct 27, 2014
2 parents cf8c1e1 + 9d575a8 commit 3a77311
Showing 1 changed file with 187 additions and 0 deletions.
187 changes: 187 additions & 0 deletions ScoutCommands.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,24 @@ Set the mesh radio settings for this scout. You can set the unique ID of the sco
#### Return Values
None

## mesh.setchannel
#### Description
`mesh.setchannel(channelId)`

Set the mesh radio channel for this Scout.

**Important:** You'll want all the Scouts in your Troop to change to this new channel as well, so the practical usage should be `command.all("mesh.setchannel",26)`.

```bash
> mesh.channel(26)
```

#### Parameters
- *channel* - The 802.15.4 channel for this troop. Valid range is 11 to 26. All scouts in a troop must be on the same channel. Default is **20**.

#### Return Values
None

## mesh.setpower
#### Description
`mesh.setpower(powerLevel)`
Expand Down Expand Up @@ -444,6 +462,62 @@ A JSON representation of the current state of mesh networking for the Scout.
- *power* - The radio power setting this Scout is currently set to.
- *at* - The milliseconds since restart at which this report was run

## mesh.from
#### Description
`mesh.from`

Returns the scout id that last commanded this scout (useful to auto-generate replies).

```bash
> mesh.from
```

#### Parameters
None

#### Return Values
- *fromId* - id of the Scout that last commanded this Scout.

```bash
> 42
```

## mesh.each
#### Description
`mesh.each("command")`

Runs `command(id,lqi,via)` for every other Scout currently visible on the mesh (as seen with `mesh.routing`).

```bash
> mesh.each("for.each.do.this")
```

#### Parameters
- *command* - the command that will be called with the `id`, `lqi`, and `via` of each Scout in the routing table.

#### Return Values
None

```bash
// runs for.each.do.this(id,lqi,via) for each Scout in the routing table
```
## mesh.fieldtest
#### Description
`mesh.fieldtest(seconds)`
Turns on a fieldtest mode that runs a constant mesh ping for this many seconds, the scout running the fieldtest will turn red for no mesh, yellow for weak mesh, and blink green for good mesh, and every other scout it is meshed with will blink blue
```bash
> mesh.fieldtest(30)
```
#### Parameters
- *seconds* - The number of seconds to stay in test mode.
#### Return Values
None
## mesh.routing
#### Description
Expand Down Expand Up @@ -541,6 +615,25 @@ This is the same as `command.scout`, except that once the command is run on the
- *arg1*, *arg2* - One or more arguments to pass to the *command* before remote evaluation. If the argument is not quoted, it will be added as an integer argument to the command. If it is quoted, it will be added as a string argument to the command. If it is quoted and backticked, it will be evaluated locally, and the result of that evaluation will be added as a string argument to the command.
#### Return Values
1 if the command is successfully sent, 0 otherwise
## command.group
#### Description
``command.group(groupId, "command"[, arg1, "arg2", "`arg3`", ...])``
Run a command on Scouts in group `groupId`. The command can take a variable number of arguments, and those arguments are also passed to the command to build the full command string, before being sent to the other Scouts.
```bash
> command.group(42, "led.sethex", "`led.gethex`")
```
#### Parameters
- *groupId* - The ID of the group of Scouts on which you want to run the command.
- *command* - The string of the command you want to run
- *arg1*, *arg2* - One or more arguments to pass to the *command* before remote evaluation. If the argument is not quoted, it will be added as an integer argument to the command. If it is quoted, it will be added as a string argument to the command. If it is quoted and backticked, it will be evaluated locally, and the result of that evaluation will be added as a string argument to the command.
#### Return Values
1 if the command is successfully sent, 0 otherwise
Expand Down Expand Up @@ -1592,6 +1685,27 @@ the value string must be less than or equal to 80 chars.
#### Return Values
None
## hq.online
#### Description
`hq.online`
Returns 1 or 0 if HQ has been seen recently on the mesh.
```bash
> hq.online
```
#### Parameters
None
#### Return Values
```bash
1
```
- *value* - 1 if HQ has been seen, 0 if it hasn't.
# miscellaneous
## temperature.c
Expand Down Expand Up @@ -2024,8 +2138,41 @@ This callback will be executed any time the temperature value changes.
#### Return Values
None
## on.hq.online
#### Description
`on.hq.online`
This callback will be executed on every Scout in the Troop whenever the Lead Scout connects to HQ.
```bash
> function on.hq.online {
led.red(500);
};
```
#### Parameters
None
#### Return Values
None
## on.wifi.associate
#### Description
`on.wifi.associate`
This callback will be executed when a WiFi backpack associates with a network.
```bash
> function on.wifi.associate {
led.cyan(500);
};
```
#### Parameters
None
#### Return Values
None
# lead scout
Expand Down Expand Up @@ -2091,6 +2238,28 @@ CID TYPE MODE LOCAL PORT REMOTE PORT REMOTE IP
1 TCP-SSL CLIENT 48838 22757 173.255.220.185
```
## wifi.stats
#### Description
`wifi.stats`
Print stats about the number of reconnections to WiFi and/or HQ.
```bash
> wifi.stats
```
#### Parameters
None
#### Return Values
Stats about reconnections.
```
Number of connections to AP since boot: 2
Number of connections to HQ since boot: 1
Seconds currently connected to HQ: 42
```
## wifi.list
#### Description
`wifi.list()`
Expand Down Expand Up @@ -2217,6 +2386,24 @@ S2W GEPS VERSION=2.5.1
S2W WLAN VERSION=2.5.1
```
## wifi.setverbose
#### Description
`wifi.setverbose(value)`
By default, only errors are logged. By running `wifi.verbose(1)`, all data sent to and received from the wifi module is logged.
Logging only happens to Serial, since it is a bad idea to log data to HQ (which goes through wifi, causing more log output, causing more traffic, etc.).
```bash
> wifi.setverbose(1)
```
#### Parameters
- *value* - 1 to enable, 0 to disable
#### Return Values
None
<!--
## wifi.gettime
#### Description
Expand Down

0 comments on commit 3a77311

Please sign in to comment.