Message broker to send GPS

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

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

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

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
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

mentioned in Windows IoT Core - #9 by Andrey1984

Sorry for the delay.
Is this still an issue?
Can you refer to comment 7#? which part you are not clear about?

hi @amycao
thank you for following up!
we are trying to figure out how to publish to Azure IoT broker from Jetson GPS emulator or Jetson GPS.
So far we got a solution that publishes to Mosquitto local server, but without Azure Iot authentication, or otherwise we have examples of Deepstream or some generic Azure IoT examples that could publish to azure Iot but not the GPS data.
Is there a simple way how we could implement it with DeepStream Azure IoT thing?

See inline.

@amycao is there a pre-build mechanism to supply geo location as GPS outputs?
property location

Geo-location of object
I am having hard times trying to figure out how exactly redirect the flow from GPS output to test5 example inputs
Could you extend what is the geo-location , please?
What is the coordinate option?
property coordinate

With mosquitto / paho mqtt we just used to redirect GPS emulator web socket to the message server like:

service := "localhost:2222"

property location definition:

struct NvDsGeoLocation

Holds geolocation parameters.

Public Members

gdouble lat

Holds the location’s latitude.

gdouble lon

Holds the location’s longitude.

gdouble alt

Holds the location’s altitude.

coordinate definition:

struct NvDsCoordinate

Hold a coordinate’s position.

Public Members

gdouble x

Holds the coordinate’s X position.

gdouble y

Holds the coordinate’s Y position.

gdouble z

Holds the coordinate’s Z position.

We do not have structure for GPS data, just as stated before, you need to crate one. you can refer to structure NvDsPersonObject or NvDsVehicleObject and test5 sample for how to use.

@amycao Thank you for following up!

typedef struct NvDsGeoLocation {
   98   gdouble lat;
   99   gdouble lon;
  100   gdouble alt;
  101 } NvDsGeoLocation;
  106 typedef struct NvDsCoordinate {
  107   gdouble x;
  108   gdouble y;
  109   gdouble z;
  110 } NvDsCoordinate;

do you mean that in the very same file NVIDIA DeepStream SDK API Reference: nvdsmeta_schema.h Source File
we would have to define a struct like in the example above? Otherwise in which file the structure needs to be created? Apart of creating of the structure definition there should also be somewhere loading the data from GPS . In which file does it go?


Apart of creating of the structure definition there should also be somewhere loading the data from GPS . In which file does it go?

You can refer to generate_event_msg_meta() for how to fill NvDsPersonObject or NvDsVehicleObject

Thank you for pointing out the structures below,
But could you extend how to use them to import GPS feed? which command will load NMEA inputs from the GPS unit?

typedef struct NvDsVehicleObject {
  126   gchar *type;
  127   gchar *make;
  128   gchar *model;
  129   gchar *color;
  130   gchar *region;
  131   gchar *license;
  132 } NvDsVehicleObject;
  137 typedef struct NvDsPersonObject {
  138   gchar *gender;
  139   gchar *hair;
  140   gchar *cap;
  141   gchar *apparel;
  142   guint age;
  143 } NvDsPersonObject;

This example illustrates how to define variables that would come from NMEA sequence, but how to import it to get structured after the structure got defined?

I am not familiar with GPS, you can google search how to load NMEA inputs from the GPS unit.

1 Like

maybe you could provide an example how to incorporate any serial output e.g .like from cat /dev/tty
ACM0 ?

@amycao are you famirial with serial inputs?

HI, Andrey
I am not familiar with serial programming, you can start with serial programming tutorials,

Hi, Thank you for your response.
However it doesn’t help to get serial data be delivered by DeepStream.
How could we send data from serial ouitput to Azure IoT with DeepStream?