TTS Open Source - Starting a local version leads to a network server error

mattp
Tue, 28 Jan 2025 10:53:08 +0000
How to get started

Hello dear experts.

Here is some context.

I want to run The Things Stack Open Source Edition on a device with a customized OS, which will be permanently running a local instance of the server.
I want to use it to connect gateways and devices, and I will retransmit data flow on another server, and this other server will also ask the TTS one to manage devices (I will use the API for that).

It is important to note I can’t have access to docker on this device.
This is why I deployed TTS from the “releases” files (for armv7).

I achieved to launch the following (I’ll explain later why I am forced to use the flags):

./ttn-lw-stack start as is js console gs

It starts correctly.
I can log in as an admin, and create a new application.

I assume that it is because I do not have the Network Server running that I cannot use the console to add devices in an application (I get an ‘Error 404’ when I want to).
I did get the “data” folders, with the lorawan-devices, lorawan-devices-index and lorawan-frequency-plans folders.

INFO    Client error    {"auth.token_id": "4ZGMSUJYQ2AYGIG5LGKCHSYCRWHDNCRGBW23XCQ", "auth.token_type": "AccessToken", "duration": 0.0193, "http.method": "GET", "http.path": "/api/v3/dr/applications/testing-app/brands", "http.status": 404, "namespace": "web", "peer.address": "192.168.2.150:53771", "request_id": "01C2T4HS3HFGW3BDE6466AQ0EM"}

But I cannot add the flag ‘ns’ (or only using ‘start’ without components flags), or the following error appears:

DEBUG   Subscribed      {"namespace": "applicationserver/io/packages"}
error:cmd/internal/shared:initialize_join_server (initialize Join Server)
    correlation_id=40604e0fc88b4d4e8e5fa4605fa9f06b
--- error:pkg/errors:syscall (`write` failed)
    timeout=false
    syscall=write
    error=broken pipe
    correlation_id=d7f88daf33bf4f5dbf20bda90d5c5ab4
--- broken pipe

Adding the network server brings the Join Server to an error.

EDIT:

I tried without the JS, but with the NS. (I also disabled the JS in the “Console” section of the configuration file to test).
It does not crash, but I have this constant error:

WARN    Task failed     {"error": "broken pipe", "error_cause": "broken pipe", "invocation": 8, "namespace": "networkserver", "syscall": "write", "task_id": "process_downlink_0", "timeout": false}
ERROR   Failed to pop entry from downlink task queue    {"error": "broken pipe", "error_cause": "broken pipe", "namespace": "networkserver", "syscall": "write", "timeout": false}
go.thethings.network/lorawan-stack/v3/pkg/log.(*zapHandler).HandleLog
        /home/runner/work/lorawan-stack/lorawan-stack/pkg/log/zap_handler.go:84
go.thethings.network/lorawan-stack/v3/pkg/log.(*Logger).Use.func1
        /home/runner/work/lorawan-stack/lorawan-stack/pkg/log/logger.go:55
go.thethings.network/lorawan-stack/v3/pkg/log.HandlerFunc.HandleLog
        /home/runner/work/lorawan-stack/lorawan-stack/pkg/log/handler.go:38
go.thethings.network/lorawan-stack/v3/pkg/log/middleware/observability.(*observability).Wrap.func1
        /home/runner/work/lorawan-stack/lorawan-stack/pkg/log/middleware/observability/observability.go:86
go.thethings.network/lorawan-stack/v3/pkg/log.HandlerFunc.HandleLog
        /home/runner/work/lorawan-stack/lorawan-stack/pkg/log/handler.go:38
go.thethings.network/lorawan-stack/v3/pkg/log.(*Logger).commit
        /home/runner/work/lorawan-stack/lorawan-stack/pkg/log/logger.go:75
go.thethings.network/lorawan-stack/v3/pkg/log.(*entry).commit
        /home/runner/work/lorawan-stack/lorawan-stack/pkg/log/entry.go:69
go.thethings.network/lorawan-stack/v3/pkg/log.(*entry).Error
        /home/runner/work/lorawan-stack/lorawan-stack/pkg/log/entry.go:94
go.thethings.network/lorawan-stack/v3/pkg/networkserver.(*NetworkServer).processDownlinkTask
        /home/runner/work/lorawan-stack/lorawan-stack/pkg/networkserver/downlink.go:2234
go.thethings.network/lorawan-stack/v3/pkg/networkserver.New.(*NetworkServer).createProcessDownlinkTask.func17
        /home/runner/work/lorawan-stack/lorawan-stack/pkg/networkserver/downlink.go:1892
go.thethings.network/lorawan-stack/v3/pkg/task.Func.Execute
        /home/runner/work/lorawan-stack/lorawan-stack/pkg/task/task.go:47
go.thethings.network/lorawan-stack/v3/pkg/task.DefaultStartTask.func1
        /home/runner/work/lorawan-stack/lorawan-stack/pkg/task/task.go:167
WARN    Task failed     {"error": "broken pipe", "error_cause": "broken pipe", "invocation": 9, "namespace": "networkserver", "syscall": "write", "task_id": "process_downlink_0", "timeout": false}

It sure might be because of my configuration.
I am using the .ttn-lw-stack.yml file, but some things are still hard to understand for me.
Of course, because I am running the stack on a localhost, I am not using TLS, and I set everything related to TLS and certificate to empty or disabled.

First of all, which server do I really need to run ?
Then, what about interoperability ? I did not really understood if I need it for my case, and if I need it to be configured to make the other components working.

Thanks for your help.

If necessary, I can paste my configuration file, but I will only paste my NS configuration for a better reading of this already long post.

Network Server configuration part:

ns:
  application-uplink-queue:
    buffer-size: 1000
    fast-buffer-size: 16384
    fast-num-consumers: 128
    num-consumers: 1
  cluster-id: ""
  cooldown-window: 1s
  deduplication-window: 200ms
  default-mac-settings:
    adr-margin: 15
    class-b-timeout: 10m0s
    class-c-timeout: 5m0s
    desired-adr-ack-delay-exponent: ""
    desired-adr-ack-limit-exponent: ""
    desired-max-duty-cycle: ""
    desired-rx1-delay: "5"
    status-count-periodicity: 200
    status-time-periodicity: 24h0m0s
  dev-addr-prefixes: []
  device-kek-label: ""
  downlink-priorities:
    join-accept: highest
    mac-commands: highest
    max-application-downlink: high
  downlink-queue-capacity: 10000
  downlink-task-queue:
    num-consumers: 1
  interop:
    blob:
      bucket: ""
      path: ""
    config-source: ""
    directory: ""
    id: ""
    url: ""
  net-id: "000000"

12 posts - 2 participants