This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to publish GPS informations to Azure IoT Hub?

Hi,

I've got a Thingy:91, which I've spent a lot of hours in understanding the different samples. I want to be able to send GPS information to my Azure IoT hub device, but I can't seem to figure out how to do that??? I want to be able to set a interval in the "device twin" on my cloud, which the device should publish GPS information to my cloud in.

I have programmed the Azure IoT Hub sample and run it succesfully, where the event is triggered in a specific time interval, I can change in the devices "device twin" on my cloud. It all works. Furthermore, I run the GPS sample succesfully. I thought the way to go is to merge those two samples, but I don't know how? I think these files from both samples should be merged, but i'm not quite sure how:

  • Kconfig
  • prj.conf
  • sample.yaml
  • main.c

I've read other tickets in here, but none of them is about Azure IoT Hub. I'm using NB-IoT and I know the modem can not run GPS and LTE-NB simultaneously, but I don't know how to switch between those in the given interval. :-)

I hope somone can be helpful. I appreciate any help :-)

Thanks, Regards

Frederik

Parents
  • Hello,

     

    I think these files from both samples should be merged, but i'm not quite sure how:

    • Kconfig
    • prj.conf
    • sample.yaml
    • main.c

    There is no kconfig file in the Azure IoT hub sample, so you don't need to worry about that.

    With prj.conf, you can probably just copy and paste the options from one sample to the other, except for the duplicate ones.

    You don't need to worry about sample.yaml I believe.

    With main.c I think it shouldn't be too hard. You can probably just use the azure_iot_hub_send() to send the GPS data in the process_gps_data() function every time GPS data is received. Perhaps the best way to go about it is to start with the GPS sample code, and add the Azure IoT code on top of it.

     

    I know the modem can not run GPS and LTE-NB simultaneously

     Where do you have this from?

Reply
  • Hello,

     

    I think these files from both samples should be merged, but i'm not quite sure how:

    • Kconfig
    • prj.conf
    • sample.yaml
    • main.c

    There is no kconfig file in the Azure IoT hub sample, so you don't need to worry about that.

    With prj.conf, you can probably just copy and paste the options from one sample to the other, except for the duplicate ones.

    You don't need to worry about sample.yaml I believe.

    With main.c I think it shouldn't be too hard. You can probably just use the azure_iot_hub_send() to send the GPS data in the process_gps_data() function every time GPS data is received. Perhaps the best way to go about it is to start with the GPS sample code, and add the Azure IoT code on top of it.

     

    I know the modem can not run GPS and LTE-NB simultaneously

     Where do you have this from?

Children
Related