Hello
I would like to transmit gps data to my website in addition to nrf cloud, there is a example or documentation about this that I can take of reference? I am working with nRF 9160 DK
thanks in advance.
Kind Regards
Julio
Hello
I would like to transmit gps data to my website in addition to nrf cloud, there is a example or documentation about this that I can take of reference? I am working with nRF 9160 DK
thanks in advance.
Kind Regards
Julio
Hi,
The asset_tracker shows how to connect to a cloud based system, and send certain sensors + gps data to the cloud.
If you want a simpler solution, like a tcp/udp connection directly to your own server, I would recommend that you look at the "gps" sample, and add your own implementation around this.
Note that there's a restriction towards getting GPS and LTE concurrent, which is that you have to be in eDRX or PSM mode in order to use the GPS. A recommended use-case is to use the AT CSCON event to signal when you can or cannot use the GPS.
Kind regards,
Håkon
Thx Håkon,
I tried setting CSCON=0 when initialising the GPS.
(After looking at the code in asset_tracker I also saw it use lte_lc_psm_req(true))
If I then try to initialise a UDP connection lte_lc_init_and_connect_async(lte_handler) fails.
(Initialisation code from the UDP example)
I'm not clear on the sequence I need to initialise both GPS and UDP.
further...
I wanted to see why lte_lc_init_and_connect_async is failing but this seems to be part of the distribution that is shipped in binary.
Specifically, the error is:
modem_configure()
I: Using legacy LTE PCO mode...
I: PDP Context: AT+CGDCONT=0,"IP","lpwa.vodafone.iot"
E: Could not send AT command, error: -8
Which is odd because when initialising the GPS we already sent 4 AT commands without error.
This part of UDP initialisation works fine if I comment out the GPS initialisation
Thx.
Hi Paul,
My strongest apologies! This comment from me is written a bit too fast (ie: its wrong..)
Håkon Alseth said:Please check that "modem_configure()" isn't called
You should check that modem_configure hasn't been called yet, before setting system permissions, like XSYSTEMMODE.
So, issue your AT-commands, then call modem_configure() to connect to the LTE network.
Kind regards,
Håkon
Thx Håkon
I tried that. It gets to modem_configure() - same code as in UDP sample - and we then fail with:
```
Could not send AT command error -8
```
This is happening inside lte_lc_init_and_connect_async() for which AFAIK we do not have the source.
Regards.
Hi,
paul_tanner said:This is happening inside lte_lc_init_and_connect_async() for which AFAIK we do not have the source.
That function is inside lte_lc.c: https://github.com/nrfconnect/sdk-nrf/blob/master/lib/lte_link_control/lte_lc.c#L744
Do you know which AT command is failing? Does any of them work?
Kind regards,
Håkon
Thx Håkon
OK. modem_configure() is trying to set the AT%XSYSTEMMODE - which is *already* correctly set.
(I have CONFIG_LTE_NETWORK_MODE_NBIOT_GPS=y in prj.conf)
BTW. To find this out I had to edit lte_lc.c whereas I would have preferred to turn on debugging. I tried adding:
#define NRF_AT_CMD_LOG_LEVEL NRF_LOG_LEVEL_DEBUG
in main.c but that had no effect.
What next?
Regards.
So I made that error in modem_configure() non-fatal (a hack in ltc_lc.c) and it now does GPS and transmits the result via UDP. This is almost a solution apart from the fact that I hacked ltc_lc.c. I'd like a way to do this without that hack if possible to make it more upgrade-proof.
Also, if I want to restrict the log a bit i'd like to find out where CONFIG_LTE_LINK_CONTROL_LOG_LEVEL is defined.
Thx for any suggestions.
Regards
So I made that error in modem_configure() non-fatal (a hack in ltc_lc.c) and it now does GPS and transmits the result via UDP. This is almost a solution apart from the fact that I hacked ltc_lc.c. I'd like a way to do this without that hack if possible to make it more upgrade-proof.
Also, if I want to restrict the log a bit i'd like to find out where CONFIG_LTE_LINK_CONTROL_LOG_LEVEL is defined.
Thx for any suggestions.
Regards
Hi,
Don't change the source files, you should set the log level on a project level:
https://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_LOG_DEFAULT_LEVEL.html
You can access this by entering "menuconfig", either via SeggerEmbeddedStudio (nordic edition) or via command line (cd my-project/build-folder && ninja menuconfig)
Then you should also choose "LTE_LINK_CONTROL_LOG_LEVEL_DBG".
Kind regards,
Håkon