From be8e6e48ae218e0bb334f087831b801e5bc14987 Mon Sep 17 00:00:00 2001 From: pingswept Date: Tue, 28 Jul 2015 15:12:27 -0400 Subject: [PATCH 1/5] Adapt to RPi2 --- fabfile.py | 51 ++++++------------------------------------------ libpruio.service | 9 --------- package_lists.py | 27 ++++++++++++++----------- 3 files changed, 22 insertions(+), 65 deletions(-) delete mode 100644 libpruio.service diff --git a/fabfile.py b/fabfile.py index e748d3c..ea922eb 100644 --- a/fabfile.py +++ b/fabfile.py @@ -8,7 +8,7 @@ import fabtools from package_lists import * -env.host = 'beaglebone.local' +env.host = 'raspberrypi.local' env.user = 'root' # Usage @@ -20,13 +20,12 @@ @task def predeploy(): - local('ssh-keygen -R beaglebone.local') # remove host key, if it exists + local('ssh-keygen -R raspberrypi.local') # remove host key, if it exists prep_host() # # Set the password. Can't log in to blank-password host with Fabric. set_hostname() @task def deploy(): - disable_bonescript_and_release_http_port() update_debian_package_lists() remove_unneeded_debian_packages() for package in DEBIAN_PACKAGES_TO_INSTALL: @@ -36,7 +35,6 @@ def deploy(): install_config_files() allow_uwsgi_to_control_supervisor() allow_uwsgi_to_access_usb_port() - install_libpruio() install_oh_my_zsh() autoremove_debian_package_remnants() print(green('Rascal 2 deployment complete. Rebooting . . .')) @@ -53,15 +51,6 @@ def set_hostname(): print(green('Rebooting . . .')) reboot() -def disable_bonescript_and_release_http_port(): - print(green('Disabling Bonescript . . .')) - with settings(warn_only=True): - for service in BONESCRIPT_SERVICES: - fabtools.systemd.stop_and_disable(service) - fabtools.utils.run_as_root('systemctl disable bonescript.socket') - fabtools.utils.run_as_root('systemctl disable cloud9.socket') - #reboot() # to get init process to release port 80 - def update_debian_package_lists(): print(green('\nUpdating package repository lists')) run('apt-get update -y', pty=False) @@ -69,7 +58,7 @@ def update_debian_package_lists(): def install_python_modules(): for module in PYTHON_MODULES_TO_INSTALL: print(green('\nInstalling Python module: {0}'.format(module))) - run('pip install ' + module) + run('pip3 install ' + module) def package_installed(package): cmd = 'dpkg-query -l "{0}" | grep -q ^.i'.format(package) @@ -80,19 +69,19 @@ def package_installed(package): def install_debian_package(package): if not package_installed(package): print(green('\nInstalling package: {0}'.format(package))) - run('apt-get install -y ' + package, pty=False) + run('DEBIAN_FRONTEND=noninteractive apt-get install -y ' + package, pty=False) else: print(green('Package ' + package + ' already installed')) def autoremove_debian_package_remnants(): print(green('\nRemoving unneeded package remnants')) - run('apt-get autoremove -y', pty=False) + run('DEBIAN_FRONTEND=noninteractive apt-get autoremove -y', pty=False) def remove_unneeded_debian_packages(): for package in DEBIAN_PACKAGES_TO_REMOVE: if package_installed(package): print(green('\nRemoving package: {0}'.format(package))) - run('apt-get remove -y ' + package, pty=False) + run('DEBIAN_FRONTEND=noninteractive apt-get remove -y ' + package, pty=False) else: print(green('Package ' + package + ' already removed.')) @@ -141,34 +130,6 @@ def allow_uwsgi_to_control_supervisor(): def allow_uwsgi_to_access_usb_port(): run('usermod -a -G dialout www-data') -def install_libpruio(): - install_debian_package('am335x-pru-package') - - run('wget http://www.freebasic-portal.de/dlfiles/589/BBB_fbc-1.00.tar.bz2') - run('tar xjf BBB_fbc-1.00.tar.bz2') - run('cp BBB_fbc-1.00/usr/local/bin/fbc /usr/bin/') - run('cp -r BBB_fbc-1.00/usr/local/lib/freebasic/* /usr/lib/') - run('rm -rf BBB_fbc-1.00') - - run('wget http://www.freebasic-portal.de/dlfiles/539/FB_prussdrv-0.0.tar.bz2') - run('tar xjf FB_prussdrv-0.0.tar.bz2') - run('mkdir -p /usr/include/freebasic/BBB') - run('cp -r FB_prussdrv-0.0/include/* /usr/include/freebasic/BBB/') - run('mv FB_prussdrv-0.0/bin/pasm /usr/bin/pasm') - run('rm -rf FB_prussdrv-0.0') - - run('wget https://github.com/rascalmicro/libpruio/archive/master.zip') - run('unzip master.zip') - run('cp libpruio-master/src/c_wrapper/libpruio.so /usr/lib') # directory name is probably wrong - run('ldconfig') - run('cp libpruio-master/src/c_wrapper/pruio*.h* /usr/include') - run('cp libpruio-master/src/config/libpruio-00A0.dtbo /lib/firmware') # note corrected filename 0A00 -> 00A0 - run('cp libpruio-master/src/pruio/pruio*.bi /usr/include/freebasic/BBB') - run('cp libpruio-master/src/pruio/pruio.hp /usr/include/freebasic/BBB') - run('echo uio_pruss >> /etc/modules') # load uio_pruss module at boot - put('libpruio.service', '/etc/systemd/system/libpruio.service') - run('systemctl enable libpruio.service') - def install_oh_my_zsh(): run('wget --no-check-certificate http://install.ohmyz.sh -O - | sh') diff --git a/libpruio.service b/libpruio.service deleted file mode 100644 index 60e7277..0000000 --- a/libpruio.service +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=Programmable Realtime Unit IO library - -[Service] -Type=oneshot -ExecStart=/bin/echo libpruio > /sys/devices/bone_capemgr.*/slots - -[Install] -WantedBy=multi-user.target diff --git a/package_lists.py b/package_lists.py index 0029e8f..d010a03 100644 --- a/package_lists.py +++ b/package_lists.py @@ -1,13 +1,14 @@ PYTHON_MODULES_TO_INSTALL = [ + 'flask', 'geopy', 'gevent', - 'gevent-websocket', +# 'gevent-websocket', 'Flask-uWSGI-WebSocket', 'markdown2', 'redis', 'uwsgi', 'pytronics', - 'pytumblr', +# 'pytumblr', # appears busted for Python 3 'bitstring', 'Flask-Login', 'twilio' @@ -26,6 +27,7 @@ 'gpsd-clients', 'htop', 'ipython-notebook', + 'ipython3-notebook', 'libpq-dev', 'libftdi-dev', 'lsof', @@ -33,14 +35,24 @@ 'postgis', 'postgresql', 'python-flask', + 'python3-flask', 'python-matplotlib', - 'python-mpltoolkits.basemap', + 'python3-matplotlib', + 'python-mpltoolkits.basemap',# No Python 3 version yet + 'python3-pip', 'python-psycopg2', + 'python3-psycopg2', 'python-requests', + 'python3-requests', +# 'python3-rpi.gpio', 'python-scipy', + 'python3-scipy', + 'python3-serial', + 'python3-smbus', 'python-webcolors', + 'python3-webcolors', 'strace', - 'supervisor', + 'supervisor', # Not sure if this supports Python 3 or not 'vim', 'zip', 'zsh' @@ -60,10 +72,3 @@ #'libgtk2.0-common', # probably breaks OpenCV. Also, required by gpsd-clients (and maybe also by some Python libs) 'libgtk-3-common' # removes Gstreamer and Numpy ] - -BONESCRIPT_SERVICES = [ - 'cloud9', - 'bonescript', - 'bonescript-autorun', - 'apache2' -] From ce8919cb1a3f2e46827ffe412eee30f7caf9c24d Mon Sep 17 00:00:00 2001 From: pingswept Date: Thu, 30 Jul 2015 11:10:11 -0400 Subject: [PATCH 2/5] Help uWSGI find server.py to import --- public.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public.ini b/public.ini index 5cfce74..feab601 100644 --- a/public.ini +++ b/public.ini @@ -2,7 +2,7 @@ socket = 127.0.0.1:5000 logto = /var/log/uwsgi/public.log processes = 1 -env = PYTHONPATH=$PYTHONPATH:/var/www +env = PYTHONPATH=$PYTHONPATH:/var/www/public wsgi-file = /var/www/public callable = public -catch-exceptions = True \ No newline at end of file +catch-exceptions = True From a5181037b6e0a6c5865247e75a38ced77680103f Mon Sep 17 00:00:00 2001 From: pingswept Date: Thu, 30 Jul 2015 11:13:29 -0400 Subject: [PATCH 3/5] Help uWSGI find editor --- editor.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editor.ini b/editor.ini index 285cffb..d28251c 100644 --- a/editor.ini +++ b/editor.ini @@ -2,6 +2,6 @@ socket = 127.0.0.1:5001 logto = /var/log/uwsgi/editor.log processes = 1 -env = PYTHONPATH=$PYTHONPATH:/var/www +env = PYTHONPATH=$PYTHONPATH:/var/www/editor wsgi-file = /var/www/editor -callable = editor \ No newline at end of file +callable = editor From 439b5f57bcc947efa11993d22a794568a346ed62 Mon Sep 17 00:00:00 2001 From: Brandon Stafford Date: Wed, 19 Jul 2023 18:23:16 -0400 Subject: [PATCH 4/5] Shut up, Dependabot! --- requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 54c05f1..5eab86c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,8 +5,8 @@ argparse==1.2.1 configobj==4.7.2 distribute==0.7.3 gyp==0.1 -numpy==1.6.2 +numpy==1.25.0 pyserial==2.5 urwid==1.0.1 wicd==1.7.2.4 -wsgiref==0.1.2 \ No newline at end of file +wsgiref==0.1.2 From 6a235640aabea6a61d7e7b9c8bac4244e1151891 Mon Sep 17 00:00:00 2001 From: Brandon Stafford Date: Tue, 25 Jul 2023 17:48:46 -0400 Subject: [PATCH 5/5] Shut up, Dependabot! --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5eab86c..e479d5f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ Adafruit-BBIO==0.0.19 argparse==1.2.1 -configobj==4.7.2 +configobj==5.1.0 # changed to make Dependabot shut up distribute==0.7.3 gyp==0.1 numpy==1.25.0