Giter VIP home page Giter VIP logo

chirpstack-ansible-playbook's Introduction

ChirpStack open-source LoRaWAN(R) Network Server

CI

ChirpStack is an open-source LoRaWAN(R) Network Server which can be used to set up LoRaWAN networks. ChirpStack provides a web-interface for the management of gateways, devices and tenants as well to set up data integrations with the major cloud providers, databases and services commonly used for handling device data. ChirpStack provides a gRPC based API that can be used to integrate or extend ChirpStack.

Documentation and binaries

Please refer to the ChirpStack website for documentation and pre-compiled binaries.

Building from source

Requirements

Building ChirpStack requires:

Nix

Nix is used for setting up the development environment which is used for local development and for creating the binaries.

If you do not have Nix installed and do not wish to install it, then you can use the provided Docker Compose based Nix environment. To start this environment execute the following command:

make docker-devshell

Note: You will be able to run the test commands and run cargo build, but cross-compiling will not work within this environment (because it would try start Docker within Docker).

Docker

Docker is used by cross-rs for cross-compiling, as well as some of the make commands.

Starting the development shell

Run the following command to start the development shell:

nix-shell

Or if you do not have Nix installed, execute the following command:

make docker-devshell

Building the UI

To build the ChirpStack UI, execute the following command:

make build-ui

Running ChirpStack tests

Start required services

ChirpStack requires several services like PostgresQL, Redis, Mosquitto, ... to be running before you can run the tests. You need to start these services manually if you started the development shell using nix-shell:

docker compose up -d

Run tests

Run the following command to run the ChirpStack tests:

# Test (with PostgresQL database backend)
make test

# Test with SQLite database backend
DATABASE=sqlite make test

Building ChirpStack binaries

Before compiling the binaries, you need to install some additional development tools (for cross-compiling, packaging, e.d.). Execute the following command:

make dev-dependencies

Run the following command within the ./chirpstack sub-folder:

# Build AMD64 debug build (optimized for build speed)
make debug-amd64

# Build AMD64 release build (optimized for performance and binary size)
make release-amd64

# Build all packages (all targets, .deb, .rpm and .tar.gz files)
make dist

By default the above commands will build ChirpStack with the PostgresQL database database backend. Set the DATABASE=sqlite env. variable to compile ChirpStack with the SQLite database backend.

Database migrations

To create a new database migration, execute:

make migration-generate NAME=test-migration

To apply migrations, execute:

make migration-run

To revert a migration, execute:

make migration-revert

By default the above commands will execute the migration commands using the PostgresQL database backend. To execute migration commands for the SQLite database backend, set the DATABASE=sqlite env. variable.

License

ChirpStack Network Server is distributed under the MIT license. See also LICENSE.

chirpstack-ansible-playbook's People

Contributors

brocaar avatar kasraghu avatar maikumori avatar scriptopathe avatar techwolf12 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chirpstack-ansible-playbook's Issues

vagrant up error on TASK [postgresql : create role]

TASK [postgresql : create role] ************************************************
fatal: [vagrant]: FAILED! => {"msg": "Failed to set permissions on the temporary files Ansible needs to create when becoming an unprivileged user (rc: 1, err: chown: changing ownership of '/var/tmp/ansible-tmp-1537296109.78-112928098131943/': Operation not permitted\nchown: changing ownership of '/var/tmp/ansible-tmp-1537296109.78-112928098131943/postgresql_user.py': Operation not permitted\n}). For information on working around this, see https://docs.ansible.com/ansible/become.html#becoming-an-unprivileged-user"}
to retry, use: --limit @/vagrant/full_deploy.retry

[lora-gateway-bridge] copy configuration error

Hi,

I have an issue in step TASK [lora-gateway-bridge : copy configuration]:

"msg": "Destination directory /etc/lora-gateway-bridge does not exist"}

I try to apt purge lora-gateway-bridge to force the re installation, but it seems to not create the folder.
Is the folder supposed to be created by the play or by the installation ?

It appears to be the same issue with loraserver configuration file.

If it is a play issue, I could submit a PR for you

Allow connection from anywhere?

Hi,

If I understand correctly this ansible playbook let only some ip address to access the loraserver.

Is there a reason for this?

I have actually open up my installation to the whole world is that an issues? How big?

Cheers,

Simone

Make roles available in ansible galaxy

Thank you for working on this. It has been very helpful. It would be even more helpful if the roles would be available in ansible-galaxy.

The problem with this repo is that it cannot be used as a dependency without customizing the code inside. E.g. LoRaWAN region settings shouldn't be hard-coded in the template. They could be set in the defaults of the retrospective role this way they code be overwritten externally.

Access Virtual Machine using SSH

