Create chirpstack-gateway-bridge error

Why do I report this error when I use this creation

radiancegooplay@tmw023-ril023:~$ sudo chirpstack-gateway-bridge
    INFO[0000] starting ChirpStack Gateway Bridge            docs="https://www.chirpstack.io/gateway-bridge/" version=3.8.0
    INFO[0000] backend/semtechudp: starting gateway udp listener  addr="0.0.0.0:1700"
    FATA[0000] setup integration error: setup mqtt integration error: integration/mqtt: new GCP Cloud IoT Core authentication error: parse jwt key-file error: asn1: structure error: tags don't match (16 vs {class:0 tag:21 length:5 isCompound:false}) {optional:false explicit:false application:false private:false defaultValue:<nil> tag:<nil> stringType:0 timeType:0 set:false omitEmpty:false} pkcs8 @2 

This problem has been bothering me. My server has been deleted many times. No matter how I set this key, there will always be problems

I create the key with the following code

```
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1CE2AFD36DBCCA00

sudo echo "deb https://artifacts.chirpstack.io/packages/3.x/deb stable main" | sudo tee /etc/apt/sources.list.d/chirpstack.list
sudo apt-get update
```
[integration.mqtt.auth]
type="gcp_cloud_iot_core"

  [integration.mqtt.auth.gcp_cloud_iot_core]
  server="ssl://mqtt.googleapis.com:8883"
  device_id="gw-0102030405060708"
  project_id="chirpstack-stack-tutorial"
  cloud_region="europe-west1"
  registry_id="eu868-gateways"
  jwt_key_file="/path/to/private-key.pem"

You are not create the GCP jwt key by this.

read the following:

The official document is a private key. jwt_key_file="/path/to/private-key.pem" is no jwt

I still don’t understand what you mean

also read this: https://www.chirpstack.io/guides/google-cloud-platform/

I don’t know where to create this

Create LoRa gateway certificate

In order to authenticate the LoRa gateway with the Cloud IoT Core MQTT bridge, you need to generate a certificate. You can do this using the following commands:

ssh-keygen -t rsa -m PEM -b 4096 -f private-key.pemopenssl rsa -in private-key.pem -pubout -outform PEM -out public-key.pem

in your linux shell console of course.


use this? yes or no?

you can do that in the any linux shell. including where the chirpstack is installed. you just need the final output file to copy it to the right place.

I do whatever I type,But it’s still going to come out first

I don’t know what are you doing. and what you get.

I don’t understand FATA[0000] setup integration error: setup mqtt integration error: integration/mqtt: new GCP Cloud IoT Core authentication error: parse jwt key-file error: asn1: structure error: tags don’t match (16 vs {class:0 tag:21 length:5 isCompound:false}) {optional:false explicit:false application:false private:false defaultValue: tag: stringType:0 timeType:0 set:false omitEmpty:false} pkcs8 @2

Why did he report the mistake

b-cos you are not properly configured gcp integration. do all by guide in the my last link.

1 Like

I followed the document carefully. I’m try again

radiancegooplay@tmw023-ril023:~$ ssh-keygen -t rsa -m PEM -b 4096 -f private-key.pem
Generating public/private rsa key pair.
private-key.pem already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in private-key.pem.
Your public key has been saved in private-key.pem.pub.
The key fingerprint is:
SHA256:fPfBPNAW/3Qwby/wvT8av8oGu3WzTh2Z8K7v8YaU438 radiancegooplay@tmw023-ril023
The key's randomart image is:
+---[RSA 4096]----+
|              +  |
|             . * |
|            o.o *|
|       .     Bo+*|
|        S . . B*+|
|         . o .=++|
|            o=.X.|
|           .o.O.E|
|           .o=*XB|
+----[SHA256]-----+

Is it right for me to create like this?

radiancegooplay@tmw023-ril023:~$ sudo chirpstack-gateway-bridge
INFO[0000] starting ChirpStack Gateway Bridge            docs="https://www.chirpstack.io/gateway-bridge/" version=3.8.0
INFO[0000] backend/semtechudp: starting gateway udp listener  addr="0.0.0.0:1700"
FATA[0000] setup integration error: setup mqtt integration error: integration/mqtt: new GCP Cloud IoT Core authentication error: parse jwt key-file error: asn1: structure error: tags don't match (16 vs {class:2 tag:5 length:120 isCompound:false}) {optional:false explicit:false application:false private:false defaultValue:<nil> tag:<nil> stringType:0 timeType:0 set:false omitEmpty:false} pkcs8 @2 
radiancegooplay@tmw023-ril023:~$ 

It’s still a mistake

did you put the private-key.pem to the right place regarding the path configured in the .toml file ?

1 Like

I have solved my problem.

ssh-keygen -t rsa -m PEM -b 4096 -f private-key.pem
Generating public/private rsa key pair.

is error

should use new

You can generate a 2048-bit RSA key pair with the following commands:

openssl genpkey -algorithm RSA -out rsa_private.pem -pkeyopt rsa_keygen_bits:2048
openssl rsa -in rsa_private.pem -pubout -out rsa_public.pem

ok thank u @eugenev