xoseperez / basicstation-docker

Basics™ Station Packet Forward protocol using Docker
42 stars 9 forks source link

station.conf missing #14

Closed symstopje closed 7 months ago

symstopje commented 7 months ago

Hi, I have hard time starting basicstation on Seed Studio RPI-200 with WM1302-SPI. RPI-200 (Linux 6.1.21-v8+). mPCIe connected with different pin numbers for reset than standard .

I managed to connect to AWS LPWAN but then I got a message: No such file (or not readable): station.conf

| ------------------------------------------------------------------
| BasicStation (TM) Packet Forwarder Container v2.8.0
| (c) Xose Pérez 2022-2024
|
| Based on:
|  * basicstation v2.0.6
|  * sx1302_hal v2.1.0
| ------------------------------------------------------------------
|
| Protocol
| ------------------------------------------------------------------
| Mode:          STATIC
| Protocol:      CUPS
| CUPS Server:   https://ALxxxxx2GEFP7.cups.lorawan.eu-central-1.amazonaws.com:443
| Gateway EUI:   0016C0xxxx
| EUI Source:    file
|
| Radio
| ------------------------------------------------------------------
| Model:         WM1302
| Concentrator:  SX1302
| Design:        CORECELL
| Interface:     SPI
| Radio Device:  /dev/spidev0.1
| SPI Speed:     2000000
| Reset GPIO:    5
| Enable GPIO:   6
| Enable Logic:  1
|
| 2024-02-21 10:47:40.806 [SYS:ERRO] No such file (or not readable): station.conf
symbasicstation2 exited with code 1

my composer file looks like:

version: '2.0'
services:
  basicstation:
    image: xoseperez/basicstation:aarch64-latest
    container_name: symbasicstation2
    restart: unless-stopped
    privileged: true        
GATEWAY_EUI manually

    environment:
      MODEL: "WM1302"
      INTERFACE: "SPI"
      DEVICE: "/dev/spidev0.1"
      RESET_GPIO: 5
      POWER_EN_GPIO: 6
      POWER_EN_LOGIC: 1
      SPI_SPEED: 2000000
      GATEWAY_EUI: "0016c0xxxxxxx"

      USE_CUPS: 1
      CUPS_URI: "https://ALS0MVS2GEFP7.cups.lorawan.eu-central-1.amazonaws.com:443"
      CUPS_TRUST: "-----BEGIN CERTIFICATE-----
MIIEdTCCA12gAwIBAgIJAKcOSkw0grd/MA0GCSqGSIb3DQEBCwUAMGgxCzAJBgNV
BAYTAlVTMSUwIwYDVQQKExxTdGFyZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTIw
      CUPS_CRT: "-----BEGIN CERTIFICATE-----
MIIDWTCCAkGgAwIBAgIUfgccagHcIF3P4gaZ/yJL0ld0au0wDQYJKoZIhvcNAQEL
BQAwTTFLMEkGA1UECwxCQW1hem9uIFdlYiBTZXJ2aWNlcyBPPUFtYXpvbi5jb20g
      CUPS_KEY: "-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAo+bIYmIP9XQk9agAYCK0SxdtrF/WldwqpMKfxFmpkfyn4nNJ

BR, Jerzy

BR, Jerzy

xoseperez commented 7 months ago

Hi @symstopje

(I edited your comment to format the code and make it readable)

Can you share your docker-compose.yml file complete (but without the keys)? There is a "GATEWAY_EUI manually" in the middle I'm not sure what it is. Also, the MODE: STATIC in the header indicates it's loading the config from a mounted station.conf file. Do you have anything defined in your volumes section in the yaml?

symstopje commented 7 months ago

Hi,

This is complete docker-compose.yml (except rest of CUPS keys/certs ): docker-compose.yml.txt

_GATEWAYEUI manually - comes from wrongly formatted comment in previous line

I now managed to run the service - it is great repository. But I had to manually copy station.conf inside the docker from station.json. I have also rebuilt the image locally.

BR, Jerzy

xoseperez commented 7 months ago

Hi @symstopje You have a configuration folder mounted. Looks like the container does not have permissions to create files in that folder, hence it fails creating the station.conf file. If you are not going to tweak the station.conf file (custom channels, radio configuration,....) I'd suggest not to mount it. Otherwise delete the folder altogether and let docker create it itself since you are providing all credentials as environment variables.

xoseperez commented 7 months ago

Hello again @symstopje My bad, there was a stupid bug in the latest push... fixed it now. Should work fine.

symstopje commented 7 months ago

Hi, Thank you for the correction - issue with the station.conf seems to be gone now. I still have problem that RESET_GPIO is ignored. It stays 17 even if I change it to 22. SPI_SPEED and DEVICE are correctly carried on to configuration.

version: '2.0' services: basicstation: image: xoseperez/basicstation:latest container_name: symbasicstation restart: unless-stopped privileged: true network_mode: host environment: MODEL: "IC880A" INTERFACE: "SPI" DEVICE: "/dev/spidev0.0" USE_LIBGPIOD: 0 RESET_GPIO: 22 SPI_SPEED: 2000000 USE_CUPS: 1

This is different problem - should I write separate issue?

I am trying different concentrators - previous was VM1302 - but issues are similar. I must be doing something wrong

xoseperez commented 7 months ago

I'm struggling to reproduce this error. Need more info. Can you upload the log of the service?

symstopje commented 7 months ago

Hi, Here is compose.yml with edited certs: compose.txt

Here is file with logs: basicstation.log

What I do is:

  1. clone your repository
  2. enter basicstation directory
  3. replace docker-compose with the attached version
  4. run docker compose up

I am using CM4 based system with 64 bit raspbian

xoseperez commented 7 months ago

I think you are using the version from the docker hub, try using GW_RESET_GPIO instead of RESET_GPIO. This has been changed in the latest version in master which is not yet pushed to docker hub.

I will add a notice about versions in the setting tht change... this is a "forwards compatibility" problem :)

symstopje commented 7 months ago

Thank you. GW_RESET_GPIO and docker hub image works fine.

I tried also to build image with basicstation:

image: xoseperez/basicstation:latest

build:
  context: .
  args:
    ARCH: aarch64
    REMOTE_TAG: v2.0.6
    VARIANT: std

but I receive build errors: => [basicstation internal] load build context 0.2s => => transferring context: 496.78kB 0.1s => CACHED [basicstation runner 1/9] FROM docker.io/balenalib/aarch64-debian:buster-run@sha256:78aa46631e81f9dcc3aad46546c32920b1f08bb2bd6ae383df0315a554ae222 0.0s => => resolve docker.io/balenalib/aarch64-debian:buster-run@sha256:78aa46631e81f9dcc3aad46546c32920b1f08bb2bd6ae383df0315a554ae2224 0.0s => ERROR [basicstation runner 2/9] RUN install_packages jq vim gpiod socat 0.6s

[basicstation runner 2/9] RUN install_packages jq vim gpiod socat:

failed to solve: process "/bin/sh -c install_packages jq vim gpiod socat" did not complete successfully: exit code: 159

but build returns errors

symstopje commented 7 months ago

I check from fresh git clone on other similar system (original with WM1302) and everything went well with build within compose file. I guess I need to restart fresh on the other system. Thanks a lot for your help.