Is there a way to access the virtual machine created by vagrant using ssh in order to see the lora-server logs? I tried and the response is connectio refused...

Set-up error by Vagrant

Hi,
I am a novice for studying the lora network server.
After installing Vagrant and virtualbox, I went to the directory: ~/loraserver-setup/host_vars, and executed the command: vagrant up. But I ran into the errors as follows:

TASK [base : add gpg public key to validate LoRa Server package signatures] ****
fatal: [vagrant]: FAILED! => {"changed": false, "cmd": "/usr/bin/apt-key adv --keyserver keyserver.ubuntu.com --recv 1CE2AFD36DBCCA00", "failed": true, "msg": "Error fetching key 1CE2AFD36DBCCA00 from keyserver: keyserver.ubuntu.com", "rc": 2, "stderr": "gpg: requesting key 6DBCCA00 from hkp server keyserver.ubuntu.com\ngpg: keyserver timed out\ngpg: keyserver receive failed: keyserver error\n", "stdout": "Executing: /tmp/tmp.JidnoapmAL/gpg.1.sh --keyserver\nkeyserver.ubuntu.com\n--recv\n1CE2AFD36DBCCA00\n", "stdout_lines": ["Executing: /tmp/tmp.JidnoapmAL/gpg.1.sh --keyserver", "keyserver.ubuntu.com", "--recv", "1CE2AFD36DBCCA00"]}
to retry, use: --limit @/vagrant/full_deploy.retry

PLAY RECAP *********************************************************************
vagrant : ok=10 changed=4 unreachable=0 failed=1

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again

Could you please how can I do for fixing these errors?

Loraserver login

Hi,

I installed a ubuntu server 16.04 after that with vagrant I installed the loraserver in virtualbox. I want to ask that at first what is the login username and password of this virtual box and how can I install loraserver to my physical machine as like as virtual machine.

Pointing IP addres and port of gateway (1700)

Hello Brocaar,

I have a kerlink LoRa gateway and I'm some week fighting against these issues.

  1. The IP address to point is my real machine IP or the virtual machine (IP "10.0.2.15")?
  2. On "host_vars/vagrant.yml" file, I need to replace where "0.0.0.0/0" according IP above?
  3. On gateway I have an file at "mnt/fsuser-1/" called "loraboard_conf.json". I modified this file, point to IP address and ports, following bellow:

...
"gateway_conf": {
"gateway_ID": "0000024b080801db",
"server_address": "10.193.101.12",
"serv_port_up": 1700,
"serv_port_down": 1700
}

When I reboot the gateway to update files they disappear. May be In a volatile space on memory?
Is that the correct way ? I need to reboot my gateway? There is an Brocaar "packet_foward" to update to the server?

Sorry for the so many questions, but I'm stuck in these stuff so may time. :/

Hope you can help me

Best Regards
Rogerio

Ansible local provisioner error

Clone the repo
ran "vagrant up"

the install erred out with the messages shown below.

NOTE - the messages shown below are the result of a followup attempt, since I was unable to copy the output from the original attempt.

biff@obsidian:~/lora/loraserver-setup$ vagrant up
Bringing machine 'vagrant' up with 'virtualbox' provider...
There are errors in the configuration of this machine. Please fix
the following errors and try again:

ansible local provisioner:

  • The following settings shouldn't exist: install_mode

I tried to run rasa shell i am getting error: Could not load model due to Model 'en' is not a linked spaCy model. Please download and/or link a spaCy model, e.g. by running: python -m spacy download en_core_web_md python -m spacy link en_core_web_md en.

