Installing openwisp2 to a raspberrypi 4

860 views
Skip to first unread message

Sinh Ta

unread,
Dec 2, 2020, 12:15:43 AM12/2/20
to OpenWISP
Hello,

I'm trying to install openwisp2 to a raspberry pi 4 to set it up as a wlc for a couple of openwrt routers. And everything went well until the installation of openwisp2 controller and its dependencies. The error message (attached below) indicates some invalid version, but I couldn't figure that out.

I'm just wondering if you can help me to eradicate the issue. Many thanks in advance.

--// Begin
TASK [openwisp.openwisp2 : Install openwisp2 controller and its dependencies] ***
FAILED - RETRYING: Install openwisp2 controller and its dependencies (5 retries left).
FAILED - RETRYING: Install openwisp2 controller and its dependencies (4 retries left).
FAILED - RETRYING: Install openwisp2 controller and its dependencies (3 retries left).
FAILED - RETRYING: Install openwisp2 controller and its dependencies (2 retries left).
FAILED - RETRYING: Install openwisp2 controller and its dependencies (1 retries left).
fatal: [hostname.domainname.net]: FAILED! => {"attempts": 5, "changed": false, "cmd": ["/opt/openwisp2/env/bin/pip3", "install", "-U", "openwisp-controller~=0.7.post1", "channels_redis", "service_identity"], "msg": "stdout: Looking in indexes: https://pypi.org/simplehttps://www.piwheels.org/simple\nCollecting channels_redis\n  Using cached https://www.piwheels.org/simple/channels-redis/channels_redis-3.2.0-py2.py3-none-any.whl (14 kB)\nCollecting openwisp-controller~=0.7.post1\n  Using cached https://www.piwheels.org/simple/openwisp-controller/openwisp_controller-0.8.1-py2.py3-none-any.whl (491 kB)\nCollecting service_identity\n  Using cached https://www.piwheels.org/simple/service-identity/service_identity-18.1.0-py2.py3-none-any.whl (11 kB)\nRequirement already satisfied: attrs>=16.0.0 in /opt/openwisp2/env/lib/python3.7/site-packages (from service_identity) (20.3.0)\nRequirement already satisfied: cryptography in /opt/openwisp2/env/lib/python3.7/site-packages (from service_identity) (3.2.1)\nCollecting aioredis~=1.0\n  Using cached https://www.piwheels.org/simple/aioredis/aioredis-1.3.1-py3-none-any.whl (65 kB)\nCollecting asgiref<4,>=3.2.10\n  Using cached https://www.piwheels.org/simple/asgiref/asgiref-3.3.1-py3-none-any.whl (19 kB)\nCollecting async-timeout\n  Using cached https://www.piwheels.org/simple/async-timeout/async_timeout-3.0.1-py3-none-any.whl (8.2 kB)\nCollecting celery<4.5.0,>=4.4.3\n  Using cached https://www.piwheels.org/simple/celery/celery-4.4.7-py2.py3-none-any.whl (427 kB)\nCollecting billiard<4.0,>=3.6.3.0\n  Using cached https://www.piwheels.org/simple/billiard/billiard-3.6.3.0-py3-none-any.whl (89 kB)\nCollecting channels<4\n  Using cached https://www.piwheels.org/simple/channels/channels-3.0.2-py3-none-any.whl (38 kB)\nRequirement already satisfied: six>=1.4.1 in /usr/lib/python3/dist-packages (from cryptography->service_identity) (1.12.0)\nRequirement already satisfied: cffi!=1.11.3,>=1.8 in /opt/openwisp2/env/lib/python3.7/site-packages (from cryptography->service_identity) (1.14.4)\nRequirement already satisfied: pycparser in /opt/openwisp2/env/lib/python3.7/site-packages (from cffi!=1.11.3,>=1.8->cryptography->service_identity) (2.20)\nCollecting daphne<4,>=3.0\n  Using cached https://www.piwheels.org/simple/daphne/daphne-3.0.1-py3-none-any.whl (26 kB)\nCollecting autobahn>=0.18\n  Using cached https://www.piwheels.org/simple/autobahn/autobahn-20.7.1-py2.py3-none-any.whl (1.5 MB)\nRequirement already satisfied: cryptography in /opt/openwisp2/env/lib/python3.7/site-packages (from service_identity) (3.2.1)\nCollecting django<3.2,>=2.2\n  Using cached https://www.piwheels.org/simple/django/Django-3.1.4-py3-none-any.whl (7.8 MB)\nCollecting django-flat-json-widget~=0.1\n  Using cached https://www.piwheels.org/simple/django-flat-json-widget/django_flat_json_widget-0.1.1-py2.py3-none-any.whl (16 kB)\nCollecting django-loci~=0.4.0\n  Using cached https://www.piwheels.org/simple/django-loci/django_loci-0.4-py2.py3-none-any.whl (43 kB)\nCollecting channels<4\n  Using cached https://www.piwheels.org/simple/channels/channels-2.4.0-py2.py3-none-any.whl (37 kB)\n  Using cached https://www.piwheels.org/simple/channels/channels-2.3.1-py2.py3-none-any.whl (37 kB)\n  Using cached https://www.piwheels.org/simple/channels/channels-2.3.0-py2.py3-none-any.whl (37 kB)\nINFO: pip is looking at multiple versions of django-loci to determine which version is compatible with other requirements. This could take a while.\n\n:stderr: ERROR: Exception:\nTraceback (most recent call last):\n  File \"/opt/openwisp2/env/lib/python3.7/site-packages/pip/_internal/cli/base_command.py\", line 210, in _main\n    status = self.run(options, args)\n  File \"/opt/openwisp2/env/lib/python3.7/site-packages/pip/_internal/cli/req_command.py\", line 180, in wrapper\n    return func(self, options, args)\n  File \"/opt/openwisp2/env/lib/python3.7/site-packages/pip/_internal/commands/install.py\", line 319, in run\n    reqs, check_supported_wheels=not options.target_dir\n  File \"/opt/openwisp2/env/lib/python3.7/site-packages/pip/_internal/resolution/resolvelib/resolver.py\", line 122, in resolve\n    requirements, max_rounds=try_to_avoid_resolution_too_deep,\n  File \"/opt/openwisp2/env/lib/python3.7/site-packages/pip/_vendor/resolvelib/resolvers.py\", line 445, in resolve\n    state = resolution.resolve(requirements, max_rounds=max_rounds)\n  File \"/opt/openwisp2/env/lib/python3.7/site-packages/pip/_vendor/resolvelib/resolvers.py\", line 344, in resolve\n    success = self._backtrack()\n  File \"/opt/openwisp2/env/lib/python3.7/site-packages/pip/_vendor/resolvelib/resolvers.py\", line 284, in _backtrack\n    self.state.criteria[k] = crit.excluded_of(incompatibilities)\n  File \"/opt/openwisp2/env/lib/python3.7/site-packages/pip/_vendor/resolvelib/resolvers.py\", line 107, in excluded_of\n    cands = self.candidates.excluding(candidates)\n  File \"/opt/openwisp2/env/lib/python3.7/site-packages/pip/_vendor/resolvelib/structs.py\", line 140, in excluding\n    return type(self)([c for c in self._sequence if c not in candidates])\n  File \"/opt/openwisp2/env/lib/python3.7/site-packages/pip/_vendor/resolvelib/structs.py\", line 140, in <listcomp>\n    return type(self)([c for c in self._sequence if c not in candidates])\n  File \"/opt/openwisp2/env/lib/python3.7/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py\", line 20, in _deduplicated_by_version\n    for candidate in candidates:\n  File \"/opt/openwisp2/env/lib/python3.7/site-packages/pip/_internal/resolution/resolvelib/factory.py\", line 203, in iter_index_candidates\n    version=ican.version,\n  File \"/opt/openwisp2/env/lib/python3.7/site-packages/pip/_internal/resolution/resolvelib/factory.py\", line 145, in _make_candidate_from_link\n    link, template, factory=self, name=name, version=version,\n  File \"/opt/openwisp2/env/lib/python3.7/site-packages/pip/_internal/resolution/resolvelib/candidates.py\", line 290, in __init__\n    wheel_version = Version(wheel.version)\n  File \"/opt/openwisp2/env/lib/python3.7/site-packages/pip/_vendor/packaging/version.py\", line 298, in __init__\n    raise InvalidVersion(\"Invalid version: '{0}'\".format(version))\npip._vendor.packaging.version.InvalidVersion: Invalid version: '2013d'\n"}

