Try to make the TC_TRUST from basicstation similar than the The Things Stack using the TC_TRUST Device Variable from the balenaCloud dashboard on the basicstation fleet.
For this I connect to the balena cli via ssh to the stack service and after that I would like to work with the commands of ttn-lw-cli.
But somehow I’m not authorized to do this commands:
/ $ ttn-lw-cli end-devices create fota mcdev \
> --frequency-plan-id EU_863_870 \
> --lorawan-version 1.0.3 \
> --lorawan-phy-version 1.0.3-a \
> --session.dev-addr 01FFFFFF \
> --session.keys.app-s-key.key f7d9667acd8eb1dde380751a8593eaec \
> --session.keys.nwk-s-key.key ff701d8368a4c6586048ffa29d8ae010 \
> --multicast \
> --supports-class-c
Flag --session.keys.nwk-s-key.key has been deprecated, use the session.keys.f_nwk_s_int_key.key flag
error:cmd/ttn-lw-cli/commands:unauthenticated (not authenticated with either API key or OAuth access token)
Then I tried the ttn-lw-cli login command but however, the ttn-lw-cli login command does not work:
/ $ ttn-lw-cli login
INFO Opening your browser on https://localhost/oauth/authorize?client_id=cli&redirect_uri=local-callback&response_type=code
WARN Could not open your browser, you'll have to go there yourself error=exec: "xdg-open,x-www-browser,www-browser": executable file not found in $PATH
INFO After logging in and authorizing the CLI, we'll get an access token for future commands.
INFO Waiting for your authorization...
Do you have a idea how to authorize these commands from the balena enviroment?
INFO Opening your browser on https://localhost/oauth/authorize?client_id=cli&redirect_uri=local-callback&response_type=code
WARN Could not open your browser, you'll have to go there yourself error=exec: "xdg-open,x-www-browser,www-browser": executable file not found in $PATH
INFO After logging in and authorizing the CLI, we'll get an access token for future commands.
INFO Waiting for your authorization...
/ $ ttn-lw-cli login --callback=false
INFO Opening your browser on https://localhost/oauth/authorize?client_id=cli&redirect_uri=code&response_type=code
WARN Could not open your browser, you'll have to go there yourself error=exec: "xdg-open,x-www-browser,www-browser": executable file not found in $PATH
INFO After logging in and authorizing the CLI, we'll get an access token for future commands.
INFO Please paste the authorization code and press enter
Then you have to go to the browser an type in: https://<container_ip_address>/oauth/authorize?client_id=cli&redirect_uri=code&response_type=code
for me it was: https://192.168.1.111/oauth/authorize?client_id=cli&redirect_uri=code&response_type=code
There I could copy the code:
But entering this code doesn’t work:
> MF2XI.QM6NQM2FRRPX4RCZNYWLP3OFK4XOLE3EVDATIDQ.7RVJXG5DFSLZXAJFLVFTVUB4VHGLXBFMZ7JSSEKBDABVAGBIZRFQ
ERROR Could not exchange OAuth access token error=Post "https://localhost/oauth/token": dial tcp 127.0.0.1:443: connect: connection refused
Post "https://localhost/oauth/token": dial tcp 127.0.0.1:443: connect: connection refused
/ $
@mpous haha yes but now I’m stuck…
Maybe @xoseperez knows what to do to fix this…
I really need to access the ttn-lw-cli to setup the FUOTA functionality.
Hi @Balena_Obrist and @mpous
Sorry for the late response. I spend some days away and had some time-critical projects due last week. But now back to the pleasant hobby projects Unfortunately, copying the TC_TRUST from the TTS device variable into a newly created basicstation TC_TRUST device variable didn’t solve the problem. I’m getting the same error: TLS server certificate verification failed: The certificate Common Name (CN) does not match with the expected CN.
What else could I check?
Best regards,
Lukas