Lars Øvergard ([email protected])
Nordic Semiconductor(Original author for the firmware)
The purpose of this template is to serve as a starting point for people to get started with sending sensor data from their NRF device up to the nordic cloud.
There are several TODO comments in the code which serves as a guide to get the code started. These comments are may not be sufficient to get your spesific sensor up and running, and additional changes might be required.
The template is based upon Nordic Semiconductors AGPS example.
This firmware is only tested for:
- nRF Connect SDK v1.9.1
- Modem firmware v1.3.2
-
Install the nrf Connect for Desktop: https://www.nordicsemi.com/Products/Development-software/nrf-connect-sdk
-
Install the "Toolchain Manager" from the "nrf Connect for Desktop" application
-
Install the "nrf Connect SDK v1.9.1" (this might take a while)
-
Download and install "Visual studio code" https://code.visualstudio.com/download (or other IDE if prefferd)
-
Press "Open VS Code" in the toolchain manager, this will install useful packages for VS code.
When flashing the boards for the first time, it must be done by a debugger, since there is no bootloader on the boards.
-
Press "Open Segger Embedded Studio"
-
File -> Open nRF Connect SDK Project
-
Choose the project folder and board, press Ok
-
To build and flash the unit, press Build -> Build and Run
The device will get flashed and running with the latest project
The build files will be created, even if the debugger cant connect to the device.
If there occurs error, and there has been no changes to the code,
it can help to delete the build folder and try to build again.
-
Go to the toolchain manager, press arrow -> Open command prompt
-
Go to correct folder
cd path_to_project_folder
- Build the application (add "-p" for a clean build)
west build -b **INSERT_YOUR_BOARD_NAME**
There should now be a build folder in your project folder.
-
Open the "NRF Connect for Desktop" application
-
Press Programmer->Open
-
Select the device
-
Drag the the merged.hex or app_update.bin file into the application (location of files in build/zephyr/)
-
Erase all and then write the new files
The device will now be flashed with the newest software.
The modem should have a up to date firmware. This can be easily get done with these steps. The modem cannot keep the certificate or connect to nrfcloud without a modem firmware1
-
Go to nordicsemi.no and find the nRF9160 SiP modem firmware (https://www.nordicsemi.com/Products/nRF9160/Download#infotabs)
-
Download the firmware
-
Open the Programmer found in nRF Connect for Deskstop and drag the file into the application
-
Click Write
The modem should now be updated!
There is one thing needed to connected to nrfcloud.com, a certificate.
Each device must have a unique certificate!
-
Use the at_cert firmware in certificates_fw folder
-
There is a guide in the folder for using the firmware
There are two things needed to connect the devices to the nrfCloud, the custom name and a pin. The board must have a valid certificate before adding the device on nrfcloud!
-
Go to nrfcloud.com
-
Press the green plus (+), upper left.
-
Add a "LTE Device".
-
Press "Skip this step", since we are not setting it up with iBasis sim.
-
Write the custom name and the pin.
-
Add or create the device into a relevant group.
The device is now connected to the cloud and gps-fixes should appear when the device is on.
First time the device connected to the nrfcloud, it will disconnected, even if it is added to an account.
Simply restart the device to make it online.
To see what the device is doing live, you can see the logs and prints live.
This can be useful, since it will show errorcodes, if something is wrong or
just show its current state.
-
Connected to the device with USB
-
Open the "LTE Link Monitor"
-
Choose the device
(Remember to uncheck "Show only supported devices" in the program to see the device.)