Monitoring network
From firmware 1.3.16 (UBX data from 1.3.18, monitoring mode from 1.3.22), described as in 1.3.22 · Radio: ESP-Now radio · Settings of the monitoring mode: System › Monitoring
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 Bluetooth address (for example
173E), the same as in its Bluetooth name and on the display, not those of the Radio MAC (Stations heard); - 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;
- from firmware 1.3.19, whether it collects UBX data: the relays read it to know whether the UBX data are worth repeating.
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 of any station in rover or base. ESP-Now is off in
configuration, and from firmware 1.3.19 the configuration page says so in place of the table.
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: from firmware 1.3.19 the rover chooses first among the relays heard in the last 6 s, and only if there is none among those heard in the last minute.
- 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. From firmware 1.3.19 it also gives way to corrections that reach it only through a relay, and it no longer takes its own packets, sent back by a relay, for those of another source. 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. From firmware 1.3.19 the gateway left without the caster for 10 s uses, for its own point, the ESP-Now corrections of the source that took over. |
| 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 | From firmware 1.3.19 nothing changes: with the menu open the station keeps sending its status lines and a relay keeps repeating; only the line printed every minute waits for the menu to close. Up to 1.3.18 a station in the menu sent no lines, and a relay left there for more than 15 s was no longer chosen. |
| 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 a few milliseconds apart (4 ms), like the corrections. Firmware older than 1.3.18 does not recognise it and drops it.
- A relay repeats them only where they are needed. From firmware 1.3.20 a relay repeats the UBX data of the other stations whenever it has heard, in the last minute, the status line of a collector, which says that it collects, even if no rover asks it for the corrections. It sends each packet once, and always leaves two places of its queue to the corrections. In the animation the far point D45C, out of reach of the collector, hears the source and asks nobody: the relay 9C04 starts repeating when the collector's line reaches it, so the first data of D45C are lost and the following ones reach the collector. Every station drops the copies, recognising them by the station of origin and the number. In 1.3.19 a relay repeated them only while a rover asked it for the corrections, so a station near the source but far from the collector lost its data; up to 1.3.18 every relay repeated them always, twice.
- 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 collector
| Point | What happens |
|---|---|
| 16 stations | From firmware 1.3.19 the collector tells apart the data of up to 16 stations at a time (8 up to 1.3.18, when a late copy could end up twice in the file). With 16 stations sending, the data of one more are not saved and are counted in saved (N not). |
| microSD full | From firmware 1.3.19 the collector checks the free space: with less than 10 MB free, as for the logging, it stops writing and counts what it does not save in saved (N not). The same with the card missing or removed. Download the files with the File Manager and free the card, or put in an empty one. |
| 1.3.18 and 1.3.19 | From firmware 1.3.19 a packet carries at most 236 bytes of data instead of 242, to leave room for the longer network key signature. A 1.3.19 collector drops the UBX packets of a 1.3.18 station that are longer than that: update the stations that send and the collector together. With a key, every station must have 1.3.19 anyway. |
| memory | Send UBX over ESP-Now takes 4 KB of memory, Collect UBX from ESP-Now 8 KB. From firmware 1.3.19 only with Radio on ESP-Now and the setting on, and the memory is given back as soon as the setting is turned off, without restarting. With Bluetooth on, read System › Bluetooth Protocol first. |
| counters | On the collector, the line UBX since start of the serial menu r counts the bytes heard and saved (ESP-Now radio › Counters). |
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 the same firmware, 1.3.20 or later, all together (Firmware update): with a network key, stations of 1.3.18 and 1.3.19 do not hear each other, and a relay of 1.3.19 does not pass on the UBX data of a station that does not ask it for corrections. 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. 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. From firmware 1.3.19 the station goes on working normally while the menu is open.
| 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 are not saved: see The collector. |
| rejected | If rejected grows on every station while the network has a key, the stations do not all have the same firmware: update them all together to 1.3.20 or later (Network key). Even without a key it grows while a station with 1.3.18 sends UBX data: update it. |
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.
Monitoring mode
From firmware 1.3.22 · Settings: System › Monitoring
A station on a mast, with the battery and the solar panel, does not need to record day and night. With Monitoring mode on it records only in a window of each day, set in UTC, and outside the window it sleeps: the consumption drops almost to zero and the battery lasts even with little sun.
| What | How it behaves |
|---|---|
| Sleep | Outside the window the station goes into deep sleep: GNSS module, display, LEDs, 868 MHz radio, WiFi and Bluetooth off. Only CHG stays on, following the charger. The station is not switched off: it wakes by itself. |
| Wake | In two steps, to be on time: the sleep clock is off by about 1 %, so the station first wakes about half an hour early, reads the time from the satellites, sleeps again for the stretch that is left and starts with the lead of Awake before. The first wake records nothing. If after a wake it has no time from the satellites within 10 minutes, it goes back to sleep using its own clock. |
| Window | The station works in its startup mode (rover or base) and records as usual, with one log file per window (MicroSD logging). At the end of the window it closes the files and goes back to sleep. |
| Low battery | Without external power, with the battery below 3.4 V for one minute, the station sleeps even inside the window. Every 30 minutes it checks the battery, with nothing else powered, and starts again above 3.7 V, that is once the sun has recharged it. It also applies with 24 h (always on). |
| When it does not sleep | After a power on or a restart it stays awake at least 10 minutes. It does not fall asleep in Config mode, with the serial menu open or during a firmware update. |
Before falling asleep the display shows Sleep for two seconds and, under it, the wake time in
UTC (for example 05:50 (UTC)), or Battery low; then it goes dark.
The button with the monitoring mode
| Action | What it does |
|---|---|
| Hold for 2 s | The display writes Release: sleep and Hold: power off. Releasing the button, the station does not switch off but sleeps: until the start of the next window or, with 24 h (always on), until the button is pressed again. |
| Hold for 10 s | Really switches off, as without the monitoring mode: for transport and storage. |
| A short press while it sleeps | The station starts and for 10 seconds the display writes Asleep until and the wake time in UTC, with Press: wake at the bottom (with a low battery: Battery low); then it goes back to sleep. |
| A second press, with that screen | The station stays awake for one hour, for maintenance (configuration, downloading the files); then it resumes the window. |
| A press after a sleep from the button | The station starts again and stays awake at least one hour. |
In the serial menu the monitoring mode is in s → M (Menu map › Monitoring).
For the installer: the SER port during the sleep
Inside the station, pin 2 of the data port J3 (MUX connector) is always powered. If the RS-232 converter of the SER port is connected there, during the sleep the converter stays on and partly powers the display and the radio back, and the station draws more than it should. Remedy: swap the two red wires of the cables of J1 (display) and J3 (converter). Then during the sleep only the display stays on, with the sleep text, and the converter goes off with the rest.
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 a relay that hears a collector sends them again once: no more than about ten stations sending raw measurements once a second. If not repeated grows on a relay or refused by the radio on the stations, the channel is too busy (ESP-Now radio › Counters). |
| UBX through a relay | A relay repeats the UBX data only while it hears the collector directly (the status lines are not repeated), and the station must hear the relay: place the relay where it hears both the far station and the collector. |
| 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 collector tells apart the UBX data of up to 16 stations (The collector). |
| 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. For a relay to repeat them while no rover asks it for corrections it needs 1.3.20. With a network key every station needs 1.3.19. For campaigns longer than three weeks use 1.3.19: up to 1.3.18 a station left on for more than about 25 days could take old times for recent ones and lose the corrections without any sign. |