Documentation ¶
Overview ¶
Copyright © 2024 Don P. McGarry
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright © 2024 Don P. McGarry
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright © 2024 Don P. McGarry
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright © 2024 Don P. McGarry
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright © 2024 Don P. McGarry
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright © 2024 Don P. McGarry
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright © 2024 Don P. McGarry
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright © 2024 Don P. McGarry
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright © 2024 Don P. McGarry
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright © 2024 Don P. McGarry
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright © 2024 Don P. McGarry
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright © 2024 Don P. McGarry
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright © 2024 Don P. McGarry
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright © 2024 Don P. McGarry
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Variables
- func CubicMetersPerSecondToGallonsPerHour(cumps float64) float64
- func CubicMetersPerSecondToGallonsPerMinute(cumps float64) float64
- func CubicMetersPerSecondToGallonsPerSecond(cumps float64) float64
- func HandleSubscriptions(subscribeconf SubscriptionConfig)
- func KelvinToFarenheit(tempk float64) float64
- func MetersPerSecondToKnots(mps float64) float64
- func MetersToFeet(m float64) float64
- func MillibarToInHg(mb float64) float64
- func OnBLETemperatureMessage(client MQTT.Client, message MQTT.Message)
- func OnESPStatusMessage(client MQTT.Client, message MQTT.Message)
- func OnGNSSMessage(client MQTT.Client, message MQTT.Message)
- func OnNavigationMessage(client MQTT.Client, message MQTT.Message)
- func OnOutsideMessage(client MQTT.Client, message MQTT.Message)
- func OnPHYTemperatureMessage(client MQTT.Client, message MQTT.Message)
- func OnPropulsionMessage(client MQTT.Client, message MQTT.Message)
- func OnSteeringMessage(client MQTT.Client, message MQTT.Message)
- func OnWaterMessage(client MQTT.Client, message MQTT.Message)
- func OnWindMessage(client MQTT.Client, message MQTT.Message)
- func PascalToPSI(pascal float64) float64
- func PublishClientMessage(client MQTT.Client, topic string, messagedata string)
- func PublishMessage(publishConf PublishConfig, serverConf MQTTDestination)
- func RadiansToDegrees(rad float64) float64
- type BLETemperature
- type ESPStatus
- type GNSS
- type MQTTDestination
- type Navigation
- type Outside
- type PHYTemperature
- type Propulsion
- type PublishConfig
- type Steering
- type SubscriptionConfig
- type Water
- type Wind
Constants ¶
This section is empty.
Variables ¶
var ISOTimeLayout string = "2006-01-02T15:04:05.000Z"
Functions ¶
func HandleSubscriptions ¶
func HandleSubscriptions(subscribeconf SubscriptionConfig)
func KelvinToFarenheit ¶
func MetersPerSecondToKnots ¶
func MetersToFeet ¶
func MillibarToInHg ¶
func OnBLETemperatureMessage ¶
func OnPHYTemperatureMessage ¶
func PascalToPSI ¶
func PublishClientMessage ¶
func PublishMessage ¶
func PublishMessage(publishConf PublishConfig, serverConf MQTTDestination)
It isn't super efficient to be creating / tearing down connection each time But that said the complexity of reusing connections isn't worth it at this point
func RadiansToDegrees ¶
Types ¶
type BLETemperature ¶
type BLETemperature struct { MAC string `json:"MAC,omitempty"` Location string `json:"Location,omitempty"` TempF float64 `json:"TempF,omitempty"` BatteryPercent float64 `json:"BatteryPct,omitempty"` Humidity float64 `json:"Humidity,omitempty"` RSSI int64 `json:"RSSI,omitempty"` Timestamp time.Time `json:"Timestamp,omitempty"` }
func (BLETemperature) GetInfluxFields ¶
func (meas BLETemperature) GetInfluxFields() map[string]interface{}
func (BLETemperature) GetInfluxTags ¶
func (meas BLETemperature) GetInfluxTags() map[string]string
func (BLETemperature) LogJSON ¶
func (meas BLETemperature) LogJSON()
func (BLETemperature) ToInfluxPoint ¶
func (meas BLETemperature) ToInfluxPoint() *write.Point
func (BLETemperature) ToJSON ¶
func (meas BLETemperature) ToJSON() string
type ESPStatus ¶
type ESPStatus struct { MAC string `json:"MAC,omitempty"` Location string `json:"Location,omitempty"` IPAddress string `json:"IPAddress,omitempty"` MSHVersion string `json:"MSHVersion,omitempty"` FreeSRAM int64 `json:"FreeSRAM,omitempty"` FreeHeap int64 `json:"FreeHeap,omitempty"` FreePSRAM int64 `json:"FreePSRAM,omitempty"` WiFiReconnectCount int64 `json:"WiFiReconnectCount,omitempty"` MQTTReconnectCount int64 `json:"MQTTReconnectCount,omitempty"` BLEEnabled bool `json:"BLEEnabled,omitempty"` RTDEnabled bool `json:"RTDEnabled,omitempty"` WiFiRSSI int64 `json:"WiFiRSSI,omitempty"` HasTime bool `json:"HasTime,omitempty"` HasResetMQTT bool `json:"HasResetMQTT,omitempty"` Timestamp time.Time `json:"Timestamp,omitempty"` }
func (ESPStatus) GetInfluxFields ¶
func (ESPStatus) GetInfluxTags ¶
func (ESPStatus) ToInfluxPoint ¶
type GNSS ¶
type GNSS struct { Source string `json:"Source,omitempty"` AntennaAlt float64 `json:"AntennaAlt,omitempty"` Satellites int64 `json:"Satellites,omitempty"` HozDilution float64 `json:"HozDilution,omitempty"` PosDilution float64 `json:"PosDilution,omitempty"` GeoidalSep float64 `json:"GeoidalSep,omitempty"` Type string `json:"Type,omitempty"` MethodQuality string `json:"MethodQuality,omitempty"` Timestamp time.Time `json:"Timestamp,omitempty"` }
func (GNSS) GetInfluxFields ¶
func (GNSS) GetInfluxTags ¶
func (GNSS) IsEmpty ¶
Since we are dropping fields we can end up with messages that are just a Source and a Timestamp This allows us to drop those messages
func (GNSS) ToInfluxPoint ¶
type MQTTDestination ¶
type MQTTDestination struct { Host string Topics []string Username string Password string CACert []byte }
func LoadPublishServerConfig ¶
func LoadPublishServerConfig() ([]MQTTDestination, error)
type Navigation ¶
type Navigation struct {}
func (Navigation) GetInfluxFields ¶
func (meas Navigation) GetInfluxFields() map[string]interface{}
func (Navigation) GetInfluxTags ¶
func (meas Navigation) GetInfluxTags() map[string]string
func (Navigation) IsEmpty ¶
func (meas Navigation) IsEmpty() bool
Since we are dropping fields we can end up with messages that are just a Source and a Timestamp This allows us to drop those messages
func (Navigation) LogJSON ¶
func (meas Navigation) LogJSON()
func (Navigation) ToInfluxPoint ¶
func (meas Navigation) ToInfluxPoint() *write.Point
func (Navigation) ToJSON ¶
func (meas Navigation) ToJSON() string
type Outside ¶
type Outside struct { Source string `json:"Source,omitempty"` TempF float64 `json:"TempF,omitempty"` Pressure float64 `json:"Pressure,omitempty"` PressureInHg float64 `json:"PressureInHg,omitempty"` Timestamp time.Time `json:"Timestamp,omitempty"` }
func (Outside) GetInfluxFields ¶
func (Outside) GetInfluxTags ¶
func (Outside) IsEmpty ¶
Since we are dropping fields we can end up with messages that are just a Source and a Timestamp This allows us to drop those messages
func (Outside) ToInfluxPoint ¶
type PHYTemperature ¶
type PHYTemperature struct { MAC string `json:"MAC,omitempty"` Location string `json:"Location,omitempty"` Device string `json:"Device,omitempty"` Component string `json:"Component,omitempty"` TempF float64 `json:"TempF,omitempty"` Timestamp time.Time `json:"Timestamp,omitempty"` }
func (PHYTemperature) GetInfluxFields ¶
func (meas PHYTemperature) GetInfluxFields() map[string]interface{}
func (PHYTemperature) GetInfluxTags ¶
func (meas PHYTemperature) GetInfluxTags() map[string]string
func (PHYTemperature) LogJSON ¶
func (meas PHYTemperature) LogJSON()
func (PHYTemperature) ToInfluxPoint ¶
func (meas PHYTemperature) ToInfluxPoint() *write.Point
func (PHYTemperature) ToJSON ¶
func (meas PHYTemperature) ToJSON() string
type Propulsion ¶
type Propulsion struct { Device string `json:"Device,omitempty"` Source string `json:"Source,omitempty"` RPM int64 `json:"RPM,omitempty"` BoostPSI float64 `json:"BoostPSI,omitempty"` OilTempF float64 `json:"OilTempF,omitempty"` OilPressure float64 `json:"OilPressure,omitempty"` CoolantTempF float64 `json:"CoolantTempF,omitempty"` RunTime int64 `json:"RunTime,omitempty"` EngineLoad float64 `json:"EngineLoad,omitempty"` EngineTorque float64 `json:"EngineTorque,omitempty"` TransOilTempF float64 `json:"TransOilTemp,omitempty"` TransOilPressure float64 `json:"TransOilPressure,omitempty"` AltVoltage float64 `json:"AlternatorVoltage,omitempty"` FuelRate float64 `json:"FuelRate,omitempty"` Timestamp time.Time `json:"Timestamp,omitempty"` }
func (Propulsion) GetInfluxFields ¶
func (meas Propulsion) GetInfluxFields() map[string]interface{}
func (Propulsion) GetInfluxTags ¶
func (meas Propulsion) GetInfluxTags() map[string]string
func (Propulsion) IsEmpty ¶
func (meas Propulsion) IsEmpty() bool
Since we are dropping fields we can end up with messages that are just a Source and a Timestamp This allows us to drop those messages
func (Propulsion) LogJSON ¶
func (meas Propulsion) LogJSON()
func (Propulsion) ToInfluxPoint ¶
func (meas Propulsion) ToInfluxPoint() *write.Point
func (Propulsion) ToJSON ¶
func (meas Propulsion) ToJSON() string
type PublishConfig ¶
func LoadPublishConfig ¶
func LoadPublishConfig() (PublishConfig, error)
type Steering ¶
type Steering struct { Source string `json:"Source,omitempty"` RudderAngle float64 `json:"RudderAngle,omitempty"` AutopilotState string `json:"AutoPilotState,omitempty"` TargetHeadingMag float64 `json:"TargetHeading,omitempty"` Timestamp time.Time `json:"Timestamp,omitempty"` }
func (Steering) GetInfluxFields ¶
func (Steering) GetInfluxTags ¶
func (Steering) IsEmpty ¶
Since we are dropping fields we can end up with messages that are just a Source and a Timestamp This allows us to drop those messages
func (Steering) ToInfluxPoint ¶
type SubscriptionConfig ¶
type SubscriptionConfig struct { Host string Username string Password string CACert []byte BLETopics []string PHYTopics []string ESPTopics []string GNSSTopics []string SteeringTopics []string WindTopics []string WaterTopics []string OutsideTopics []string PropulsionTopics []string Repost bool RepostRootTopic string PublishTimeout uint MACtoLocation map[string]string N2KtoName map[string]string InfluxEnabled bool InfluxOrg string InfluxBucket string InfluxToken string InfluxUrl string BLESubEn bool GNSSSubEn bool ESPSubEn bool OutsideSubEn bool PHYSubEn bool PropSubEn bool SteerSubEn bool WaterSubEn bool WindSubEn bool BLELogEn bool GNSSLogEn bool ESPLogEn bool OutsideLogEn bool PHYLogEn bool PropLogEn bool SteerLogEn bool WaterLogEn bool WindLogEn bool }
func LoadSubscribeServerConfig ¶
func LoadSubscribeServerConfig() (SubscriptionConfig, error)
type Water ¶
type Water struct { Source string `json:"Source,omitempty"` TempF float64 `json:"TempF,omitempty"` DepthUnderTransducerFt float64 `json:"DepthUnderTransducerFt,omitempty"` Timestamp time.Time `json:"Timestamp,omitempty"` }
func (Water) GetInfluxFields ¶
func (Water) GetInfluxTags ¶
func (Water) IsEmpty ¶
Since we are dropping fields we can end up with messages that are just a Source and a Timestamp This allows us to drop those messages
func (Water) ToInfluxPoint ¶
type Wind ¶
type Wind struct { Source string `json:"Source,omitempty"` SpeedApp float64 `json:"SpeedApp,omitempty"` AngleApp float64 `json:"AngleApp,omitempty"` SOG float64 `json:"SOG,omitempty"` DirectionTrue float64 `json:"DirectionTrue,omitempty"` Timestamp time.Time `json:"Timestamp,omitempty"` }
func (Wind) GetInfluxFields ¶
func (Wind) GetInfluxTags ¶
func (Wind) IsEmpty ¶
Since we are dropping fields we can end up with messages that are just a Source and a Timestamp This allows us to drop those messages