bifravst / cat-tracker-fw

Cat Tracker Firmware
https://bifravst.github.io/
3 stars 3 forks source link

CONFIG_BIFRAVST_CLOUD_HOST_NAME should not have a default value and fail to build if it is not set #48

Closed coderbyheart closed 4 years ago

coderbyheart commented 4 years ago

We provide a default value in

https://github.com/bifravst/cat-tracker-fw/blob/d23928daa7770570771930cfc7b1f3cebaece8f7/subsys/net/lib/bifravst_cloud/Kconfig#L28

which will never work for the user. This should be removed so there is no ambiguity about this endpoint. It must be provided by the user.

coderbyheart commented 4 years ago

This change does not cause the build to fail, I guess the endpoint is just blank: https://github.com/bifravst/cat-tracker-fw/commit/e1f2e0cb1818a8be1159b91d74dc6b48514e2024/checks?check_suite_id=353589517#step:15:760

coderbyheart commented 4 years ago

Also, please document this. A helpful error message would be one option how to make this known to the user.

simensrostad commented 4 years ago

Yes, the endpoint will default to an empty string. I can add a test which returns and prints an error/message if the endpoint is empty, which is checked run-time, when the cloud backend is initialized. That way, the firmware will still build and the user will get some information about the problem when running the application.

coderbyheart commented 4 years ago

I'd prefer that it wouldn't build at all.

simensrostad commented 4 years ago

Ho would that work with the build and release for the commits? Would that setting be patched in before the process starts?

coderbyheart commented 4 years ago

Yes, we can set it the same way a user would set them, I guess via an env var?

simensrostad commented 4 years ago

The solution must be to patch in CONFIG_BIFRAST_HOST_NAME="" into the project settings file prj.conf located in the src folder of the application. It will be the same for the generic AWS lib to. In that case it will be CONFIG_AWS_IOT_HOST_NAME=""

coderbyheart commented 4 years ago

That's ok, we patch the source already for the version number.

coderbyheart commented 4 years ago

@simensrostad how does one

set the hostname manually by setting the CONFIG_BIFRAVST_CLOUD_HOST_NAME static configuration in the application project configuration file? (https://github.com/bifravst/cat-tracker-fw/commit/8b713e54a843dcf2c8315f486201155b8c4d357b)

Can you give an example how that file (which file?) should look like with CONFIG_BIFRAVST_CLOUD_HOST_NAME set to a34x44yyrk96tg-ats.iot.eu-central-1.amazonaws.com?

coderbyheart commented 4 years ago

Is the application project configuration file this one? subsys/net/lib/bifravst_cloud/Kconfig and the value is set by adding the line here?

    default "a34x44yyrk96tg-ats.iot.eu-central-1.amazonaws.com"