Monitoring network
From firmware 1.3.16 (UBX data from 1.3.18) · Radio: ESP-Now radio
Several MS2net reference stations can watch a site that may move: the flank of a landslide, a retaining wall, a bridge, the buildings next to a building site. On each point to watch a station is fixed that works as a rover: it measures its own position in RTK continuously, day and night, and records it on its microSD card. Comparing the positions over hours, days and weeks shows whether a point has moved, by how much and when.
To measure in RTK each rover needs the corrections of a source: a base standing on stable ground, or a gateway that takes them from an NTRIP caster. The corrections reach all of them over the ESP-Now radio, with no router, no cables between the points and no SIM card per station. Where the radio does not reach, a rover also works as a relay.
This page explains what happens inside the network: how the data travel, how the stations keep an eye on each other, what the network does when a station goes off and how the data of each station reach a collector. The fields of the configuration page are described in ESP-Now radio.
How the data travel
Figure 1 — Corrections from the source to the rovers
In the first half of the animation the source is the base, in the second half a gateway; in a real network one source at a time sends.
- The source prepares the corrections. The base computes them from its GNSS module, on its fixed coordinates; the gateway receives them from the caster through its WiFi.
- It cuts them into numbered packets. Each packet, at most 250 bytes long, carries the corrections, a sequence number that grows by one with each packet and a check computed on the content. With the factory rates one group of packets leaves every second.
- It sends each packet twice, a few milliseconds apart, to every station in range. The radio does not confirm reception: the second copy covers a packet lost to interference.
- Each rover keeps the first copy and drops the second, recognising it by its number. A packet with a wrong check is dropped. The good corrections go as they are to the rover's GNSS module, which uses them to reach RTK fix.
- Each rover records its own position on its microSD card. The measurements stay there: the radio carries the corrections towards the rovers and the status lines described below; the GNSS data of a station go towards a centre only if you ask for it, with a collector. The files are collected from each station with the File Manager.
All the stations must be on the same radio channel. The source sends on the channel of its WiFi network, if it has one; the rovers keep WiFi off and find the channel by themselves, listening in turn to channels 1 to 13 for 2 seconds each (about 26 s in all). With a network key every packet is signed, and a station accepts only packets signed with its own key: two networks nearby do not mix. The packets are not encrypted. The details are in ESP-Now radio › Packets and network key.
The stations say who they are
Figure 2 — Telemetry: every station every 2 s
Every 2 seconds each station, base or rover, sends all the others a short status line:
- its ID, the last four digits of its radio address (for example
173E), the same as in its Bluetooth name and on the display; - its role: base, gateway, relay or rover. A station announces itself as base, gateway or relay only while it has corrections to give: a base still surveying in, or a relay that receives nothing, announces itself as a rover and draws nobody;
- how long it has been on, its free memory and its firmware version;
- on a rover, the relay it asks for corrections, or none;
- from firmware 1.3.18, its position (latitude, longitude, height) and its solution: 3D, RTK float or RTK fix.
Each station keeps the lines it hears in a table, with the signal of each and the seconds since
the last one. This table is what lets the network reorganise itself, and it is the same one you
read to check it: live in the serial menu r, or in the configuration page, which shows the
stations heard in the minute before entering configuration (ESP-Now is off in configuration).
The columns are described in
ESP-Now radio › Stations heard.
How it reorganises itself
No station commands the others, and nothing has to be set station by station: each one decides by itself from its own table and from the flow of corrections. This is what happens in the three cases that matter.
A rover cannot hear the source
Figure 3 — A rover asks the relay
- Every 5 seconds the rover checks the source: how many packets it heard and how many numbers are missing. If it did not hear it at all, or lost more than one packet in five, it needs help.
- In its status line it asks the relay it hears best among those with corrections to give (asks 9C04 in the animation).
- The relay reads the request and starts repeating: every new packet it receives it sends again, identical, with the same number, twice. Each request holds for 15 seconds, and the rover renews it with every line, that is every 2 s: the bar under the relay fills up at each request.
- When the rover hears the source well again, it stops asking; 15 s after the last request the relay stops repeating, and the radio stays free.
A relay that does not hear the source well asks another relay in turn, so the corrections make several hops when needed. The packets never go round in circles: every station recognises by its number a packet it already has, whoever sends it, and drops it. A relay that hears no rover with firmware 1.3.16 or later always repeats, to serve the older rovers that cannot ask.
A relay fails
Figure 4 — A relay fails: the rover moves to the other
The clock at the top right shows the network's time: the long waits pass quickly.
- The relay in use goes off (flat battery, fault, a knock): the corrections stop reaching the rover, and its status lines stop reaching everybody.
- After 3 seconds without corrections the rover goes back to searching the channel, 1 to 13, for about 26 seconds: it does not know whether the problem is the relay or the channel.
- At the end of the search it settles on the channel where it heard the source or a relay with corrections, and asks the relay it hears best. The one that went off is no longer a candidate: a station silent for 15 s is not chosen any more.
- The new relay starts repeating and the rover is back in RTK fix in about half a minute from the failure.
If no other relay is in range, the rover keeps searching the channel until it hears the source or a relay again. Meanwhile it has no corrections: it keeps recording, but the positions are not in RTK fix. When the relay comes back on, the rover finds it by itself.
The gateway fails
Figure 5 — The gateway fails: the spare takes over
Two or more gateways can be placed, one sending and the others as spares.
- With several gateways only the one with the lowest ID sends. The others still receive the caster and use it for themselves (they are rovers too and measure their own point), but as long as they hear the one with the lowest ID sending they stay quiet.
- The gateway sending goes off, or loses the Internet or the caster: its corrections stop.
- The spare counts the silence. After 15 seconds without hearing it, the gateway with the lowest ID among those left starts sending the corrections of its caster.
- Meanwhile the rovers, after 3 s without corrections, search the channel; they find the new source and are back in RTK fix between half a minute and a minute after the failure, depending on the channel.
A gateway also stays quiet while it hears the corrections of a base: with a base and a gateway, the gateway is the base's spare and takes over 15 s after the base stops. A base still surveying in sends no corrections and silences nobody. For all this to work the gateways must hear each other: same WiFi network (so the same channel) and within radio range of each other.
If another station fails
| What happens | What the network does |
|---|---|
| a rover goes off | Nothing changes for the other stations. It leaves the tables after a minute of silence; its microSD card keeps what it recorded until then. |
| the base goes off | The rovers are left without corrections and search the channel. With a spare gateway, it starts sending 15 s later; without one, the rovers wait for the base to come back and then resume by themselves. |
| the gateway loses the Internet | With no data from the caster it sends no more corrections: for the rovers it is as if it were off, and a spare gateway with its own connection takes over after 15 s. |
| the power comes back | Each station restarts in its Startup Mode and rejoins the network by itself: the rovers find the channel again, the relays answer the requests again. |
| a station in the serial menu | While the serial menu is open the station sends no status lines. A relay left in the menu for more than 15 s is not chosen any more: read what you need and leave. |
| a station in configuration | ESP-Now is off in configuration: a relay in configuration does not repeat, and the rovers that depend on it have no corrections until it is back in rover. |
Data of every station to a collector
From firmware 1.3.18
Figure 6 — The rovers' UBX data to the collector
Every station already records its own position on its microSD card. From firmware 1.3.18 it can also send its GNSS data, over ESP-Now, to a station that works as a collector and saves them all on its microSD card: to get the data of the whole site you only need to visit one station.
- Each station that sends has Send UBX over ESP-Now on. It puts into packets the NAV-PVT (position), RXM-RAWX (raw measurements) and RXM-SFRBX (satellite navigation data) messages its GNSS module puts out: only those switched on in Message Rates, at their rate.
- Each packet carries the station's ID and a number, and goes out twice 10 ms apart, like the corrections. Firmware older than 1.3.18 does not recognise it and drops it.
- The relays always repeat them, even without requests: the data of a far point reach the collector through a relay (D45C in the animation). Every station drops the copies, recognising them by the station of origin and the number.
- The collector, with Collect UBX from ESP-Now
on, writes once a second the data of each station into a file of its own, one per station
and per day:
ESPNOW_<ID>_<yymmdd>.ubx, for exampleESPNOW_5A21_261008.ubx(ESPNOW_5A21.ubxuntil the clock is set). The collector's own data do not go there: it already records them like every station. - The files are downloaded from the collector with the File Manager and processed like the files recorded by each station.
The status lines also carry the position of each station, with its solution (3D, RTK float, RTK fix): the collector's table of the stations heard shows where each point is even without the UBX messages.
Each box of Message Rates says after how many measurements the message goes out: with the
factory 4 Hz measurement, 4 means once a second. In the serial menu the three messages are
in 2 → 4 (NAV, item 16 PVT) and 2 → 3 (RXM, item 3 RAWX and item 6 SFRBX).
| On the bench | What arrives |
|---|---|
| steady | 99 % of the bytes sent arrive. |
| whole messages | In the file 95 % of the bytes are whole messages. A lost packet spoils the whole message it carried a piece of, and an RXM-RAWX takes about five packets; processing programs skip the broken messages and use the others. |
| at start | If the source restarts, the rovers search the channel and meanwhile more is lost. |
The collector's file is not an exact copy: the complete copy is the file recorded on each station's microSD card. How many stations can send together is in Limits.
The roles at a glance
| Station | Where | How it is set | Details |
|---|---|---|---|
| Base | On stable ground, outside the area that may move, in sight of the points | Base mode with Fixed coordinates, Radio on ESP-Now | RTK corrections › Base and rover over ESP-Now |
| Gateway | Instead of the base, or as its spare: where there is WiFi with Internet | Rover with the NTRIP client and ESP-Now Gateway on, Radio on ESP-Now | ESP-Now radio › Gateway |
| Rover | On each point to watch, fixed to a pillar or bracket | Rover, Radio on ESP-Now, ESP-Now Gateway off, logging on | MicroSD logging |
| Relay | Where the signal of the source does not reach: between the source and the farthest points | Rover with ESP-Now Relay ticked; it is also a measured point | ESP-Now radio › Relay |
| Collector | Where the data of all the stations arrive, directly or through a relay | Base or rover with Collect UBX from ESP-Now and a microSD card; optional | Data of every station to a collector |
One source of corrections is enough: a base or a gateway. Base, gateway and relay are MS2net reference stations too, with the same firmware: the settings decide the role.
Setting it up
- Update every station to firmware 1.3.16 or later (1.3.18 for the UBX data), all together (Firmware update). What you see: the version in Which version is installed.
- Choose one network key for the site and type it in
Radio Configuration on every station, then Save. What you see: the serial menu
rshows(set). - Set up the source: the base on stable ground, with Fixed coordinates and Radio on ESP-Now, or a gateway (ESP-Now radio › Gateway). What you see: on the base the NET LED blinks cyan as the corrections leave.
- On each station for a point, set Radio to ESP-Now and leave ESP-Now Gateway off. In MicroSD logging leave Log to SD Card on and raise Max Log Time (min) to the length of the campaign: from the factory the recording stops after 24 hours. Set Startup Mode to Rover, then Save and Exit. What you see: the display shows Rover.
- Fix each station on its point, with the GNSS antenna under open sky, and switch it on. What you see: within a few tens of seconds the ESP-Now icon alternates with the down arrow, then the RTK LED lights steady (RTK fix).
- Where a station receives no corrections, place a relay between it and the source (ESP-Now radio › Relay). What you see: in the stations heard that rover shows the relay's ID in the Relay column, and the rover reaches RTK fix.
- If you want a collector: on each station that is to send its data
switch on NAV-PVT, RXM-RAWX and RXM-SFRBX in
Message Rates, at the rate you want, and Send UBX
over ESP-Now in Radio Configuration (
r→8), then Save. What you see: in the serial menurthe lineUBX since startwith the bytes sent growing. - On the collecting station, with a microSD card in, switch on Collect UBX from ESP-Now
(
r→9), then Save and Exit. What you see: in its menurheard from othersandsavedgrow, and the File Manager shows oneESPNOW_<ID>_<yymmdd>.ubxfile for each station that sends. - Check the whole network from the serial menu
rof one station, as in How to check it, then leave the menu. What you see: every station listed, age 0 to 2 s, same firmware.
How to check it
Every station keeps the table of the stations heard:
station ID, role, signal, seconds since the last line, the relay each rover is asking,
firmware, time on, free memory and, from firmware 1.3.18, the position with its solution.
Open the serial menu r on any station of the network and
read it; then leave the menu, because a station in the menu sends no lines.
| What you see | What it means |
|---|---|
| all listed | Every station of the network appears, with an age of 0 to 2 s and the same firmware: the network is complete. |
| one missing | That station is off, out of range, has a different network key or a firmware older than 1.3.16. |
| weak signal | Below -80 dBm the link is at its limit: raise the antennas or place a relay. |
| relay asked | A rover with an ID in the Relay column does not hear the source and depends on that relay: keep the relay switched on. |
| two gateways | Two stations with the role Gateway for more than 15 s do not hear each other, and the rovers between them hear two sources: keep only one gateway, or bring them within range of each other. |
| UBX data | On the collector the line UBX since start counts the bytes heard from the other stations (heard from others) and those saved (saved). If the number in brackets after saved grows, the data find no room on the microSD card: missing, full or slow. |
Whether each rover is in RTK fix is shown on the station itself, by the
RTK LED and the display. On the relay and on the gateway the serial
menu r also says whether they are repeating or sending, and the packet counters are in
ESP-Now radio › Counters.
Limits
| Limit | What it means |
|---|---|
| range | ESP-Now reaches a few hundred metres in line of sight at most, much less with obstacles (Range and link). Each relay goes one step further, and every hop is one more station that must stay on. |
| power | Max WiFi Power (11 dBm from the factory) also limits ESP-Now: it keeps the radiated power within the rules, and with less power the range is shorter. |
| data | Each rover records on its own microSD card; over ESP-Now only NAV-PVT, RXM-RAWX and RXM-SFRBX reach a collector, and not all of them whole. The complete files are collected from each station (File Manager); for processing afterwards choose Logging Rates (MicroSD logging). |
| reference | The positions refer to the coordinates of the source. Give the base Fixed coordinates for the whole campaign (Survey-In or Fixed); positions measured with the corrections of a gateway can differ from those measured with the base: note when the source changes. |
| gaps | When a relay or the source fails, the rovers that depend on it have no corrections for half a minute to a minute, the time to find the channel again: in the data that stretch is not in RTK fix. |
| bandwidth | RXM-RAWX, RXM-SFRBX and NAV-PVT once a second make about 1.6 KB a second per station, on the same channel as the corrections, and every relay sends them again: no more than about ten stations sending raw measurements once a second. |
| memory | Send UBX over ESP-Now takes 4 KB of memory, Collect UBX from ESP-Now 8 KB, only while they are on. |
| eight stations | Each station remembers eight others: where a station hears more than eight, its table shows only the eight heard most recently, and it chooses its relay among those. The copies of the UBX data too are recognised for eight stations of origin at a time: with more stations sending, a copy arriving late from a relay can end up twice in the file. |
| firmware | Every station needs firmware 1.3.16 or later: an older rover does not ask for a relay, and a relay serves it only while no rover of 1.3.16 or later is in range. Sending, repeating and collecting the UBX data needs 1.3.18: older firmware drops those packets. |