You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Serial protocol for the KISS modem firmware. Enables sending/receiving MeshCore packets over LoRa and cryptographic operations using the modem's identity.
3
+
Standard KISS TNC firmware for MeshCore LoRa radios. Compatible with any KISS client (Direwolf, APRSdroid, YAAC, etc.) for sending and receiving raw packets. MeshCore-specific extensions (cryptography, radio configuration, telemetry) are available through the standard SetHardware (0x06) command.
4
4
5
5
## Serial Configuration
6
6
7
7
115200 baud, 8N1, no flow control.
8
8
9
9
## Frame Format
10
10
11
-
Standard KISS framing with byte stuffing.
11
+
Standard KISS framing per the KA9Q/K3MC specification.
12
12
13
13
| Byte | Name | Description |
14
14
|------|------|-------------|
@@ -18,89 +18,146 @@ Standard KISS framing with byte stuffing.
| SetHardware |`0x06`| Sub-command + data | MeshCore extensions (see below) |
51
+
| Return |`0xFF`| - | Exit KISS mode (no-op) |
52
+
53
+
### TNC to Host
54
+
55
+
| Type | Value | Data | Description |
56
+
|------|-------|------|-------------|
57
+
| Data |`0x00`| Raw packet | Received packet from radio |
58
+
59
+
Data frames carry raw packet data only, with no metadata prepended.
60
+
61
+
### CSMA Behavior
62
+
63
+
The TNC implements p-persistent CSMA for half-duplex operation:
64
+
65
+
1. When a packet is queued, monitor carrier detect
66
+
2. When the channel clears, generate a random value 0-255
67
+
3. If the value is less than or equal to P (Persistence), wait TXDELAY then transmit
68
+
4. Otherwise, wait SlotTime and repeat from step 1
69
+
70
+
In full-duplex mode, CSMA is bypassed and packets transmit after TXDELAY.
71
+
72
+
## SetHardware Extensions (0x06)
73
+
74
+
MeshCore-specific functionality uses the standard KISS SetHardware command. The first byte of SetHardware data is a sub-command. Standard KISS clients ignore these frames.
| Verify |`0x23`| Result (1): 0x00=invalid, 0x01=valid |
118
+
| Signature |`0x24`| Signature (64) |
119
+
| Encrypted |`0x25`| MAC (2) + Ciphertext |
120
+
| Decrypted |`0x26`| Plaintext |
121
+
| SharedSecret |`0x27`| Shared secret (32) |
122
+
| Hash |`0x28`| SHA-256 hash (32) |
123
+
| OK |`0x29`| - |
124
+
| Radio |`0x2A`| Freq (4) + BW (4) + SF (1) + CR (1) |
125
+
| TxPower |`0x2B`| Power dBm (1) |
126
+
| Version |`0x2D`| Version (1) + Reserved (1) |
127
+
| Error |`0x2E`| Error code (1) |
128
+
| TxDone |`0x2F`| Result (1): 0x00=failed, 0x01=success |
129
+
| CurrentRssi |`0x30`| RSSI dBm (1, signed) |
130
+
| ChannelBusy |`0x31`| Result (1): 0x00=clear, 0x01=busy |
131
+
| Airtime |`0x32`| Milliseconds (4) |
132
+
| NoiseFloor |`0x33`| dBm (2, signed) |
133
+
| Stats |`0x34`| RX (4) + TX (4) + Errors (4) |
134
+
| Battery |`0x35`| Millivolts (2) |
135
+
| Pong |`0x36`| - |
136
+
| Sensors |`0x37`| CayenneLPP payload |
137
+
| RxMeta |`0x38`| SNR (1) + RSSI (1) |
138
+
139
+
### Error Codes
90
140
91
141
| Code | Value | Description |
92
142
|------|-------|-------------|
93
-
|`ERR_INVALID_LENGTH`|`0x01`| Request data too short |
94
-
|`ERR_INVALID_PARAM`|`0x02`| Invalid parameter value |
95
-
|`ERR_NO_CALLBACK`|`0x03`| Feature not available |
96
-
|`ERR_MAC_FAILED`|`0x04`| MAC verification failed |
97
-
|`ERR_UNKNOWN_CMD`|`0x05`| Unknown command |
98
-
|`ERR_ENCRYPT_FAILED`|`0x06`| Encryption failed |
99
-
|`ERR_TX_PENDING`|`0x07`| TX already pending |
143
+
| InvalidLength |`0x01`| Request data too short |
144
+
| InvalidParam |`0x02`| Invalid parameter value |
145
+
| NoCallback |`0x03`| Feature not available |
146
+
| MacFailed |`0x04`| MAC verification failed |
147
+
| UnknownCmd |`0x05`| Unknown sub-command |
148
+
| EncryptFailed |`0x06`| Encryption failed |
149
+
150
+
### Unsolicited Events
151
+
152
+
The TNC sends these SetHardware frames without a preceding request:
153
+
154
+
**TxDone (0x2F)**: Sent after a packet has been transmitted. Contains a single byte: 0x01 for success, 0x00 for failure.
155
+
156
+
**RxMeta (0x38)**: Sent immediately after each standard data frame (type 0x00) with metadata for the received packet. Contains SNR (1 byte, signed, value x4 for 0.25 dB precision) followed by RSSI (1 byte, signed, dBm). Standard KISS clients ignore this frame.
100
157
101
158
## Data Formats
102
159
103
-
### Radio Parameters (CMD_SET_RADIO / RESP_RADIO)
160
+
### Radio Parameters (SetRadio / Radio response)
104
161
105
162
All values little-endian.
106
163
@@ -111,35 +168,17 @@ All values little-endian.
111
168
| SF | 1 byte | Spreading factor (5-12) |
112
169
| CR | 1 byte | Coding rate (5-8) |
113
170
114
-
### Received Packet (CMD_DATA response)
115
-
116
-
| Field | Size | Description |
117
-
|-------|------|-------------|
118
-
| SNR | 1 byte | Signal-to-noise × 4, signed |
119
-
| RSSI | 1 byte | Signal strength dBm, signed |
120
-
| Packet | variable | Raw MeshCore packet |
121
-
122
-
### Noise Floor (RESP_NOISE_FLOOR)
123
-
124
-
Response to `CMD_GET_NOISE_FLOOR` (0x13). Little-endian.
0 commit comments