Message broker to send GPS

is there an example on how to add GPS information with deepstream message broker?

Is a dynamic or static

dynamic like in getting messages constantly from GPS unit so that they will be sent by MQTT e.g. to Azure so they will appear at Azure , so it will be possible see GPS location from there , for example

but static sample could also do as it could be looped probably

so either of the two

Hi,
Can you specify your pipeline?

@amycao Thank you for following up!
There is no pipeline at the moment.
I am trying to find an example on how to add GPS data somehow using the deepstream message broker example or somehow else.

“nvmsgbroker” plugin extracts NVDS_META_PAYLOAD type of metadata from the buffer and sends that payload to the server using APIs in nvmsgbroker C library.
for your GPS data, you can create custom objects and attach to buffer as NVDS_EVENT_MSG_META metadata.
To do that NvDsEventMsgMeta provides “extMsg” and “extMsgSize” fields. User can create custom structure, fill that structure and assign the pointer of that structure as “extMsg” and set the “extMsgSize” accordingly. If custom object contains fields that can’t be simply mem copied then user should also provide function to copy and free those objects.
Refer generate_event_msg_meta() to know how to use “extMsg” and “extMsgSize” fields for custom objects and how to provide copy/free function and attach that object to buffer as metadata.
but you need to first generate the GPS data. then integrate with deepstream like above.

1 Like

@amycao
devs are asking if there is nvmsgbroker Python library
seems there is NvDsEventMsgMeta — Deepstream Deepstream Version: 5.1 documentation
GPS messages are like this

{
'sender': string,
'time': float,
'counter': int,
'location': (float, float),
'latitude': float,
'longitude': float,
'shift': float,
'speed_ms': float,
'speed_accuracy': int,
'gps_fix_ok': 1|0,
'head_valid': 1|0,
}

We do not have Python version for deepstream plugins or library, you need to implement in c version, and add python binding for it. you can refer to this faq for how to add python binding.
DeepStream SDK FAQ - Intelligent Video Analytics / DeepStream SDK - NVIDIA Developer Forums

@amycao
It is not exactly very clear how to use the metadata buffers, given I just want to forward like /dev/pts/26 output with it, right?

terminal 1:

nvidia@nx_xavier:~$  socat -d -d pty,raw,echo=0 pty,raw,echo=0
2021/05/06 13:13:55 socat[23720] N PTY is /dev/pts/25
2021/05/06 13:13:55 socat[23720] N PTY is /dev/pts/26
2021/05/06 13:13:55 socat[23720] N starting data transfer loop with FDs [5,5] and [7,7]

terminal 2:

sudo apt install csh -y
wget https://iweb.dl.sourceforge.net/project/gpsfeed/gpsfeed-latest.zip
unzip gpsfeed-latest.zip
nvidia@nx_xavier:~$ tclsh8.6 gpsfeed+.tcl 

From this point there will be opened GUI of the gpsfeed. - two
GUI windows;
e.g. in serial section goes insteead of default COM1 → /dev/pts/25; baudrate to ->9600
Then in second GUI window = pressing play [ in the top left - a circle icon with a dot in the center;]
Now from the third terminal the GPS feed is available

:~$ cat /dev/pts/26
$GPGGA,180756,3756.2421,N,02346.8948,E,1,04,5.6,724.4,M,34.5,M,,*43
$GPRMC,180756,A,3756.2421,N,02346.8948,E,,,060521,5,E,A*01
$GPGGA,180758,3751.4936,N,02349.1123,E,1,04,5.6,384.3,M,34.5,M,,*4D
$GPRMC,180758,A,3751.4936,N,02349.1123,E,9109.2,159.8,060521,5,E,A*30
$GPGGA,180800,3747.8756,N,02353.0000,E,1,04,5.6,134.0,M,34.5,M,,*4C
$GPRMC,180800,A,3747.8756,N,02353.0000,E,8541.7,139.7,060521,5,E,A*3E
$GPGGA,180802,3745.9547,N,02358.0261,E,1,04,5.6,9.7,M,34.5,M,,*49
$GPRMC,180802,A,3745.9547,N,02358.0261,E,7942.4,115.8,060521,5,E,A*31

mentioned in Windows IoT Core - #9 by Andrey1984