[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Sending NMEA to other device from my APP via Serial
From: |
Bo Berglund |
Subject: |
Re: Sending NMEA to other device from my APP via Serial |
Date: |
Sun, 17 Mar 2024 16:16:00 +0100 |
On Sun, 17 Mar 2024 15:30:04 +0100, Bo Berglund <bo.berglund@gmail.com> wrote:
>#Subscribe to message stream and log to file (blocking call):
>eval "mosquitto_sub -h ${MQTTIP} -i $MQTTID -F '@Y-@m-@d @H:@M:@S ; %t ; %p' -t
>'#' >> ${FULLOG}"
CLARIFICATION:
--------------
I should have explained that if the only messages to retrieve are for a specific
topic for example sensors/outdoor/temp then the command needs to specify the
topic (argument -t ) like this (on a single line of course):
eval "mosquitto_sub -h ${MQTTIP} -i $MQTTID -F '@Y-@m-@d @H:@M:@S ; %t ; %p' -t
'sensors/outdoor/temp' >> ${FULLOG}"
In my case I added a timestamp in front of the data by using the mosquitto
formatting command so that it can be time located, if you only want to get the
exact transmission then you need to modify the command somewhat by removing the
formatting stuff (-F '@Y-@m-@d @H:@M:@S ; %t ; %p') of course...
So now it shrinks to be like this:
eval "mosquitto_sub -h ${MQTTIP} -i $MQTTID -t 'sensors/outdoor/temp' >>
${FULLOG}"
And instead of sending the values via STDOUT as above and then redirect to the
file you could presumably send it to your own client application as an argument
by piping it...
But that is another story.
--
Bo Berglund
Developer in Sweden