### Start ChirpStack with Docker Compose Source: https://github.com/chirpstack/chirpstack-docker/blob/master/README.md This command initiates all services defined in the docker-compose.yml file. Access the ChirpStack UI at http://localhost:8080. ```bash docker compose up ``` -------------------------------- ### Start ChirpStack Docker Stack Source: https://context7.com/chirpstack/chirpstack-docker/llms.txt Use these Docker Compose commands to manage the ChirpStack stack. Start all services, run in the background, view logs, or stop the stack. ```bash # Start the entire ChirpStack stack docker compose up # Start in detached mode (background) docker compose up -d # View logs for a specific service docker compose logs -f chirpstack # Stop the stack docker compose down ``` -------------------------------- ### Import Device Profiles with Make Source: https://github.com/chirpstack/chirpstack-docker/blob/master/README.md This command clones the chirpstack-device-profiles repository and executes the import command for ChirpStack. Ensure 'make' is installed. ```bash make import-device-profiles ``` -------------------------------- ### Interact with ChirpStack REST API Source: https://context7.com/chirpstack/chirpstack-docker/llms.txt Curl examples for accessing ChirpStack's REST API to list tenants, applications, devices, and create new devices. Requires a generated API token. ```bash # REST API - Get API token (after logging in via web UI) # Access Swagger UI at http://localhost:8090 # Example: List tenants via REST API curl -X GET "http://localhost:8090/api/tenants" \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" ``` ```bash # Example: List applications curl -X GET "http://localhost:8090/api/applications?limit=10" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` ```bash # Example: List devices in an application curl -X GET "http://localhost:8090/api/devices?applicationId=APP_ID&limit=10" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` ```bash # Example: Create a device curl -X POST "http://localhost:8090/api/devices" \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "device": { "devEui": "0102030405060708", "name": "my-device", "applicationId": "APP_ID", "deviceProfileId": "PROFILE_ID", "description": "Test device" } }' ``` -------------------------------- ### Region Configuration (EU868) Source: https://context7.com/chirpstack/chirpstack-docker/llms.txt Configure region-specific settings for ChirpStack, such as gateway backend and network parameters. This example shows the configuration for the EU868 region, including MQTT gateway backend details and channel definitions. ```toml [[regions]] id="eu868" description="EU868" common_name="EU868" # Gateway configuration [regions.gateway] force_gws_private=false [regions.gateway.backend] enabled="mqtt" [regions.gateway.backend.mqtt] topic_prefix="eu868" server="tcp://$MQTT_BROKER_HOST:1883" qos=0 clean_session=false keep_alive_interval="30s" # Channel configuration for EU868 [[regions.gateway.channels]] frequency=868100000 bandwidth=125000 modulation="LORA" spreading_factors=[7, 8, 9, 10, 11, 12] [[regions.gateway.channels]] frequency=868300000 bandwidth=125000 modulation="LORA" spreading_factors=[7, 8, 9, 10, 11, 12] [[regions.gateway.channels]] frequency=868500000 bandwidth=125000 modulation="LORA" spreading_factors=[7, 8, 9, 10, 11, 12] # Network parameters [regions.network] installation_margin=10 rx_window=0 rx1_delay=1 rx2_dr=0 rx2_frequency=869525000 downlink_tx_power=-1 adr_disabled=false min_dr=0 max_dr=5 # Class-B configuration [regions.network.class_b] ping_slot_dr=3 ping_slot_frequency=0 ``` -------------------------------- ### Switch ChirpStack Gateway Bridge to US915 Region Source: https://context7.com/chirpstack/chirpstack-docker/llms.txt Example of updating docker-compose.yml environment variables and command to switch the Gateway Bridge to the US915 region. ```yaml # docker-compose.yml - Switch to US915 chirpstack-gateway-bridge: environment: - INTEGRATION__MQTT__EVENT_TOPIC_TEMPLATE=us915_0/gateway/{{ .GatewayID }}/event/{{ .EventType }} - INTEGRATION__MQTT__STATE_TOPIC_TEMPLATE=us915_0/gateway/{{ .GatewayID }}/state/{{ .StateType }} - INTEGRATION__MQTT__COMMAND_TOPIC_TEMPLATE=us915_0/gateway/{{ .GatewayID }}/command/# chirpstack-gateway-bridge-basicstation: command: -c /etc/chirpstack-gateway-bridge/chirpstack-gateway-bridge-basicstation-us915_0.toml ``` -------------------------------- ### Initialize PostgreSQL Database Extensions Source: https://context7.com/chirpstack/chirpstack-docker/llms.txt A bash script to initialize the PostgreSQL database by creating necessary extensions like pg_trgm and hstore. ```bash #!/bin/bash set -e psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname="$POSTGRES_DB" <<-EOSQL create extension pg_trgm; create extension hstore; EOSQL ``` -------------------------------- ### Import Device Profiles with Make Source: https://context7.com/chirpstack/chirpstack-docker/llms.txt Use the Make command to import pre-configured device profiles from the official repository. This process clones the repository and runs the ChirpStack import command. ```bash # Import device profiles using Make make import-device-profiles # This command: # 1. Clones the chirpstack-device-profiles repository # 2. Executes the ChirpStack import command # 3. Adds device templates for common hardware ``` -------------------------------- ### Gateway Bridge Basics Station Configuration Source: https://context7.com/chirpstack/chirpstack-docker/llms.txt Sets up the ChirpStack Gateway Bridge for the Basics Station protocol in the EU868 region. Includes MQTT authentication, topic templates, and concentrator configurations. ```toml # MQTT authentication [integration.mqtt.auth.generic] servers=["tcp://mosquitto:1883"] username="" password="" # MQTT topic templates [integration.mqtt] event_topic_template="eu868/gateway/{{ .GatewayID }}/event/{{ .EventType }}" state_topic_template="eu868/gateway/{{ .GatewayID }}/state/{{ .StateType }}" command_topic_template="eu868/gateway/{{ .GatewayID }}/command/#" # Basics Station backend [backend] type="basic_station" [backend.basic_station] bind=":3001" tls_cert="" tls_key="" ca_cert="" region="EU868" frequency_min=863000000 frequency_max=870000000 # Concentrator configuration [[backend.basic_station.concentrators]] [backend.basic_station.concentrators.multi_sf] frequencies=[ 868100000, 868300000, 868500000, 867100000, 867300000, 867500000, 867700000, 867900000, ] [backend.basic_station.concentrators.lora_std] frequency=868300000 bandwidth=250000 spreading_factor=7 [backend.basic_station.concentrators.fsk] frequency=868800000 ``` -------------------------------- ### Subscribe to ChirpStack MQTT Gateway Events Source: https://context7.com/chirpstack/chirpstack-docker/llms.txt Bash commands to subscribe to various MQTT topics for gateway events, state updates, and commands using mosquitto_sub. ```bash # Subscribe to all gateway events for EU868 region mosquitto_sub -h localhost -t "eu868/gateway/+/event/#" -v # Subscribe to uplink events mosquitto_sub -h localhost -t "eu868/gateway/+/event/up" -v # Subscribe to gateway state updates mosquitto_sub -h localhost -t "eu868/gateway/+/state/#" -v ``` -------------------------------- ### Access ChirpStack Web Interface and API Source: https://context7.com/chirpstack/chirpstack-docker/llms.txt Access the ChirpStack web UI and REST API Swagger UI after the stack is running. Default admin credentials are provided for the initial login. ```bash # ChirpStack Web UI - main application interface # Access at: http://localhost:8080 # ChirpStack REST API - Swagger UI for API exploration # Access at: http://localhost:8090 # Default admin credentials (first login): # Username: admin # Password: admin ``` -------------------------------- ### ChirpStack Main Configuration Source: https://context7.com/chirpstack/chirpstack-docker/llms.txt The main ChirpStack configuration file (`chirpstack.toml`) controls network server behavior, enabled regions, API settings, and integrations. Adjust logging levels, database connections, Redis cache settings, and API endpoints as needed. ```toml # Logging configuration [logging] level="info" # Options: trace, debug, info, warn, error # PostgreSQL database connection [postgresql] dsn="postgres://chirpstack:chirpstack@$POSTGRESQL_HOST/chirpstack?sslmode=disable" max_open_connections=10 min_idle_connections=0 # Redis cache configuration [redis] servers=["redis://$REDIS_HOST/"] tls_enabled=false cluster=false # Network configuration [network] net_id="000000" enabled_regions=[ "eu868", "us915_0", "us915_1", "au915_0", "as923", "as923_2", "in865", "kr920", ] # API configuration [api] bind="0.0.0.0:8080" secret="you-must-replace-this" # Generate with: openssl rand -base64 32 # MQTT integration for device data [integration] enabled=["mqtt"] [integration.mqtt] server="tcp://$MQTT_BROKER_HOST:1883/" json=true ``` -------------------------------- ### Docker Compose Service Definitions Source: https://context7.com/chirpstack/chirpstack-docker/llms.txt Defines the complete ChirpStack service stack in Docker Compose. Includes configurations for the network server, REST API proxy, PostgreSQL, Redis, and Mosquitto MQTT broker. ```yaml services: # ChirpStack Network Server chirpstack: image: chirpstack/chirpstack:4 command: -c /etc/chirpstack restart: unless-stopped volumes: - ./configuration/chirpstack:/etc/chirpstack depends_on: - postgres - mosquitto - redis environment: - MQTT_BROKER_HOST=mosquitto - REDIS_HOST=redis - POSTGRESQL_HOST=postgres ports: - "8080:8080" # Web UI and gRPC API # REST API proxy chirpstack-rest-api: image: chirpstack/chirpstack-rest-api:4 restart: unless-stopped command: --server chirpstack:8080 --bind 0.0.0.0:8090 --insecure ports: - "8090:8090" # REST API with Swagger UI depends_on: - chirpstack # PostgreSQL database postgres: image: postgres:14-alpine restart: unless-stopped volumes: - ./configuration/postgresql/initdb:/docker-entrypoint-initdb.d - postgresqldata:/var/lib/postgresql/data environment: - POSTGRES_USER=chirpstack - POSTGRES_PASSWORD=chirpstack - POSTGRES_DB=chirpstack # Redis cache redis: image: redis:7-alpine restart: unless-stopped command: redis-server --save 300 1 --save 60 100 --appendonly no volumes: - redisdata:/data # MQTT broker mosquitto: image: eclipse-mosquitto:2 restart: unless-stopped ports: - "1883:1883" # MQTT port volumes: - ./configuration/mosquitto/config/:/mosquitto/config/ volumes: postgresqldata: redisdata: ``` -------------------------------- ### Gateway Bridge UDP Configuration Source: https://context7.com/chirpstack/chirpstack-docker/llms.txt Configures the ChirpStack Gateway Bridge for UDP communication. Sets the Semtech UDP Packet Forwarder port and environment variables for MQTT topic templates. ```yaml # docker-compose.yml - Gateway Bridge UDP configuration chirpstack-gateway-bridge: image: chirpstack/chirpstack-gateway-bridge:4 restart: unless-stopped ports: - "1700:1700/udp" # Semtech UDP Packet Forwarder port volumes: - ./configuration/chirpstack-gateway-bridge:/etc/chirpstack-gateway-bridge environment: # Configure MQTT topics with region prefix - INTEGRATION__MQTT__EVENT_TOPIC_TEMPLATE=eu868/gateway/{{ .GatewayID }}/event/{{ .EventType }} - INTEGRATION__MQTT__STATE_TOPIC_TEMPLATE=eu868/gateway/{{ .GatewayID }}/state/{{ .StateType }} - INTEGRATION__MQTT__COMMAND_TOPIC_TEMPLATE=eu868/gateway/{{ .GatewayID }}/command/# depends_on: - mosquitto ``` -------------------------------- ### Configure Mosquitto MQTT Broker Source: https://context7.com/chirpstack/chirpstack-docker/llms.txt Basic configuration for the Mosquitto MQTT broker, allowing anonymous access on port 1883. ```conf listener 1883 allow_anonymous true ``` -------------------------------- ### US915 Region Configuration Source: https://context7.com/chirpstack/chirpstack-docker/llms.txt Defines the US915 region settings, including gateway backend and network configurations. Specifies frequencies, bandwidth, modulation, spreading factors, and enabled uplink channels. ```toml [[regions]] id="us915_0" description="US915 (channels 0-7 + 64)" common_name="US915" [regions.gateway] force_gws_private=false [regions.gateway.backend] enabled="mqtt" [regions.gateway.backend.mqtt] topic_prefix="us915_0" server="tcp://$MQTT_BROKER_HOST:1883" # US915 channels (sub-band 1) [[regions.gateway.channels]] frequency=902300000 bandwidth=125000 modulation="LORA" spreading_factors=[7, 8, 9, 10] [[regions.gateway.channels]] frequency=902500000 bandwidth=125000 modulation="LORA" spreading_factors=[7, 8, 9, 10] # 500kHz channel [[regions.gateway.channels]] frequency=903000000 bandwidth=500000 modulation="LORA" spreading_factors=[8] [regions.network] installation_margin=10 rx1_delay=1 rx2_dr=8 rx2_frequency=923300000 min_dr=0 max_dr=3 enabled_uplink_channels=[0, 1, 2, 3, 4, 5, 6, 7, 64] ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.