Closed TjazVracko closed 4 years ago
I think this is because right now @simensrostad is in progress of heavy refactoring in the firmware architecture to extract a generic AWS backend which can be used by any application that wants to connect to AWS.
The last version that worked for me was v0.40.0, try that instead for your device.
I also noted down #47, we don't have tests right now and that needs to be addressed.
I have tried to recreate the given scenario with little luck. Could you try to re-flash the latest modem firmware? https://www.nordicsemi.com/Software-and-tools/Development-Kits/nRF9160-DK/Download
I have tried re-flashing with the latest firmware, as well as building for pca20035 (Thingy91). I get the same output on both.
I then tried to flash the pre-build hex v0.44.0, with generated certificates already on the device. The modem then successfully connected to my AWS broker, and I can see a new "cat" in the interface.
How does the device manage to connect, if I didn't specify the mqqt endpoint in prj.conf
?(CONFIG_BIFRAVST_CLOUD_HOST_NAME="<my-endpoint>"
).
The same thing happens on pca20035.
Do you have any pointers on how I might go about debugging this? Is my setup wrong or is it the configuration? The guide is really sparse on how to set up your own build environment for the project, or did I miss this information somewhere?
Thank you for your help.
I verified v0.44.0 with a 91DK and I do not see this error.
I now understand that your issue is failing to build a working firmware from source.
I then tried to flash the pre-build hex v0.44.0, with generated certificates already on the device. The modem then successfully connected to my AWS broker, and I can see a new "cat" in the interface. How does the device manage to connect, if I didn't specify the mqqt endpoint in
prj.conf
?(CONFIG_BIFRAVST_CLOUD_HOST_NAME="<my-endpoint>"
).
That cannot work (the pre-build binaries have a hardcoded endpoint, see #29). Are you sure that you flashed the right device and that flashing actually worked?
@simensrostad I think the FW should not have a default value for CONFIG_BIFRAVST_CLOUD_HOST_NAME
and fail to build if it is not set. (#48)
The guide is really sparse on how to set up your own build environment for the project, or did I miss this information somewhere?
For now we only can point to the the documentation of NRF Connect FW which this project is based on, especially have a look at the Getting Started Guide.
You might get some pointers on the (rather longish process) to set up a system in order to build from source from our CI workflow.
Thanks, with the help of the above CI workflow I managed to get it working.
For reference, this is is what I did:
mkdir build_test
cd build_test
west init -m https://github.com/bifravst/cat-tracker-fw.git --mr e1f2e0cb1818a8be1159b91d74dc6b48514e2024 # this is version 0.53.0
west update
sudo pip3 install -r zephyr/scripts/requirements.txt
sudo pip3 install -r nrf/scripts/requirements.txt
sudo pip3 install -r mcuboot/scripts/requirements.txt
# for me, all requirements were already satisfied (from previous attempts)
source zephyr/zephyr-env.sh # this sets $ZEPHYR_TOOLCHAIN_VARIANT and $GNUARMEMB_TOOLCHAIN_PATH
cd ./nrf/applications/cat_tracker/
nano prj.conf # add CONFIG_BIFRAVST_CLOUD_HOST_NAME="<mqtt_endpoint>" setting
west build -p auto -b nrf9160_pca10090ns -d build10090ns
nrfjprog -f nrf91 --program ./build10090ns/zephyr/merged.hex --sectoranduicrerase -r
When using west flash --build-dir build10090ns
instead of the above nrfjprog
command, I get the original <err> bifravst_cloud: topics_populate, error: -12
error (on the device).
Using nrfjprog
gets me a working device that successfully reports to AWS.
Are there some equivalent west flash
arguments or is using nrfjprog
preferred?
Good to hear that you are able to compile the firmware on your machine. In general I recommend to fork the firmware repo and set up the compilation using GitHub Actions just like we do, that way not every developer has to go through the hassle of getting the system in shape for being able to build.
Are there some equivalent
west flash
arguments or is usingnrfjprog
preferred?
Looking at our documentation for the nRF9160, nrfjprog
should be used.
Ok, will use nrfjprog from now on.
It's possible to use west flash
but it's not as flexible (and calls nrfjprog
under the hood anyway).
I have successfully set up the AWS stack and device-simulator and can see the simulated cat activity on the web GUI.
I am now trying to build and flash onto a nRF9160 DK. I have completed the following steps to set up the device:
cat-tracker-fw
repo into the nrf folder:Updated west:
init zephyr:
Added the mqtt endpoint to prj.conf
CONFIG_BIFRAVST_CLOUD_HOST_NAME="<my-endpoint>"
Ran west build:
Flashed with command:
or with the Programmer GUI utility.
screen /dev/ttyACM0 115200
and logging the output i have created the attachedscreenlog.0.txt
file. The log contains the follow lines I deem important:Booting Zephyr OS build v2.0.99-ncs1-rc1-761-g7e20180c004a [00:00:00.007,232] mcuboot: Starting bootloader
[00:00:00.015,502] mcuboot: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
[00:00:00.028,411] mcuboot: Scratch: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
[00:00:00.040,618] mcuboot: Boot source: primary slot
[00:00:00.051,818] mcuboot: Swap type: none
[00:00:00.444,671] mcuboot: Bootloader chainload address offset: 0xc000
[00:00:00.452,301] mcuboot: Jumping to the first image slot
Booting Zephyr OS build v2.0.99-ncs1-rc1-761-g7e20180c004a
Flash region Domain Permissions