rinho-serial 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/LICENSE.md +6 -6
  2. package/README.md +50 -47
  3. package/package.json +35 -35
  4. package/rinho.mjs +42 -42
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
- # License
2
-
3
- Copyright (c) Rinho Telematics.
4
-
5
- This package is free to use for configuring, troubleshooting and loading zones on Rinho GPS
6
- trackers. Redistribution of modified copies is not allowed. Provided as is, without warranty.
1
+ # License
2
+
3
+ Copyright (c) Rinho Telematics.
4
+
5
+ This package is free to use for configuring, troubleshooting and loading zones on Rinho GPS
6
+ trackers. Redistribution of modified copies is not allowed. Provided as is, without warranty.
package/README.md CHANGED
@@ -1,47 +1,50 @@
1
- # rinho-serial
2
-
3
- The `rinho` command-line tool that ships inside the [Rinho skills](https://config.rinho.com.ar/skills/index.html)
4
- for AI agents, packaged with the serial driver. It is the **same file** as `scripts/rinho.mjs` in
5
- the skills (same build id), plus `serialport` as a dependency, so an AI agent (or you) can talk to a
6
- Rinho GPS tracker (Zero IoT, Spider IoT, Smart IoT) over USB/serial without the configurator.
7
-
8
- ```bash
9
- npx -y rinho-serial ports # list serial ports (opens none)
10
- npx -y rinho-serial query COM4 QVR QCEL QBU # read-only queries
11
- npx -y rinho-serial send COM4 config.txt # send a validated configuration block
12
- npx -y rinho-serial run COM4 ">SSSXP0011<" ">SRL50D<" --confirmed # any command, as is
13
- npx -y rinho-serial zones load COM4 --url http://host/zones.bin
14
- npx -y rinho-serial validate config.txt --model zero --fw 1.09.28.T63
15
- ```
16
-
17
- Or install once: `npm install -g rinho-serial` and use `rinho-serial ...`.
18
-
19
- ## What `send` does, in this order
20
-
21
- 1. Refuses the block if it contains anything that is never sent by this tool: password, factory
22
- reset, firmware update, rule erasers (`SRL**D`), reboot, momentary actions (`SSS...`, `SGC...`),
23
- queue or log deletion.
24
- 2. Opens **only** the port you name (115200 8N1, DTR/RTS low so a board with auto-reset keeps
25
- running), asks `>QVR<` and reads the device id, model and firmware. With a password-protected
26
- device, set `RINHO_PASSWORD` in the environment: the tool logs in itself and never prints it.
27
- 3. Validates the block with the configurator's own interpreter **for that model and firmware**.
28
- One rejected line, or one line the firmware cannot run, and nothing is sent.
29
- 4. If a line drives a physical output (engine cut, siren, buzzer, relay), it stops and asks for
30
- `--outputs-confirmed`, which you should only pass after the user explicitly agreed.
31
- 5. Queries the current value of every resource the block touches and writes a backup file
32
- (`rinho-backup-<id>-<date>.txt`).
33
- 6. Sends one line at a time and waits for the device's answer. The first line without an answer
34
- or with an error stops the upload; the result says what was written and what was not.
35
- 7. Reads the touched resources back and reports before/after.
36
-
37
- `run` sends any command exactly as given (actions, rule erasers, output tests), one at a time,
38
- stopping at the first silent or erroring one. It refuses to run without `--confirmed`, and
39
- password, factory-reset and firmware commands also need `--unsafe`.
40
-
41
- Everything is logged to `rinho-send-<date>.log` in the current directory, with passwords
42
- (APN, Wialon, PW) masked. `query` only accepts `Q...` commands and refuses the ones that stream
43
- data or change state (`QBUS`, `QDL+`, `QWIFN`, `QPW`...).
44
-
45
- Output is JSON. Exit code 0 when everything answered, 1 otherwise, 2 for a usage error.
46
-
47
- Documentation: https://docs.rinho.com.ar · Configurator: https://config.rinho.com.ar
1
+ # rinho-serial
2
+
3
+ The `rinho` command-line tool that ships inside the [Rinho skills](https://config.rinho.com.ar/skills/index.html)
4
+ for AI agents, packaged with the serial driver. It is the **same file** as `scripts/rinho.mjs` in
5
+ the skills (same build id), plus `serialport` as a dependency, so an AI agent (or you) can talk to a
6
+ Rinho GPS tracker (Zero IoT, Spider IoT, Smart IoT) over USB/serial without the configurator.
7
+
8
+ ```bash
9
+ npx -y rinho-serial ports # list serial ports (opens none)
10
+ npx -y rinho-serial query COM4 QVR QCEL QBU # read-only queries
11
+ npx -y rinho-serial send COM4 config.txt # send a validated configuration block
12
+ npx -y rinho-serial run COM4 ">SSSXP0011<" ">SRL50D<" --confirmed # any command, as is
13
+ npx -y rinho-serial restore COM4 rinho-backup-<id>-<date>.txt --confirmed # undo a send
14
+ npx -y rinho-serial zones load COM4 --url http://host/zones.bin
15
+ npx -y rinho-serial validate config.txt --model zero --fw 1.09.28.T63
16
+ ```
17
+
18
+ Or install once: `npm install -g rinho-serial` and use `rinho-serial ...`.
19
+
20
+ ## What `send` does, in this order
21
+
22
+ 1. Refuses the block if it contains anything that is never sent by this tool: password, factory
23
+ reset, firmware update, rule erasers (`SRL**D`), reboot, momentary actions (`SSS...`, `SGC...`),
24
+ queue or log deletion.
25
+ 2. Opens **only** the port you name (115200 8N1, DTR/RTS low so a board with auto-reset keeps
26
+ running), asks `>QVR<` and reads the device id, model and firmware. With a password-protected
27
+ device, set `RINHO_PASSWORD` in the environment: the tool logs in itself and never prints it.
28
+ 3. Validates the block with the configurator's own interpreter **for that model and firmware**.
29
+ One rejected line, or one line the firmware cannot run, and nothing is sent.
30
+ 4. If a line drives a physical output (engine cut, siren, buzzer, relay), it stops and asks for
31
+ `--outputs-confirmed`, which you should only pass after the user explicitly agreed.
32
+ 5. Queries the current value of every resource the block touches and writes a backup file
33
+ (`rinho-backup-<id>-<date>.txt`).
34
+ 6. Sends one line at a time and waits for the device's answer. The first line without an answer
35
+ or with an error stops the upload; the result says what was written and what was not.
36
+ 7. Reads the touched resources back and reports before/after. The backup file is a ready-to-send
37
+ block (`>S…<` per resource, rules first): `restore` sends it back as it is, with the same
38
+ confirmation as `run`.
39
+
40
+ `run` sends any command exactly as given (actions, rule erasers, output tests), one at a time,
41
+ stopping at the first silent or erroring one. It refuses to run without `--confirmed`, and
42
+ password, factory-reset and firmware commands also need `--unsafe`.
43
+
44
+ Everything is logged to `rinho-send-<date>.log` in the current directory, with passwords
45
+ (APN, Wialon, PW) masked. `query` only accepts `Q...` commands and refuses the ones that stream
46
+ data or change state (`QBUS`, `QDL+`, `QWIFN`, `QPW`...).
47
+
48
+ Output is JSON. Exit code 0 when everything answered, 1 otherwise, 2 for a usage error.
49
+
50
+ Documentation: https://docs.rinho.com.ar · Configurator: https://config.rinho.com.ar
package/package.json CHANGED
@@ -1,35 +1,35 @@
1
- {
2
- "name": "rinho-serial",
3
- "version": "1.0.0",
4
- "description": "The rinho CLI of the Rinho skills (validate, explain, zones) plus the serial driver: read-only queries and validated configuration uploads to a Rinho GPS tracker (Zero, Spider, Smart) over USB/serial.",
5
- "license": "SEE LICENSE IN LICENSE.md",
6
- "author": "Rinho Telematics",
7
- "homepage": "https://config.rinho.com.ar/skills/index.html",
8
- "repository": {
9
- "type": "git",
10
- "url": "https://github.com/fernandorvs/rinho-skills"
11
- },
12
- "type": "module",
13
- "bin": {
14
- "rinho-serial": "./rinho.mjs"
15
- },
16
- "files": [
17
- "rinho.mjs",
18
- "README.md",
19
- "LICENSE.md"
20
- ],
21
- "engines": {
22
- "node": ">=18"
23
- },
24
- "keywords": [
25
- "rinho",
26
- "gps",
27
- "tracker",
28
- "serial",
29
- "telematics",
30
- "agent-skills"
31
- ],
32
- "dependencies": {
33
- "serialport": "^12.0.0"
34
- }
35
- }
1
+ {
2
+ "name": "rinho-serial",
3
+ "version": "1.0.1",
4
+ "description": "The rinho CLI of the Rinho skills (validate, explain, zones) plus the serial driver: read-only queries and validated configuration uploads to a Rinho GPS tracker (Zero, Spider, Smart) over USB/serial.",
5
+ "license": "SEE LICENSE IN LICENSE.md",
6
+ "author": "Rinho Telematics",
7
+ "homepage": "https://config.rinho.com.ar/skills/index.html",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/fernandorvs/rinho-skills.git"
11
+ },
12
+ "type": "module",
13
+ "bin": {
14
+ "rinho-serial": "rinho.mjs"
15
+ },
16
+ "files": [
17
+ "rinho.mjs",
18
+ "README.md",
19
+ "LICENSE.md"
20
+ ],
21
+ "engines": {
22
+ "node": ">=18"
23
+ },
24
+ "keywords": [
25
+ "rinho",
26
+ "gps",
27
+ "tracker",
28
+ "serial",
29
+ "telematics",
30
+ "agent-skills"
31
+ ],
32
+ "dependencies": {
33
+ "serialport": "^12.0.0"
34
+ }
35
+ }