diff --git a/telegram.yaml b/telegram.yaml index caafe9a..20643ee 100644 --- a/telegram.yaml +++ b/telegram.yaml @@ -1,5 +1,5 @@ serial: - device: ttyS1 + device: /tmp/ttyS1 baudrate: 9600 #bytesize: 8 # 1, 2, 15 @@ -22,4 +22,4 @@ pulsar: telegram: tcp: false - pulsar: true \ No newline at end of file + pulsar: true diff --git a/utils/pulsar.go b/utils/pulsar.go index 83f4bf1..96ec52c 100644 --- a/utils/pulsar.go +++ b/utils/pulsar.go @@ -56,5 +56,7 @@ func PulsarSend(data string) error { func ClosePulsar() { producer.Close() - client.Close() + if client != nil { + client.Close() + } }