PLAY RECAP *********************************************************************
hostname.domainname.net   : ok=25   changed=0    unreachable=0    failed=1    skipped=27   rescued=0    ignored=0  
--// End

Ajay Tripathi

unread,
Dec 2, 2020, 7:33:12 AM12/2/20
to OpenWISP
Hi,

Hmm, It's an unexpected error, looks like a problem with dependencies of openwisp-controller.
1. I would suggest trying on a fresh install.
2. If that doesn't help, could you please try debian?  https://raspi.debian.net/
3. Could you try manually locking openwisp-utils version? (openwisp2_utils_pip: -e https://github.com/openwisp/openwisp-utils/tree/0.7.0#egg=openwisp_utils[rest])

If the 3rd trick works or If these tricks don't help, please let us know. I'll try to install on my Pi and check it out! :-)


Best,
Ajay T.

Michele Salerno

unread,
Dec 2, 2020, 9:12:48 AM12/2/20
to OpenWISP
Hi, try my playbook

- hosts: openwisp2
  become: "{{ become | default('yes') }}"
  roles:
    - openwisp.openwisp2
  vars:
    # variabili per ruolo openwisp2
    openwisp2_default_from_email: "openwisp@{{ inventory_hostname }}"
    openwisp2_controller_version: "0.7.0"
    openwisp2_network_topology_version: "0.5.1"
    openwisp2_notifications_pip: true
    openwisp2_notifications_delete_old_notifications: 60
    openwisp2_celery_broker_max_tries: 10
    openwisp2_network_topology: true
    openwisp2_controller_pip: true
    openwisp2_users_pip: true
    openwisp2_utils_pip: true
    openwisp2_django_netjsonconfig_pip: false
    openwisp2_django_x509_pip: true
    openwisp2_django_loci_pip: true
    openwisp2_netjsonconfig_pip: false
    openwisp2_network_topology_pip: true
    openwisp2_extra_python_packages: [bpython]
    openwisp2_language_code: "it-it"
    openwisp2_time_zone: "UTC"
    openwisp2_ssl_state: "Italia"
    openwisp2_ssl_locality: "Matera"
    openwisp2_ssl_organization: "Ninux Basilicata"
    openwisp2_http_allowed_ip: "10.8.0.0/16"
    # DATABASE SQLite
    openwisp2_database:
        engine: "django.contrib.gis.db.backends.spatialite"
        name: "{{ openwisp2_path }}/db.sqlite3"
        user: "openwisp2"
        password: "YOUR-PASSWORD"
    # Variabili per nginx
    openwisp2_nginx_ipv6: true
    openwisp2_nginx_spdy: true
    openwisp2_nginx_ssl_config:
        gzip: "on"
        gzip_comp_level: "6"
        gzip_proxied: "any"
        gzip_min_length: "1000"
        gzip_types:
            - "text/plain"
            - "image/svg+xml"
            - "application/json"
            - "application/javascript"
            - "text/xml"
            - "text/css"
            - "application/xml"
            - "application/x-font-ttf"
            - "font/opentype"
  pre_tasks:
    - name: Install require packages
      pip:
        name:
          - django-netjsonconfig
          - django-private-storage
    - name: Creates temp directory ansible
      file:
        path: /var/www/.ansible/tmp
        state: directory
        owner: www-data
        group: www-data
        mode: 0777
        recurse: yes


