Skip to content

Commit a36b72f

Browse files
committed
Documentation for the ModemManager-based wwan microservice
Completely rewritten documentation for the topic of cellular connectivity on EVE, reflecting the major rework of the wwan microservice and the transition from the shell script to using ModemManager. Signed-off-by: Milan Lenco <milan@zededa.com>
1 parent 5f793b5 commit a36b72f

File tree

15 files changed

+1475
-263
lines changed

15 files changed

+1475
-263
lines changed

docs/BUILD.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ The following custom packages are used:
399399
* `onboot` packages:
400400
* `lfedge/eve-rngd` - custom `lfedge/eve-rngd` package, rather than the standard linuxkit one. This micro-fork accommodates the [following hack](https://github.com/lf-edge/eve/blob/master/pkg/rngd/cmd/rngd/rng_linux_arm64.go) which provides some semblance of seeding randomness on ARM. Without this HiKey board won't boot.
401401
* `services` packages:
402-
* `lfedge/eve-wwan` - WWAN drivers and software. LTE/3G/2G. Mostly experimental.
402+
* `lfedge/eve-wwan` - WWAN drivers and software. 5G/LTE/3G/2G. See [wwan/README.md](../pkg/wwan/README.md) for detailed documentation.
403403
* `lfedge/eve-wlan` - WLAN drivers and software. Currently a glorified wrapper around wpa_supplicant.
404404
* `lfedge/eve-guacd` - [Apache Guacamole service](http://guacamole.apache.org/) that provides console and VDI services to running VMs and containers.
405405
* `lfedge/eve-zedctr` - a "catch-all" package for EVE tools; see below.

docs/CONFIG.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@ An example file with eth0 being static and eth1 using dhcp is:
184184
}
185185
```
186186

187-
To specify that wwan0 should be secondary (only used if eth0 can not be used to reach the controller), and eth1 only be if neither eth0 nor wwan0 works, one would set non-zero costs. For example,
187+
To specify that a cellular modem should be secondary (only used if eth0 can not be used to reach the controller),
188+
and eth1 only be used if neither eth0 nor the modem works, one would set non-zero costs. For example,
188189

189190
```json
190191
{
@@ -201,10 +202,23 @@ To specify that wwan0 should be secondary (only used if eth0 can not be used to
201202
{
202203
"Dhcp": 4,
203204
"Cost": 1,
204-
"IfName": "wwan0",
205+
"USBAddr": "1:1.4",
206+
"PCIAddr": "0000:01:00.0",
205207
"IsMgmt": true,
206-
"Name": "Management1"
207-
}
208+
"Name": "Management1",
209+
"WirelessCfg": {
210+
"WType": 1,
211+
"CellularV2": {
212+
"AccessPoints": [
213+
{
214+
"SIMSlot": 0,
215+
"Activated": true,
216+
"APN": "internet"
217+
}
218+
]
219+
}
220+
}
221+
},
208222
{
209223
"Dhcp": 4,
210224
"Cost": 2,

docs/DEVICE-CONNECTIVITY.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ When EVE is installed using a generic EVE installer without device bootstrap con
3333

3434
- DHCP is enabled on one of the Ethernet ports
3535
- WiFi is not assumed (since WiFi needs credentials)
36-
- If cellular connectivity is assumed, the default APN (`internet`) will work to connect to the network
36+
- Cellular connectivity is not assumed (without cellular config every discovered modem will have RF function disabled)
3737
- No enterprise proxy configuration is required to be able to connect to the controller.
3838

3939
If any of those assumptions is not satisfied, then it is necessary to either install EVE using a single-use EVE installer, shipped with the initial "bootstrap" configuration prepared for the target device (the preferred method) or to use one of the legacy mechanisms for off-line configuration management.
@@ -65,7 +65,7 @@ At least one port must be set to be a management port, and that port needs to re
6565

6666
### Last resort
6767

68-
If `network.fallback.any.eth` [configuration property](CONFIG-PROPERTIES.md) is set to `enabled` (by default it is disabled), then there is an additional lowest priority item in the list of DevicePortConfigs, called "Last resort" DPC (pubsub key `lastresort`), based on finding all of the Ethernet and Ethernet-like interfaces (an example of the latter is WiFi and cellular modems) which are not used exclusively by applications. The last resort configuration assumes DHCP and no enterprise proxies.
68+
If `network.fallback.any.eth` [configuration property](CONFIG-PROPERTIES.md) is set to `enabled` (by default it is disabled), then there is an additional lowest priority item in the list of DevicePortConfigs, called "Last resort" DPC (pubsub key `lastresort`), based on finding all Ethernet interfaces (i.e. excluding wireless connectivity options) which are not used exclusively by applications. The last resort configuration assumes DHCP and no enterprise proxies.
6969

7070
However, independent of the above property setting, if the device has no source of network configuration available (no bootstrap, override or persisted config), then EVE will use the Last resort *forcefully*. This, for example, happens when device boots for the very first time, without [bootstrap config](#bootstrap-configuration) or the (legacy) network config override being provided. In that case, device may remain stuck with no connectivity indefinitely (unless the user plugs in a USB stick with a network config later), therefore EVE will try to use Last resort to see if it can provide connectivity with the controller. Once device obtains a proper network config (from the controller or a USB stick), EVE will stop using Last resort forcefully and will keep this network config inside `DevicePortConfigList` only if and as long as it is enabled explicitly by the config (`network.fallback.any.eth` is `enabled`).
7171

@@ -189,7 +189,7 @@ with `eve verbose off`.
189189
### Connectivity-Related Logs
190190

191191
The progression and outcome of [network configuration testing](#testing) is logged with messages
192-
prefixed with `DPC verify:` (not that DPC is abbreviation for `DevicePortConfig`, which is a Go
192+
prefixed with `DPC verify:` (note that DPC is abbreviation for `DevicePortConfig`, which is a Go
193193
structure holding configuration for all management and app-shared interfaces). These messages
194194
can explain why a particular device is not using the latest configuration but instead has fallen
195195
back to a previous one. These logs are quite concise yet pack enough information to tell when
@@ -271,19 +271,20 @@ troubleshooting:
271271
Once device is onboarded, `DeviceUUID` field will be non-empty and contain the assigned
272272
device UUID (also printed to `/persist/status/uuid`).
273273

274-
Finally, the [wwan microservice](../pkg/wwan), managing the [cellular connectivity](./WIRELESS.md),
275-
is a shell script outside of the pillar container, not using pubsub for IPC. Instead, it exchanges
276-
wwan config, status and metrics with NIM simply by reading/writing files located under `/run/wwan`
277-
directory:
274+
For WWAN connectivity info, refer to these pubsub topics:
278275

279-
- `config.json` is published by NIM and may contain configuration for a cellular modem.
276+
- `/run/nim/WwanConfig/global.json` is published by NIM and contains configuration for cellular modems.
277+
- `/run/wwan/WwanStatus/global.json` is published by wwan microservice to inform zedagent, NIM
278+
and some other microservices about the current cellular connectivity status.
279+
- `/run/wwan/WwanMetrics/global.json` is published by wwan microservice and contains packet/byte
280+
counters reported by cellular modems (i.e. not from the Linux network stack)
280281

281-
- `status.json` and `metrics.json` are published by wwan microservice to inform NIM about the current
282-
cellular connectivity status and to publish packet/byte counters, respectively.
283-
284-
- `resolv.conf/<interface-name>.dhcp` contains the list of nameservers that should be used with
285-
a given wwan interface (published by wwan to NIM and further via `DeviceNetworkStatus` to other
286-
microservices, like downloader)
282+
Separately to pubsub topics, file `/run/wwan/resolv.conf/<interface-name>.dhcp` is updated
283+
by the wwan microservice and contain the list of nameservers that should be used with the given
284+
wwan interface. This is similar to how dhcpcd reports DNS servers for ethernet interfaces
285+
(for both DHCP and static IP config). In NIM, where this info is processed and further published
286+
via `DeviceNetworkStatus` pubsub topic, we can therefore process nameservers for ethernet
287+
and wwan interfaces in a very similar way and reuse some code.
287288

288289
### Netdump and Nettrace
289290

@@ -340,7 +341,7 @@ topic name with a publication timestamp plus the `.tgz` extension, for example:
340341
`downloader-fail-2023-01-03T14-25-04.tgz`, `nim-ok-2023-01-03T13-30-36`, etc.
341342

342343
Not all microservices that communicate over the network are traced and contribute with netdumps.
343-
Currently traced HTTP requests are:
344+
Currently, traced HTTP requests are:
344345

345346
- `/ping` request done by NIM to verify connectivity for the *latest* DPC (testing of older DPCs
346347
is never traced). Packet capture is also enabled and the obtained pcap files are included in

docs/ECO-METADATA.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ Standalone GPS receivers are currently not supported.
6161

6262
However, by default EVE does not use the location service of the LTE modem and the location
6363
information is therefore not available.
64-
To enable location reporting for the device, the `wwan*` adapter (corresponding to the LTE modem)
65-
must be **configured as port shared between applications and/or for device management** with
66-
**location tracking** enabled. When the modem is disabled or directly assigned to an application,
67-
EVE is not able to access the location service and obtain location information.
64+
To enable location reporting for the device, the cellular modem adapter must be **configured as port
65+
shared between applications and/or for device management** with **location tracking** enabled.
66+
When the modem is disabled or directly assigned to an application, EVE is not able to access
67+
the location service and obtain location information.
6868
In EVE API this is done by setting the field `NetworkConfig.wireless.cellularCfg.location_tracking`
6969
to `true`. For more details refer to [netconfig.proto](https://github.com/lf-edge/eve-api/tree/main/proto/config/netconfig.proto).
7070

@@ -112,6 +112,8 @@ Uncertainty and reliability fields describe how accurate the provided location i
112112
with single-precision floating-point values. Negative values are not valid and represent
113113
unavailable uncertainty.
114114
Reliability is one of: `not-set` (unavailable), `very-low`, `low`, `medium` and `high`.
115+
Note that Uncertainty and Reliability are no longer available in newer EVE versions
116+
(returned are zero values).
115117

116118
The frequency at which EVE updates location information is configurable using the option
117119
[timer.location.app.interval](../docs/CONFIG-PROPERTIES.md). By default, the interval is 20
@@ -206,7 +208,7 @@ curl 169.254.169.254/eve/v1/wwan/status.json 2>/dev/null | jq
206208
```
207209

208210
The underlying structure, used by EVE to store the information and output it as JSON,
209-
is named `WwanStatus` and can be found in [zedroutertypes.go](../pkg/pillar/types/zedroutertypes.go).
211+
is named `WwanStatus` and can be found in [wwan.go](../pkg/pillar/types/wwan.go).
210212

211213
The endpoint returns a list of entries, one for every cellular modem, with the modem's
212214
logical label (from the device model) used as a reference. The physical connection between
@@ -275,7 +277,7 @@ curl 169.254.169.254/eve/v1/wwan/metrics.json 2>/dev/null | jq
275277
```
276278

277279
The underlying structure, used by EVE to store the information and output it as JSON,
278-
is named `WwanMetrics` and can be found in [zedroutertypes.go](../pkg/pillar/types/zedroutertypes.go).
280+
is named `WwanMetrics` and can be found in [wwan.go](../pkg/pillar/types/wwan.go).
279281

280282
The endpoint returns a list of entries, one for every cellular modem, with the modem's
281283
logical label (from the device model) used as a reference. Just like in the

docs/EDGEVIEW-CONTAINER-API.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Edge-View Container and APIs
22

3-
EVE provides the Edge-View mainly for device and application troubleshooting tasks. It is a system-level container similar to `newlogd`, `wwan`, etc.
3+
EVE provides the Edge-View mainly for device and application troubleshooting tasks. It is a system-level container similar to `newlogd`, `wlan`, etc.
44

55
Edge-View as a service on EVE, it needs to receive/update user configurations from the controller; and it needs to send/update Edge-View running status to the controller.
66

7-
The software integration level of Edge-View is somewhere between the services like `newlogd` and `wwan`. `newlogd` is an integral part of the EVE, while `wwan` is a generic Linux service without any specific EVE related changes. The Edge-View container runs on the EVE device and has many tasks designed specifically for EVE device and application usage, but it can also run as a normal Linux docker container on any host; the same container is used for Edge-View client runs on the user's laptop. Thus design of Edge-View container tries to minimize the interaction with the rest of the EVE system while still being configured from the controller and sending status to the controller.
7+
The software integration level of Edge-View is somewhere between the services like `newlogd` and `wlan`. `newlogd` is an integral part of the EVE, while `wlan` is a generic Linux service without any specific EVE related changes. The Edge-View container runs on the EVE device and has many tasks designed specifically for EVE device and application usage, but it can also run as a normal Linux docker container on any host; the same container is used for Edge-View client runs on the user's laptop. Thus design of Edge-View container tries to minimize the interaction with the rest of the EVE system while still being configured from the controller and sending status to the controller.
88

99
This Wiki page describes the provisioning, security and status update for Edge-View in [Edge-View Doc](https://wiki.lfedge.org/display/EVE/Edge-View).
1010

docs/HARDWARE-MODEL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Starting from the generated model file and add or adjust:
6161
- Optionally, if the intended application pre-determined and e.g., eth1 will be connected to the shopfloor network, you can set the logicallabel field to "shopfloor". That makes it more clear in the UI the intended use of that port.
6262
- If the model file shows multiple USB controllers, then plug in e.g., a USB stick in each physical USB port and use ```lsusb``` and ```lspci``` to tell which controller to which port is connected.
6363
- If the device has multiple physical USB ports, please add a entry for each one of them in the json file (on the correct USB controller if there are multiple)
64-
- If you device has a cellular modem verify that there is one or two wwan interfaces in the generated file, and if not add one. If it is connected via a USB controller (```lsusb``` will tell you that) it needs to be in the same assignment group as the USB controller.
64+
- If your device has a cellular modem, verify that the PCI and USB addresses recognized by spec.sh are actually correct. The script will make sure that modem connected over USB bus will be in the same assignment group as the USB controller itself.
6565
- If some controllers have an empty assignment group there might be an issue with an unknown controller/function. The ```-v``` option to the script can be used to get more information about such unknown controllers/functions.
6666

6767
#### Check for unknown controllers/functions

0 commit comments

Comments
 (0)