Setting up Chirpstack Application Server and connecting a device

Hi,

I have an Agora Board and I have managed to connect through TTIG gateway to TTN and send data that I could see from the TTN console. In order to setup the Agora Board I need 3 hex numbers:

static uint8_t DEV_EUI[] = { 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX };
static uint8_t APP_EUI[] = { 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX };
static uint8_t APP_KEY[] = { 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX };

DEV_EUI: is the EUI of the TTIG gateway
APP_EUI:: is the EUI of the device I have setup in the Applications Tab of the TTN dashboard
APP_KEY: is the the KEY of the device I have setup in the Applications Tab of the TTN dashboard

I’m trying to do something similar with the Chirpstack setup and Chirpstack OS. I have the following setup

  1. In a private computer I have the dockerised version:

version: “3”

services:
chirpstack-network-server:
image: chirpstack/chirpstack-network-server:3
ports:
- 5433:5432
volumes:
- ./chirpstack/Volumes/chirpstack-network-server:/etc/chirpstack-network-server
networks:
vpcbr:
ipv4_address: 172.20.0.2
depends_on:
- postgresql
- mosquitto

chirpstack-application-server:
build:
context: ./chirpstack/Dockerfiles/chirpstack-application-server
ports:
- 8080:8080
volumes:
- ./chirpstack/Volumes/chirpstack-application-server:/etc/chirpstack-application-server
networks:
vpcbr:
ipv4_address: 172.20.0.3
depends_on:
- chirpstack-network-server

chirpstack-geolocation-server:
build:
context: ./chirpstack/Dockerfiles/chirpstack-geolocation-server
ports:
- 8005:8005
networks:
vpcbr:
ipv4_address: 172.20.0.5
volumes:
- ./chirpstack/Volumes/chirpstack-geolocation-server:/etc/chirpstack-geolocation-server

postgresql:
image: postgres:9.6-alpine
ports:
- 5432:5432
environment:
- POSTGRES_PASSWORD=XXXXX
volumes:
- ./postgresql/initdb:/docker-entrypoint-initdb.d
- postgresqldata:/var/lib/postgresql/data
networks:
vpcbr:
ipv4_address: 172.20.0.6

redis:
image: redis:5-alpine
ports:
- 6379:6379
volumes:
- redisdata:/data
networks:
vpcbr:
ipv4_address: 172.20.0.7

mosquitto:
image: eclipse-mosquitto:2
ports:
- 1883:1883
volumes:
- ./eclipse-mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf
networks:
vpcbr:
ipv4_address: 172.20.0.8

networks:
vpcbr:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/24
gateway: 172.20.0.1

volumes:
postgresqldata:
redisdata:

  1. In a raspberrypi3 with iC880A concentrator I have installed the ChirpstackOS basic version
raspberrypi3:~$ sudo monit summary
Password: 
Monit 5.27.2 uptime: 27m
┌────────────────────────────┬────────┬─────────┐
│ Service Name               │ Status │ Type    │
├────────────────────────────┼────────┼─────────┤
│ raspberrypi3               │ OK     │ System  │
├────────────────────────────┼────────┼─────────┤
│ chirpstack-gateway-bridge  │ OK     │ Process │
├────────────────────────────┼────────┼─────────┤
│ chirpstack-concentratord   │ OK     │ Process │

So I suppose the concentrator and the gateway bridge is correct.

When I also run up the chirpstack application, network etc then in my logs I see:

start all
services: 
Starting docker-chirpstack_mosquitto_1                     ... done
Starting docker-chirpstack_postgresql_1                    ... done
Starting docker-chirpstack_redis_1                         ... done
Starting docker-chirpstack_chirpstack-geolocation-server_1 ... done
Starting docker-chirpstack_chirpstack-network-server_1     ... done
Starting docker-chirpstack_chirpstack-application-server_1 ... done
....

And then

mosquitto_1                      | 1634500863: New connection from 192.168.1.5:55924 on port 1883.
mosquitto_1                      | 1634500863: New client connected from 192.168.1.5:55924 as auto-BF6C2297-A415-255D-51BD-B8C0CC3C2A2E (p2, c1, k30).
chirpstack-network-server_1      | time="2021-10-17T20:01:35.141039389Z" level=info msg="gateway/mqtt: gateway stats packet received" gateway_id=b827ebfffe048ecf stats_id=ab3bb3af-2a55-4e48-bcad-8a7c4667feef
chirpstack-network-server_1      | time="2021-10-17T20:01:35.14420087Z" level=error msg="gateway: handle gateway stats error" ctx_id=ab3bb3af-2a55-4e48-bcad-8a7c4667feef error="update gateway state error: object does not exist"

I’m not sure about the error, but it seems that the raspberrypi has been connected to the chirpstack network server and then to the chirpstack application server.

In the Chirpstack Application server I have setup the following:

  1. Chirpstack Network server with ip 172.20.0.2:8000 (not sure how 8000 came up but I found it by connecting to the Application server and nmap to 172.20.0.2 my Network server)
  2. Gateway Profile for my Raspberry pi, Stats Interval: 30sec, Enabled Channels: 0, 1, 2
  3. Service Profile:

Device-status request frequency:1
Minimum allowed data-rate: 0
Maximum allowed data-rate : 0
Some other values it has not sure if it plays a role

  1. Device Profile:

LoRaWAN MAC version : 1.0.0 (as in TTN)
LoRaWAN Regional Parameters revision: A (Not sure)
(Europe 863-870 MHz (SF9 for RX2 - recommended) in TTN)
ADR algorithm: Default ADR Algorithm
Max EIRP: 0
Uplink interval (seconds) *: 40

In Join (OTAA/ABP) everything is the default the same for the other tabs
5. Gateways: I setup raspberry pi by using The Service/Gateway Profile I mentioned.
6. Applications: I added the Agora Device and in Activation Tab:

Device address : 00 00 00 00 (not sure how to get AddrPrefix (derived from the NetID) + NwkAddr. from Raspberrypi (Currently I have the DEV_EUI by running: ip link show “wlan0” | awk ‘/ether/ {print $2}’ | awk -F: ‘{print $1"-"$2"-"$3"-FF-FE-"$4"-"$5"-"$6}’
Network session key (LoRaWAN 1.0) *: I used a similar to TTN APP_KEY
Application session key (LoRaWAN 1.0) *: similar to the previous
Uplink frame-counter *: -
Downlink frame-counter (network) *: 0

However in Gateways Tab Last Seen: Never, in Gateway Discover:

No gateway discovery data is available (yet). This could mean:

  • no discovery ‘ping’ was emitted yet
  • the gateway ping feature has been disabled in ChirpStack Application Server
  • the discovery ‘ping’ was not received by any other gateways

And in Applications again I have N/A in Last Seen for my Agora Device. The agora device cannot connect to the Raspberry and I have timout error.

Any direction would be helpful

Thanks

See my reply to your other question in: Chirpstack OS package manager - #5 by brocaar.