Ajay Tripathi

unread,
Dec 8, 2020, 2:15:03 PM12/8/20
to OpenWISP
Hi,

I ran it on my Pi,

I changed your playbook to the following:

```
- hosts: raspi
become: true
roles:
- ansible-openwisp2
vars:
openwisp2_default_from_email: "openwisp@{{ inventory_hostname }}"
openwisp2_notifications_pip: true
openwisp2_notifications_delete_old_notifications: 60
openwisp2_celery_broker_max_tries: 10
openwisp2_network_topology: true
openwisp2_extra_python_packages: [bpython]
openwisp2_language_code: "it-it"
openwisp2_time_zone: "UTC"
openwisp2_ssl_state: "Italia"
openwisp2_ssl_locality: "Matera"
openwisp2_ssl_organization: "Ninux Basilicata"
openwisp2_http_allowed_ip: "10.8.0.0/16"
# Variabili per nginx
openwisp2_nginx_ipv6: true
openwisp2_nginx_spdy: true
openwisp2_nginx_ssl_config:
gzip: "on"
gzip_comp_level: "6"
gzip_proxied: "any"
gzip_min_length: "1000"
gzip_types:
- "text/plain"
- "image/svg+xml"
- "application/json"
- "application/javascript"
- "text/xml"
- "text/css"
- "application/xml"
- "application/x-font-ttf"
- "font/opentype"
```