when i try to install spacy model,i am getting error:
ERROR: Exception:
Traceback (most recent call last):
File "/home/oretes/anaconda3/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py", line 313, in recv_into
return self.connection.recv_into(*args, **kwargs)
File "/home/oretes/anaconda3/lib/python3.7/site-packages/OpenSSL/SSL.py", line 1822, in recv_into
self._raise_ssl_error(self._ssl, result)
File "/home/oretes/anaconda3/lib/python3.7/site-packages/OpenSSL/SSL.py", line 1622, in _raise_ssl_error
raise WantReadError()
OpenSSL.SSL.WantReadError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/oretes/anaconda3/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py", line 313, in recv_into
return self.connection.recv_into(*args, **kwargs)
File "/home/oretes/anaconda3/lib/python3.7/site-packages/OpenSSL/SSL.py", line 1822, in recv_into
self._raise_ssl_error(self._ssl, result)
File "/home/oretes/anaconda3/lib/python3.7/site-packages/OpenSSL/SSL.py", line 1622, in _raise_ssl_error
raise WantReadError()
OpenSSL.SSL.WantReadError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/oretes/anaconda3/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py", line 313, in recv_into
return self.connection.recv_into(*args, **kwargs)
File "/home/oretes/anaconda3/lib/python3.7/site-packages/OpenSSL/SSL.py", line 1822, in recv_into
self._raise_ssl_error(self._ssl, result)
File "/home/oretes/anaconda3/lib/python3.7/site-packages/OpenSSL/SSL.py", line 1622, in _raise_ssl_error
raise WantReadError()
OpenSSL.SSL.WantReadError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/oretes/anaconda3/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py", line 313, in recv_into
return self.connection.recv_into(*args, **kwargs)
File "/home/oretes/anaconda3/lib/python3.7/site-packages/OpenSSL/SSL.py", line 1822, in recv_into
self._raise_ssl_error(self._ssl, result)
File "/home/oretes/anaconda3/lib/python3.7/site-packages/OpenSSL/SSL.py", line 1622, in _raise_ssl_error
raise WantReadError()
OpenSSL.SSL.WantReadError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/oretes/anaconda3/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py", line 313, in recv_into
return self.connection.recv_into(*args, **kwargs)
File "/home/oretes/anaconda3/lib/python3.7/site-packages/OpenSSL/SSL.py", line 1822, in recv_into
self._raise_ssl_error(self._ssl, result)
File "/home/oretes/anaconda3/lib/python3.7/site-packages/OpenSSL/SSL.py", line 1622, in _raise_ssl_error
raise WantReadError()
OpenSSL.SSL.WantReadError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/oretes/anaconda3/lib/python3.7/site-packages/pip/_vendor/urllib3/response.py", line 425, in _error_catcher
yield
File "/home/oretes/anaconda3/lib/python3.7/site-packages/pip/_vendor/urllib3/response.py", line 507, in read
data = self._fp.read(amt) if not fp_closed else b""
File "/home/oretes/anaconda3/lib/python3.7/http/client.py", line 447, in read
n = self.readinto(b)
File "/home/oretes/anaconda3/lib/python3.7/http/client.py", line 491, in readinto
n = self.fp.readinto(b)
File "/home/oretes/anaconda3/lib/python3.7/socket.py", line 589, in readinto
return self._sock.recv_into(b)
File "/home/oretes/anaconda3/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py", line 328, in recv_into
return self.recv_into(*args, **kwargs)
File "/home/oretes/anaconda3/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py", line 328, in recv_into
return self.recv_into(*args, **kwargs)
File "/home/oretes/anaconda3/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py", line 328, in recv_into
return self.recv_into(*args, **kwargs)
[Previous line repeated 1 more time]
File "/home/oretes/anaconda3/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py", line 326, in recv_into
raise timeout("The read operation timed out")
socket.timeout: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/oretes/anaconda3/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 153, in _main
status = self.run(options, args)
File "/home/oretes/anaconda3/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 382, in run
resolver.resolve(requirement_set)
File "/home/oretes/anaconda3/lib/python3.7/site-packages/pip/_internal/legacy_resolve.py", line 201, in resolve
self._resolve_one(requirement_set, req)
File "/home/oretes/anaconda3/lib/python3.7/site-packages/pip/_internal/legacy_resolve.py", line 365, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/home/oretes/anaconda3/lib/python3.7/site-packages/pip/_internal/legacy_resolve.py", line 313, in _get_abstract_dist_for
req, self.session, self.finder, self.require_hashes
File "/home/oretes/anaconda3/lib/python3.7/site-packages/pip/_internal/operations/prepare.py", line 194, in prepare_linked_requirement
progress_bar=self.progress_bar
File "/home/oretes/anaconda3/lib/python3.7/site-packages/pip/_internal/download.py", line 465, in unpack_url
progress_bar=progress_bar
File "/home/oretes/anaconda3/lib/python3.7/site-packages/pip/_internal/download.py", line 316, in unpack_http_url
progress_bar)
File "/home/oretes/anaconda3/lib/python3.7/site-packages/pip/_internal/download.py", line 551, in _download_http_url
_download_url(resp, link, content_file, hashes, progress_bar)
File "/home/oretes/anaconda3/lib/python3.7/site-packages/pip/_internal/download.py", line 255, in _download_url
consume(downloaded_chunks)
File "/home/oretes/anaconda3/lib/python3.7/site-packages/pip/_internal/utils/misc.py", line 641, in consume
deque(iterator, maxlen=0)
File "/home/oretes/anaconda3/lib/python3.7/site-packages/pip/_internal/download.py", line 223, in written_chunks
for chunk in chunks:
File "/home/oretes/anaconda3/lib/python3.7/site-packages/pip/_internal/utils/ui.py", line 160, in iter
for x in it:
File "/home/oretes/anaconda3/lib/python3.7/site-packages/pip/_internal/download.py", line 212, in resp_read
decode_content=False):
File "/home/oretes/anaconda3/lib/python3.7/site-packages/pip/_vendor/urllib3/response.py", line 564, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/home/oretes/anaconda3/lib/python3.7/site-packages/pip/_vendor/urllib3/response.py", line 529, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "/home/oretes/anaconda3/lib/python3.7/contextlib.py", line 130, in exit
self.gen.throw(type, value, traceback)
File "/home/oretes/anaconda3/lib/python3.7/site-packages/pip/_vendor/urllib3/response.py", line 430, in _error_catcher
raise ReadTimeoutError(self._pool, None, "Read timed out.")
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='github-production-release-asset-2e65be.s3.amazonaws.com', port=443): Read timed out.
(base) oretes@oretes-HP-ProBook-4540s:~/iplbot/complete_version$

