Skip to content

Commit

Permalink
Added traccar gps tracking support contributed by Zoran
Browse files Browse the repository at this point in the history
  • Loading branch information
talkkonnect committed May 9, 2021
1 parent 3c6914c commit f3739d7
Show file tree
Hide file tree
Showing 4 changed files with 835 additions and 71 deletions.
12 changes: 8 additions & 4 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,21 @@ var (
origVolume int
tempVolume int
ConfigXMLFile string
GPSTime string
GPSDate string
GPSLatitude float64
GPSLongitude float64
Streaming bool
ServerHop bool
HTTPServRunning bool
message string
isrepeattx bool = true
NowStreaming bool
MyLedStrip *LedStrip
GPSTime string
GPSDate string
GPSLatitude float64
GPSLongitude float64
GPSSpeed float64
GPSCourse float64
GPSVariation float64
m string
)

type Talkkonnect struct {
Expand Down
76 changes: 66 additions & 10 deletions commandkeys.go
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,13 @@ func (b *Talkkonnect) cmdPanicSimulation() {
b.SendMessage(fmt.Sprintf("My Username is %s and Ident is %s", b.Username, b.Ident), PRecursive)
}

if PSendGpsLocation && GpsEnabled {
// New. Need to allow sending email / text alert on Panic Event even is the GPS is not enabled or working.
// If no GPS is included in email / Mumble text message, it means GPS in not enabled or not working.

//if PSendGpsLocation && GpsEnabled {
//if GpsEnabled {

if PSendGpsLocation {

var i int = 0
var tries int = 10
Expand Down Expand Up @@ -784,21 +790,71 @@ func (b *Talkkonnect) cmdPanicSimulation() {
b.TxLockTimer()
}

// New. Send email after Panic Event //
if PMailEnabled == true {
b.cmdSendEmail()
log.Println("info: Sending Panic Alert Email To Predefined Email Address")
}
//

// New. Record ambient audio on Panic Event if recording is enabled
if AudioRecordEnabled == true {
log.Println("info: Running sox for Audio Recording...")
AudioRecordAmbient()
}
//

} else {
log.Println("warn: Panic Function Disabled in Config")
}
IsPlayStream = false
b.IsTransmitting = false

if TargetBoard == "rpi" {
if !LedStripEnabled {
b.LEDOff(b.TransmitLED)
} else {
MyLedStripTransmitLEDOff()
}
}
}
}
// New. Decide should TX Led be On or Off during a panic event? I think don't turn off here,
// Want to see PTT key working when testing panic function.
// We shall use another low profile lights/LCD function to turn all the lights and display off during panic event
// They should be dim. Not attracting attention
//if TargetBoard == "rpi" {
//if !LedStripEnabled {
//b.LEDOff(b.TransmitLED)
//} else {
//
//MyLedStripTransmitLEDOff()
//}
//log.Println("--")

//New. Low Profile Leds and LCD during Panic Event. Turn All Lights Off.
//Heartbeat will be running - disable in xml config?
//Backlight LCD led is dim with a transistor control, but it should work...
//Add another feature to enable all lights back on a PTT press after the panic event is over. To do?

if PLowProfile == true {
b.LEDOffAll()
log.Println("info: Low Profile Lights Option is Enabled. Turning All Leds Off During Panic Event")

//b.LEDOff(b.TransmitLED)
//b.LEDOff(b.BackLightLED)
//b.LEDOff(b.OnlineLED)
//b.LEDOff(b.ParticipantsLED)
//b.LEDOff(b.VoiceActivityLED)
//
//b.LEDOff(b.HeartBeatLED)
//

if LCDEnabled == true {
log.Println("info: Low Profile Lights is Enabled. Turning Off Display During Panic Event")
LcdText = [4]string{"", "", "", ""}
LcdDisplay(LcdText, LCDRSPin, LCDEPin, LCDD4Pin, LCDD5Pin, LCDD6Pin, LCDD7Pin, LCDInterfaceType, LCDI2CAddress)
}
if OLEDEnabled == true {
oledDisplay(true, 0, 0, "") // clear OLED screen. How about HD44780 and heartbit?
}
// End of Low Profile Lights

}
}
}


func (b *Talkkonnect) cmdRepeatTxLoop() {
log.Println("debug: Ctrl-R Pressed")
Expand Down
Loading

0 comments on commit f3739d7

Please sign in to comment.