Remote web interface acces

Hi

I change in the chirpstack-application-server.toml the http server to acces the web UI remotely, because I dont have the raspberry OS with GUI.

i did:

[application_server.external_api]
# ip:port to bind the (user facing) http server to (web-interface and REST / gRPC api)
bind="raspberryIP:8080"

After that:

Apr 16 20:55:09 raspberrypi chirpstack-application-server[8605]: time=“2022-04-16T20:55:09.231299052-04:00” level=info msg=“api/external: starting api server” bind=“192.168.0.19:8080” tls-cert= tls-key=
Apr 16 20:55:09 raspberrypi chirpstack-application-server[8605]: time=“2022-04-16T20:55:09.334689197-04:00” level=info msg=“api/external: registering rest api handler and documentation endpoint” path=/api
Apr 16 20:55:09 raspberrypi chirpstack-application-server[8605]: time=“2022-04-16T20:55:09.338015265-04:00” level=warning msg="[core] grpc: addrConn.createTransport failed to connect to {localhost:8080 localhost:8080 0 }. Err: connection error: desc = “transport: Error while dialing dial tcp [::1]:8080: connect: connection refused”. Reconnecting…"
Apr 16 20:55:09 raspberrypi chirpstack-application-server[8605]: time=“2022-04-16T20:55:09.338989528-04:00” level=warning msg="[core] grpc: addrConn.createTransport failed to connect to {localhost:8080 localhost:8080 0 }. Err: connection error: desc = “transport: Error while dialing dial tcp [::1]:8080: connect: connection refused”. Reconnecting…"

When I put the raspberryIP:8080 from my PC’s browser i got this error:
connection error: desc = “transport: Error while dialing dial tcp [::1]:8080: connect: connection refused” (code: 14)

Thanks a lot.

just make to listen all your ip-interfaces of your server in chirpstack-application-server.toml
by the string: bind=“0.0.0.0:8080”, not only 127.0.0.1 (localhost) and check your firewall rules.

1 Like

Hi @eugenev, thanks for your answer.

Already disabled the UFW, this is the .tml file, and still the same problem:

# This configuration sets the required settings and configures an integration
# with a MQTT broker. Many options and defaults have been omitted for
# simplicity.
#
# See https://www.chirpstack.io/application-server/install/config/ for a full
# configuration example and documentation.


# PostgreSQL settings.
#
# Please note that PostgreSQL 9.5+ is required.
[postgresql]
# PostgreSQL dsn (e.g.: postgres://user:password@hostname/database?sslmode=disable).
#
# Besides using an URL (e.g. 'postgres://user:password@hostname/database?sslmode=disable')
# it is also possible to use the following format:
# 'user=chirpstack_as dbname=chirpstack_as sslmode=disable'.
#
# The following connection parameters are supported:
#
# * dbname - The name of the database to connect to
# * user - The user to sign in as
# * password - The user's password
# * host - The host to connect to. Values that start with / are for unix domain sockets. (default is localhost)
# * port - The port to bind to. (default is 5432)
# * sslmode - Whether or not to use SSL (default is require, this is not the default for libpq)
# * fallback_application_name - An application_name to fall back to if one isn't provided.
# * connect_timeout - Maximum wait for connection, in seconds. Zero or not specified means wait indefinitely.
# * sslcert - Cert file location. The file must contain PEM encoded data.
# * sslkey - Key file location. The file must contain PEM encoded data.
# * sslrootcert - The location of the root certificate file. The file must contain PEM encoded data.
#
# Valid values for sslmode are:
#
# * disable - No SSL
# * require - Always SSL (skip verification)
# * verify-ca - Always SSL (verify that the certificate presented by the server was signed by a trusted CA)
# * verify-full - Always SSL (verify that the certification presented by the server was signed by a trusted CA and the server host name matches the one in the certificate)
dsn="postgres://chirpstack_as:(dbpassword)@localhost/chirpstack_as?sslmode=disable"


# Redis settings
#
# Please note that Redis 2.6.0+ is required.
[redis]
# Redis url (e.g. redis://user:password@hostname/0)
#
# For more information about the Redis URL format, see:
# https://www.iana.org/assignments/uri-schemes/prov/redis
url="redis://192.168.0.19:6379"


# Application-server settings.
[application_server]

  # Integration configures the data integration.
  #
  # This is the data integration which is available for all applications,
  # besides the extra integrations that can be added on a per-application
  # basis.
  [application_server.integration]
  # Payload marshaler.
  #
  # This defines how the MQTT payloads are encoded. Valid options are:
  # * protobuf:  Protobuf encoding
  # * json:      JSON encoding (easier for debugging, but less compact than 'protobuf')
  # * json_v3:   v3 JSON (will be removed in the next major release)
  marshaler="json_v3"

  # Enabled integrations.
  enabled=["mqtt"]

    # MQTT integration backend.
    [application_server.integration.mqtt]
    # Event topic template.
    event_topic_template="application/{{ .ApplicationID }}/device/{{ .DevEUI }}/event/{{ .EventType }}"

    # Command topic template.
    command_topic_template="application/{{ .ApplicationID }}/device/{{ .DevEUI }}/command/{{ .CommandType }}"

    # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
    server="tcp://192.168.0.19:1883"

    # Connect with the given username (optional)
    username=""

    # Connect with the given password (optional)
    password=""


    # Settings for the "internal api"
    #
    # This is the API used by ChirpStack Network Server to communicate with ChirpStack Application Server
    # and should not be exposed to the end-user.
    [application_server.api]
    # ip:port to bind the api server
    bind="192.168.0.19:8001"

    # Public ip:port of the application-server API.
    #
    # This is used by ChirpStack Network Server to connect to ChirpStack Application Server. When running
    # ChirpStack Application Server on a different host than ChirpStack Network Server, make sure to set
    # this to the host:ip on which ChirpStack Network Server can reach ChirpStack Application Server.
    # The port must be equal to the port configured by the 'bind' flag
    # above.
    public_host="192.168.0.19:8001"


    # Settings for the "external api"
    #
    # This is the API and web-interface exposed to the end-user.
    [application_server.external_api]
    # ip:port to bind the (user facing) http server to (web-interface and REST / gRPC api)
    bind="192.168.0.19:8080"

    # http server TLS certificate (optional)
    tls_cert=""

    # http server TLS key (optional)
    tls_key=""

    # JWT secret used for api authentication / authorization
    # You could generate this by executing 'openssl rand -base64 32' for example
    jwt_secret=""


# Join-server configuration.
#
# ChirpStack Application Server implements a (subset) of the join-api specified by the
# LoRaWAN Backend Interfaces specification. This API is used by ChirpStack Network Server
# to handle join-requests.
[join_server]


# Join-server configuration.
#
# ChirpStack Application Server implements a (subset) of the join-api specified by the
# LoRaWAN Backend Interfaces specification. This API is used by ChirpStack Network Server
# to handle join-requests.
[join_server]
# ip:port to bind the join-server api interface to
bind="192.168.0.19:8003"

Seems that here is something:

XXX@raspberrypi:~ $ sudo netstat -ltnp | grep -w ‘8080’
tcp 0 0 192.168.0.19:8080 0.0.0.0:* LISTEN 12268/chirpstack-ap

I should put my PC adress to the foreign adress? How can I change it?

Like @eugenev already mentioned, just put 0.0.0.0:8080 as bind value. That binds to all interfaces and doesn’t restrict usage to localhost only.