mirror of
https://github.com/brianshea2/meshmap.net.git
synced 2025-03-05 21:00:01 -08:00
Compare commits
No commits in common. "755b8403a376180921c301a9e96dbc791aae98df" and "7a8a2ce030e89f5efddaa319a06a3fd7b35a12d5" have entirely different histories.
755b8403a3
...
7a8a2ce030
|
@ -30,9 +30,12 @@ Meshtastic has [made a change to their MQTT server](https://meshtastic.org/blog/
|
|||
|
||||
The most accurate resolution that conforms to this specification is 364 meters/1194 feet.
|
||||
|
||||
Additionally, only the default [LoRa region](https://meshtastic.org/docs/configuration/radio/lora/#region)-based root topics (and all subtopics) are now monitored.
|
||||
|
||||
#### To enable MQTT reporting
|
||||
- Enable the MQTT module, using all default settings, possibly with a custom root topic
|
||||
- View nodes around your area on the map to find MQTT topics being used
|
||||
- Only the official [LoRa region](https://meshtastic.org/docs/configuration/radio/lora/#region)-based root topics (and all subtopics) are monitored
|
||||
- Configure your node to connect to wifi or otherwise connect to the internet
|
||||
- Enable MQTT uplink on your primary channel
|
||||
- It is not necessary, and not recommended unless you know what you're doing, to enable MQTT downlink
|
||||
|
|
|
@ -12,14 +12,6 @@ const (
|
|||
NeighborLimit = 100
|
||||
)
|
||||
|
||||
func cleanFloat(f float32) float32 {
|
||||
if f != f {
|
||||
// IEEE 754 says that only NaNs satisfy f != f
|
||||
return 0
|
||||
}
|
||||
return f
|
||||
}
|
||||
|
||||
type NeighborInfo struct {
|
||||
Snr float32 `json:"snr,omitempty"`
|
||||
Updated int64 `json:"updated"`
|
||||
|
@ -156,17 +148,17 @@ func (node *Node) Prune(seenByTtl, neighborTtl, metricsTtl, mapReportTtl int64)
|
|||
|
||||
func (node *Node) UpdateDeviceMetrics(batteryLevel uint32, voltage, chUtil, airUtilTx float32, uptime uint32) {
|
||||
node.BatteryLevel = batteryLevel
|
||||
node.Voltage = cleanFloat(voltage)
|
||||
node.ChUtil = cleanFloat(chUtil)
|
||||
node.AirUtilTx = cleanFloat(airUtilTx)
|
||||
node.Voltage = voltage
|
||||
node.ChUtil = chUtil
|
||||
node.AirUtilTx = airUtilTx
|
||||
node.Uptime = uptime
|
||||
node.LastDeviceMetrics = time.Now().Unix()
|
||||
}
|
||||
|
||||
func (node *Node) UpdateEnvironmentMetrics(temperature, relativeHumidity, barometricPressure float32) {
|
||||
node.Temperature = cleanFloat(temperature)
|
||||
node.RelativeHumidity = cleanFloat(relativeHumidity)
|
||||
node.BarometricPressure = cleanFloat(barometricPressure)
|
||||
node.Temperature = temperature
|
||||
node.RelativeHumidity = relativeHumidity
|
||||
node.BarometricPressure = barometricPressure
|
||||
node.LastEnvironmentMetrics = time.Now().Unix()
|
||||
}
|
||||
|
||||
|
@ -184,7 +176,7 @@ func (node *Node) UpdateNeighborInfo(neighborNum uint32, snr float32) {
|
|||
node.Neighbors = make(map[uint32]*NeighborInfo)
|
||||
}
|
||||
node.Neighbors[neighborNum] = &NeighborInfo{
|
||||
Snr: cleanFloat(snr),
|
||||
Snr: snr,
|
||||
Updated: time.Now().Unix(),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue