How to change Device Information in nRF Cloud? Where do I find the code setting this info? Where is "App Name" and "App Version" defined?
The application is nrf_cloud_multi_service, but I am modifying it, and want to change name.
How to change Device Information in nRF Cloud? Where do I find the code setting this info? Where is "App Name" and "App Version" defined?
The application is nrf_cloud_multi_service, but I am modifying it, and want to change name.
Hi Bard,
The app version can be found in the nrf_cloud_init structure. But I am not sure regarding how to change the app name. I have inquired internally and will get back to you once I get a solution.
Regards,
Priyanka
Hi Priyanka
I found a solution with "App Name" and "App Version", but not "Battery Voltage" (see at end).
The "App Name" and "App Version" didn't get updated due to some changes I made in the prj.conf. I commented out every setting related to Location Services configuration since I don't want to add it to my application. But within the same paragraph there is two necessary settings hidden: CONFIG_MODEM_INFO and CONFIG_MODEM_INFO_ADD_NETWORK. These are necessary to update Device Information in nRF Cloud. Maybe these two settings should be grouped elsewhere in prj.conf for the sample?
# Location Services configuration
# CONFIG_LOCATION=y
# CONFIG_LOCATION_METHOD_GNSS=y
# CONFIG_LOCATION_METHOD_CELLULAR=y
# CONFIG_NRF_CLOUD_AGNSS=y
# CONFIG_NRF_CLOUD_LOCATION=y
CONFIG_MODEM_INFO=y
CONFIG_MODEM_INFO_ADD_NETWORK=y
# CONFIG_NRF_CLOUD_PGPS=y
# CONFIG_NRF_CLOUD_PGPS_REPLACEMENT_THRESHOLD=4
# CONFIG_NRF_CLOUD_PGPS_REQUEST_UPON_INIT=y
The App Name is set in CMakeLists.txt
project(YOUR_APP_NAME_HERE) zephyr_compile_definitions(PROJECT_NAME=${PROJECT_NAME})
The App version is in Kconfig in the nrf_cloud_multi_service sample. But it can also be set in prj.conf like this:
CONFIG_APP_VERSION="1.0.1"
I did want to change the Battery Voltage to reflect my actual battery voltage (a measured value), but the library implementation of modem info seems to retrieve this value by AT cmd (hence the SoC VCC), and I can't find a way to do it without messing with the SDK files. Any suggestion?
Bård
Hi Priyanka
I found a solution with "App Name" and "App Version", but not "Battery Voltage" (see at end).
The "App Name" and "App Version" didn't get updated due to some changes I made in the prj.conf. I commented out every setting related to Location Services configuration since I don't want to add it to my application. But within the same paragraph there is two necessary settings hidden: CONFIG_MODEM_INFO and CONFIG_MODEM_INFO_ADD_NETWORK. These are necessary to update Device Information in nRF Cloud. Maybe these two settings should be grouped elsewhere in prj.conf for the sample?
# Location Services configuration
# CONFIG_LOCATION=y
# CONFIG_LOCATION_METHOD_GNSS=y
# CONFIG_LOCATION_METHOD_CELLULAR=y
# CONFIG_NRF_CLOUD_AGNSS=y
# CONFIG_NRF_CLOUD_LOCATION=y
CONFIG_MODEM_INFO=y
CONFIG_MODEM_INFO_ADD_NETWORK=y
# CONFIG_NRF_CLOUD_PGPS=y
# CONFIG_NRF_CLOUD_PGPS_REPLACEMENT_THRESHOLD=4
# CONFIG_NRF_CLOUD_PGPS_REQUEST_UPON_INIT=y
The App Name is set in CMakeLists.txt
project(YOUR_APP_NAME_HERE) zephyr_compile_definitions(PROJECT_NAME=${PROJECT_NAME})
The App version is in Kconfig in the nrf_cloud_multi_service sample. But it can also be set in prj.conf like this:
CONFIG_APP_VERSION="1.0.1"
I did want to change the Battery Voltage to reflect my actual battery voltage (a measured value), but the library implementation of modem info seems to retrieve this value by AT cmd (hence the SoC VCC), and I can't find a way to do it without messing with the SDK files. Any suggestion?
Bård
Hi,
Bard said:I can't find a way to do it without messing with the SDK files. Any suggestion?
I have not tried this myself, but you could maybe try to create your own custom battery voltage measurement, instead of the default battery voltage reporting and then report the battery voltage to the nRF Cloud. But yes, this might need you to do quite a few changes to your application and maybe a bit complicated. I will check this too with experts and get back to you.
-Priyanka
Another suggestion from our developers:
You can send a message using nrf_cloud_send()
with the appId DEVICE
.
See the schema here: https://github.com/nRFCloud/application-protocols/blob/v1/schemas/deviceToCloud/device/device.json
An object like this {"deviceInfo": {"batteryVoltage": 2500}}
will update that value to 2500. You'll need to first create the struct nrf_cloud_obj
with those values, and then use nrf_cloud_obj_object_add
. Could use send_sensor_sample()
in the nRF Cloud Multi Service sample as a starting point.
Regards,
Priyanka
Thank you.
This will probable fix the battery voltage question. I have entered a new more general ticket about how to send custom messages to custom topics. A solution to to that will also allow me to send the battery status to the cloud.https://devzone.nordicsemi.com/f/nordic-q-a/116427/nrf-cloud---sending-custom-data-to-custom-topic