Two things:

1. I don't know why did you set the `_pip` as `true`, these options want link from where you want to install your custom openwisp project.
2. I faced a problem version mismatch problem while installation, I solved it by `sudo apt-get install python3-cffi` if you face that on the step [openwisp.openwisp2 : Install openwisp2 controller and its dependencies], try it, let me know if that works out.


Best,
Ajay Tripathi
Message has been deleted

Sinh Ta

unread,
Dec 9, 2020, 9:58:58 PM12/9/20
to open...@googlegroups.com
Hello Ajay,

Wow, thank you very much for such effort! I really appreciate your help.
I follow the installation instructions (https://openwisp.io/docs/user/quickstart.html#install-the-openwisp-2-server) and install openwisp2 to the Pi, which was running debian buster 64 from my linux mint (a derivative of ubuntu).

In the instruction, after installing ansible and git, I also install the role 'ansible-galaxy install openwisp.openwisp2', which matches that of the playbook.yml file (line 4, in the instruction). You mention in the playbook.yml the role 'ansible.openwisp2', would that have any ... consequences!? Also my playbook.yml is just like that of the installation instruction, would that .. cause any issue!?

I'm not quite sure where I would have set the '_pip' as 'true', since I just strictly followed the instructions. Although, I did upgrade pip to the latest version prior to the installation (

Last weekend, I replaced the os on the Pi with Ubuntu 20.04, it took quite a bit longer to install but still got error messages, albeit different ones, and a super long one! I attached the log file here.

I'll try to replace the os on the Pi this weekend with Debian Buster again, and try your suggestions, see how that goes. I'll keep you posted.

Again, many thanks for your help and best regards,

Sinh 

--
You received this message because you are subscribed to a topic in the Google Groups "OpenWISP" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openwisp/4e__ZUPDy04/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openwisp+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/openwisp/e5b9fc28-21e3-4d70-bb52-e47677e12cbbn%40googlegroups.com.


--
Sinh
ansible.log

Ajay Tripathi

unread,
Dec 10, 2020, 5:54:19 AM12/10/20
to OpenWISP
Hi,

On Thursday, December 10, 2020 at 8:28:58 AM UTC+5:30 vsta...@gmail.com wrote:
You mention in the playbook.yml the role 'ansible.openwisp2'

please use openwisp.openwisp2, I am working on the development version from Github master not the released one, hence that's just a development difference. `openwisp.openwisp2` is the released version.

Although, I did upgrade pip to the latest version prior to the installation

Thaat should be fine.
 
and a super long one! I attached the log file here.

Can you please try doing `sudo apt-get install python3-cffi` on your Pi, that should fix the error.
if not can you please send me the installed version, I'll try it out for that.

Also, If I am not wrong, Ubuntu 20.04 brings some changes and the released version was for Ubuntu 18.04, that might cause problems.
If you want to use Ubuntu 20.04, try using the version from GitHub master branch itself.


Best,
Ajay Tripathi

Sinh Ta

unread,
Dec 13, 2020, 6:03:10 PM12/13/20
to open...@googlegroups.com
Hi Ajay,

I got pass that error, but now I got a new error that I can't figure out from the below step. I couldn't find any of those zip files those in the Pi, just wondering if you could give me some clues!? Thanks,

TASK [openwisp.openwisp2 : migrate] ************************************************************************************
fatal: [hostname.domainname]: FAILED! => {"changed": false, "cmd": "./manage.py migrate --noinput", "msg": "", "path": "/opt/openwisp2/env/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "syspath": ["/tmp/ansible_django_manage_payload_mj5qbl8o/ansible_django_manage_payload.zip", "/usr/lib/python39.zip", "/usr/lib/python3.9", "/usr/lib/python3.9/lib-dynload", "/usr/local/lib/python3.9/dist-packages", "/usr/lib/python3/dist-packages", "/usr/lib/python3.9/dist-packages"]}

RUNNING HANDLER [openwisp.openwisp2 : reload supervisor] ***************************************************************

PLAY RECAP *************************************************************************************************************
hostname.domainname : ok=55   changed=3    unreachable=0    failed=1    skipped=32   rescued=0    ignored=2

--
You received this message because you are subscribed to a topic in the Google Groups "OpenWISP" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openwisp/4e__ZUPDy04/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openwisp+u...@googlegroups.com.


--
Sinh

Ajay Tripathi

unread,
Dec 14, 2020, 1:46:36 PM12/14/20
to OpenWISP
Hi,

On Monday, December 14, 2020 at 4:33:10 AM UTC+5:30 vsta...@gmail.com wrote:
TASK [openwisp.openwisp2 : migrate] ************************************************************************************

If you could SSH into your Pi and run the following commands and send the output, I may be able to help with logs:
1. cd /opt/openwisp2/
2. source env/bin/activate
3. python manage.py migrate


Ajay
 

Sinh Ta

unread,
Dec 14, 2020, 2:10:30 PM12/14/20
to open...@googlegroups.com
Hello Ajay,

Thanks for for your help, below is the output of the command. I tried both python and python3, just in case!
--// Start
pi@raspberry-pi:~ $ cd /opt/openwisp2
pi@raspberry-pi:/opt/openwisp2 $ python manage.py migrate
Traceback (most recent call last):
  File "manage.py", line 8, in <module>
    from django.core.management import execute_from_command_line
ImportError: No module named django.core.management
pi@raspberry-pi:/opt/openwisp2 $ python3 manage.py migrate
Traceback (most recent call last):
  File "/opt/openwisp2/manage.py", line 8, in <module>
    from django.core.management import execute_from_command_line
ModuleNotFoundError: No module named 'django'
pi@raspberry-pi:/opt/openwisp2 $ python --version
Python 2.7.18
pi@raspberry-pi:/opt/openwisp2 $ python3 --version
Python 3.9.1
pi@raspberry-pi:/opt/openwisp2 $
--// End

--
You received this message because you are subscribed to a topic in the Google Groups "OpenWISP" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openwisp/4e__ZUPDy04/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openwisp+u...@googlegroups.com.


--
Sinh

Ajay Tripathi

unread,
Dec 14, 2020, 2:16:04 PM12/14/20
to OpenWISP
Hi,

I think the `source env/bin/activate` command did not work, can you please double check if the python virtual environment is activated.
You terminal would look like `(env) pi@raspberry-pi:/opt/openwisp2 $` if it works successfully!


Ajay

Sinh Ta

unread,
Dec 15, 2020, 8:45:34 AM12/15/20
to open...@googlegroups.com
Hello Ajay,

Sorry, I was just too busy during the day! So a bit late in replying.
When I manually run the command that you stated, it works! Please see below
--// Begin

pi@raspberry-pi:~ $ cd /opt/openwisp2

pi@raspberry-pi:/opt/openwisp2 $ ls

db.sqlite3  env  generate_django_secret_key.py  log  manage.py  openwisp2

pi@raspberry-pi:/opt/openwisp2 $ source env/bin/activate

(env) pi@raspberry-pi:/opt/openwisp2 $ 
--// End

--
You received this message because you are subscribed to a topic in the Google Groups "OpenWISP" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openwisp/4e__ZUPDy04/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openwisp+u...@googlegroups.com.


--
Sinh

Sinh Ta

unread,
Dec 15, 2020, 10:54:57 AM12/15/20
to open...@googlegroups.com
Ajay,

Just rebuilt my Raspberry Pi with ubuntu 20.10 and re-do the installation again. I still get the python2-cffi error, since the installation process expecting the package python3-cffi-backend on the Pi to be at least version 1.14.4-0, and the command running the command 'apt install python3-cffi-backend' doesn't really help within the distribution, since it keeps downloading the same version (1.14.2-1 in ubuntu 20.10). I have to change the /etc/apt/sources.list to add the hirsute repository which include python3-cffi-backend version 1.14.4-1 that satisfies the condition for installation of openwisp2. That went well, but now I have a new error at the "migrage" step, which indicating that it doesn't find the module 'celery', just wondering if you can help troubleshoot that!? Error message below.

Thanks for your help

--// Begin
fatal: [raspberry-pi.localdomain.vsta]: FAILED! => {"changed": false, "cmd": "./manage.py migrate --noinput", "msg": "\n:stderr: Traceback (most recent call last):\n  File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/core/management/base.py\", line 330, in run_from_argv\n    self.execute(*args, **cmd_options)\n  File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/core/management/base.py\", line 371, in execute\n    output = self.handle(*args, **options)\n  File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/core/management/base.py\", line 82, in wrapped\n    saved_locale = translation.get_language()\n  File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/utils/translation/__init__.py\", line 254, in get_language\n    return _trans.get_language()\n  File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/utils/translation/__init__.py\", line 57, in __getattr__\n    if settings.USE_I18N:\n  File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/conf/__init__.py\", line 83, in __getattr__\n    self._setup(name)\n  File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/conf/__init__.py\", line 70, in _setup\n    self._wrapped = Settings(settings_module)\n  File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/conf/__init__.py\", line 177, in __init__\n    mod = importlib.import_module(self.SETTINGS_MODULE)\n  File \"/usr/lib/python3.9/importlib/__init__.py\", line 127, in import_module\n    return _bootstrap._gcd_import(name[level:], package, level)\n  File \"<frozen importlib._bootstrap>\", line 1030, in _gcd_import\n  File \"<frozen importlib._bootstrap>\", line 1007, in _find_and_load\n  File \"<frozen importlib._bootstrap>\", line 972, in _find_and_load_unlocked\n  File \"<frozen importlib._bootstrap>\", line 228, in _call_with_frames_removed\n  File \"<frozen importlib._bootstrap>\", line 1030, in _gcd_import\n  File \"<frozen importlib._bootstrap>\", line 1007, in _find_and_load\n  File \"<frozen importlib._bootstrap>\", line 986, in _find_and_load_unlocked\n  File \"<frozen importlib._bootstrap>\", line 680, in _load_unlocked\n  File \"<frozen importlib._bootstrap_external>\", line 790, in exec_module\n  File \"<frozen importlib._bootstrap>\", line 228, in _call_with_frames_removed\n  File \"/opt/openwisp2/openwisp2/__init__.py\", line 1, in <module>\n    from .celery import app as celery_app\n  File \"/opt/openwisp2/openwisp2/celery.py\", line 3, in <module>\n    from celery import Celery\nModuleNotFoundError: No module named 'celery'\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n  File \"/opt/openwisp2/./manage.py\", line 10, in <module>\n    execute_from_command_line(sys.argv)\n  File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/core/management/__init__.py\", line 401, in execute_from_command_line\n    utility.execute()\n  File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/core/management/__init__.py\", line 395, in execute\n    self.fetch_command(subcommand).run_from_argv(self.argv)\n  File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/core/management/base.py\", line 343, in run_from_argv\n    connections.close_all()\n  File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/db/utils.py\", line 232, in close_all\n    for alias in self:\n  File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/db/utils.py\", line 226, in __iter__\n    return iter(self.databases)\n  File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/utils/functional.py\", line 48, in __get__\n    res = instance.__dict__[self.name] = self.func(instance)\n  File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/db/utils.py\", line 153, in databases\n    self._databases = settings.DATABASES\n  File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/conf/__init__.py\", line 83, in __getattr__\n    self._setup(name)\n  File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/conf/__init__.py\", line 70, in _setup\n    self._wrapped = Settings(settings_module)\n  File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/conf/__init__.py\", line 177, in __init__\n    mod = importlib.import_module(self.SETTINGS_MODULE)\n  File \"/usr/lib/python3.9/importlib/__init__.py\", line 127, in import_module\n    return _bootstrap._gcd_import(name[level:], package, level)\n  File \"<frozen importlib._bootstrap>\", line 1030, in _gcd_import\n  File \"<frozen importlib._bootstrap>\", line 1007, in _find_and_load\n  File \"<frozen importlib._bootstrap>\", line 972, in _find_and_load_unlocked\n  File \"<frozen importlib._bootstrap>\", line 228, in _call_with_frames_removed\n  File \"<frozen importlib._bootstrap>\", line 1030, in _gcd_import\n  File \"<frozen importlib._bootstrap>\", line 1007, in _find_and_load\n  File \"<frozen importlib._bootstrap>\", line 986, in _find_and_load_unlocked\n  File \"<frozen importlib._bootstrap>\", line 680, in _load_unlocked\n  File \"<frozen importlib._bootstrap_external>\", line 790, in exec_module\n  File \"<frozen importlib._bootstrap>\", line 228, in _call_with_frames_removed\n  File \"/opt/openwisp2/openwisp2/__init__.py\", line 1, in <module>\n    from .celery import app as celery_app\n  File \"/opt/openwisp2/openwisp2/celery.py\", line 3, in <module>\n    from celery import Celery\nModuleNotFoundError: No module named 'celery'\n", "path": "/opt/openwisp2/env/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin", "syspath": ["/tmp/ansible_django_manage_payload_vkj3x4t7/ansible_django_manage_payload.zip", "/usr/lib/python39.zip", "/usr/lib/python3.9", "/usr/lib/python3.9/lib-dynload", "/usr/local/lib/python3.9/dist-packages", "/usr/lib/python3/dist-packages", "/usr/lib/python3.9/dist-packages"]}
--// End
--
Sinh

Ajay Tripathi

unread,
Dec 15, 2020, 1:02:53 PM12/15/20
to OpenWISP
Hi Sinh,


Three things I noticed:
1. The package I recommended earlier was `sudo apt-get install python3-cffi`` not `python2-cffi`, openwisp doesn't work or depend on python2 anymore but I think the package you found (python3-cffi-backend) gets the job done as well! :-)

2. In the output that you send:

```

pi@raspberry-pi:~ $ cd /opt/openwisp2
pi@raspberry-pi
:/opt/openwisp2 $ ls

db.sqlite3  env  generate_django_secret_key.py  log  manage.py  openwisp2

pi@raspberry-pi:/opt/openwisp2 $ source env/bin/activate

(env) pi@raspberry-pi:/opt/openwisp2 $

``

I mean't do the `python manage.py migrate` after the (env) is visible, like:

```
(env) pi@raspberry-pi:/opt/openwisp2 $ python manage.py migrate
<send-output-of-this-command>
```

Finally, 
3. In the latest logs that you've send, this is odd. celery should have been already installed.
3.1 Can you please share your playbook?
3.2 Can you please ensure that you have the latest version of ansible-openwisp2 released on 12th December?


Ajay

Sinh Ta

unread,
Dec 16, 2020, 11:21:49 PM12/16/20
to open...@googlegroups.com
Hello Ajay,

I've managed to install it on the Pi with ubuntu 20.10, ubuntu seems to give a bit less trouble than debian. And it's great, really! Pretty cool stuff! Thanks for the tool, although I've got to admit this is one of the toughest software installations that I've ever done. My openwrt routers register beautifully, and I can see them all on the controller!

I'll have to back up the Pi's micro sd card just in case and my next task will be to mesh my routers through openwisp. If you could please point me to where I can find the information on that, it'd be a great help.

Again, thanks for all your help and for a very useful network controller.

Sinh 

--
You received this message because you are subscribed to a topic in the Google Groups "OpenWISP" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openwisp/4e__ZUPDy04/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openwisp+u...@googlegroups.com.


--
Sinh

Ajay Tripathi

unread,
Dec 18, 2020, 12:49:01 PM12/18/20
to OpenWISP
Hi,

> ubuntu seems to give a bit less trouble than debian.

Interesting. I haven't tried ubuntu, but if that is easier to use, I'll recommend that one to folks installing openwisp for the first time.

> this is one of the toughest software installations that I've ever done.

I have a couple of ideas to make docker-openwisp installation even easier an conflict free in the future, let's see how that turns out but ansible-openwisp2 will need atleast some technical expertise here and there!

> my next task will be to mesh my routers through openwisp. If you could please point me to where I can find the information on that, it'd be a great help.



Best,
Ajay T.
Reply all
Reply to author
Forward
0 new messages