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

AWS IoT how change the messagge type 1?

Hello 

I'm using nRF910 DK and need to transmit to aws iot core just like the sample aws iot does, but instead of battery voltage I need to transmit gps data.

In sample I don't find where change the value of type 1 mesagge to transmit, I look for it in the code but I can't find the function in charge of this.

thanks in advance for your help 

Julio

Parents
  • Hi!

    Here are the relevant lines when modifying what message to post to AWS IoT. 

    In L108-L109, the data (battery voltage and date and time) is added to the JSON objects. Here is where you would instead add the GPS data.

    Then the object is made into a message string in L118.

    L125-L130 is where the struct that is used to transmit packages in the AWS IoT library is created. 

    And it is published in L134.

    You will also need to add GPS functionality in the sample, as this is not included. Use the GPS sample in NCS as a reference. Remember that GPS and LTE cannot work concurrently so you will either need to put the modem in PSM mode or turn it off before activating the GPS. 

    Best regards,

    Heidi

  • Hi Heidi

    thanks for your response, I identify the lines you mention and I've saw the GPS sample and joint the samples in one, over aws iot sample I put the gps sample functions, the project compiles but in terminal show this

    I don't know what is err:9, I searched but i could not find   and the failed to initializa modem I supose that is due to GPS and LTE cannot work concurrently, where I can find information about this manage

Reply Children
  • Hi! 

    The errors are defined in newlib's errno.h:

    #define EBADF 9 /* Bad file number */

    You are correct, the GPS and LTE functionality of the modem cannot work concurrently. So you can either put the modem in offline mode every time you want to use the GPS, though we do not recommend this method because the UE will disconnect from the network and has to go through the attach process every time you turn the modem back on which takes time and increases the current consumption of the application. 

    Instead, you can find out of your network supports PSM or eDRX and then put the modem in one of these modes before activating the GPS. 

Related