Cannot connect to localhost

The Vagrant installation went well and I see that everything is installed, provisioned and started.
However, I cannot connect to https://localhost:8080/.

The Virtualbox VM is in NAT mode and shows the port forwarding.
Port 8080 on the host is forwarded to port 443 on the guest. Is that correct?

Any ideas? Thanks in advance.

Confliting - config.vm.network :forwarded_port

Hi Brocaar,

I've already have run the loraserver-setup and everything was going well.
But now, there was a new version from vagrant box to update. I've updated these days and appears a problem with the host conflicting . Here is the error message:

============================================================================
_roger@roger-Inspiron-5447:~/Documentos/Brocaar/loraserver-setup$ vagrant up
Bringing machine 'vagrant' up with 'virtualbox' provider...
==> vagrant: Checking if box 'ubuntu/xenial64' is up to date...
==> vagrant: A newer version of the box 'ubuntu/xenial64' is available! You currently
==> vagrant: have version '20170419.0.0'. The latest is version '20170426.0.0'. Run
==> vagrant: vagrant box update to update.
Vagrant cannot forward the specified ports on this VM, since they
would collide with some other application that is already listening
on these ports. The forwarded port to 1883 is already in use
on the host machine.

To fix this, modify your current project's Vagrantfile to use another
port. Example, where '1234' would be replaced by a unique host port:

config.vm.network :forwarded_port, guest: 1883, host: 1234

Sometimes, Vagrant will attempt to auto-correct this for you. In this
case, Vagrant was unable to. This is usually because the guest machine
is in a state which doesn't allow modifying port forwarding. You could
try 'vagrant reload' (equivalent of running a halt followed by an up)
so vagrant can attempt to auto-correct this upon booting. Be warned
that any unsaved work might be lost.

============================================================================

The problem happens with host 8080, 1883, 1884. I guess some changes i would make maybe is not the correct way. 'vagrant reload' perform the same error message.

How may I proceed, please?

cannot add gateway

i try install from ansible & docker images
it's a same problem cannot select network server and gateway-profile

pyopenssl: object has no attribute 'SSL_ST_INIT'

TASK [postgresql : install packages] *******************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'module
' object has no attribute 'SSL_ST_INIT'
failed: [vagrant] (item=python-psycopg2) => {"failed": true, "item": "python-psycopg2", "module_stderr": "Traceback (mos
t recent call last):\n File "/tmp/ansible_vshsOP/ansible_module_apt.py", line 239, in \n from ansible.modu
le_utils.urls import fetch_url\n File "/tmp/ansible_vshsOP/ansible_modlib.zip/ansible/module_utils/urls.py", line 153
, in \n File "/usr/lib/python2.7/dist-packages/urllib3/contrib/pyopenssl.py", line 54, in \n impor
t OpenSSL.SSL\n File "/usr/lib/python2.7/dist-packages/OpenSSL/init.py", line 8, in \n from OpenSSL im
port rand, crypto, SSL\n File "/usr/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 118, in \n SSL_ST_IN
IT = _lib.SSL_ST_INIT\nAttributeError: 'module' object has no attribute 'SSL_ST_INIT'\n", "module_stdout": "", "msg": "M
ODULE FAILURE", "rc": 0}

last playbook with debian stretch

Here is my situation:

  • I run Ansible and Vagrant on a Mac OSX
  • if I run the playbook with Vagrant deploying a debian Buster, everything runs fine.
  • When using a debian stretch, vagrant stops at parsing the playbook, finding an error in the letsencrypt main task.

From what I've observed, this coud come from the Ansible version installed on the Vagrant guest machine.
I tried checking out the repo to a commit where Debian Stretch was the main distribution (in such release vagrant file installs Ansible with pip)
There, Vagrant stops claiming that pip is not installed.

Is there any way to correct this please?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.