cc 4 år sedan
förälder
incheckning
8075160e7c
7 ändrade filer med 181 tillägg och 31 borttagningar
  1. 2 1
      autocli.yml
  2. 1 0
      home.bat
  3. 4 3
      hosts.yml
  4. 59 0
      jlab/Dockerfile
  5. 2 2
      matrix/fat/Dockerfile
  6. 67 15
      services.yml
  7. 46 10
      vaping/config.yml

+ 2 - 1
autocli.yml

@@ -2,7 +2,7 @@ auto_reload: 1
 confirm_quit: false
 
 modules: [auto.lib.docker_base, auto.lib.infrastructure]
-letsencrypt_email: thecere@gmail.com
+list_prefix: HOME
 
 path:
     cache: t:\autocli_home\cache
@@ -25,4 +25,5 @@ image:
 
 service:
     infrastructure: c:\apps\_home\services.yml
+    letsencrypt_email: thecere@gmail.com
 

+ 1 - 0
home.bat

@@ -1,4 +1,5 @@
 @echo off
+@chcp 65001 > nul
 cd %~dp0
 d:\vls-trunk\env-win64\python27\python.exe -m auto.cli %*
 pause

+ 4 - 3
hosts.yml

@@ -21,11 +21,12 @@ all:
       #~ ansible_ssh_host: cere.duckdns.org
       #~ docker_engine_host: localhost
       #~ docker_engine_port: 10243
-      ansible_ssh_host: 192.168.178.43
+      ansible_ssh_host: himbeere.fritz.box
     blaubeere:
-      ansible_ssh_host: 192.168.178.24
+      ansible_ssh_host: blaubeere.fritz.box
     erdbeere:
       ansible_ssh_host: 192.168.178.29
     waldbeere:
       ansible_ssh_host: waldbeere.fritz.box
-
+    stachelbeere:
+      ansible_ssh_host: 192.168.178.111

+ 59 - 0
jlab/Dockerfile

@@ -0,0 +1,59 @@
+# This file creates a container that runs a jupyter lab server on Raspberry Pi
+# Originally from: https://github.com/mkjiang/rpi-jupyter/blob/master/Dockerfile and https://github.com/kidig/rpi-jupyter-lab/blob/master/Dockerfile
+
+FROM balenalib/raspberry-pi-python:3.8-build
+
+WORKDIR /root
+
+# Update pip and install jupyter
+RUN apt-get update
+RUN apt-get install -y libncurses5-dev
+RUN apt-get install -y libzmq-dev
+RUN apt-get install -y libfreetype6-dev
+RUN apt-get install -y libpng-dev
+RUN apt-get install -y python-dev --fix-missing
+RUN apt-get install -y patch
+RUN apt-get install -y build-essential
+
+RUN pip3 install --upgrade pip
+RUN pip3 install cython
+RUN pip3 install readline ipywidgets jupyter jupyterlab
+RUN pip3 install numpy
+
+# needs to build orjson - does not work on armv7
+#~ RUN pip3 install ipycanvas
+#~ RUN jupyter labextension install ipycanvas
+
+# Configure jupyter
+RUN jupyter nbextension enable --py widgetsnbextension
+RUN jupyter serverextension enable --py jupyterlab
+RUN jupyter notebook --generate-config
+RUN mkdir notebooks
+RUN sed -i "/c.NotebookApp.open_browser/c c.NotebookApp.open_browser = False" /root/.jupyter/jupyter_notebook_config.py \
+        && sed -i "/c.NotebookApp.ip/c c.NotebookApp.ip = '*'" /root/.jupyter/jupyter_notebook_config.py \
+        && sed -i "/c.NotebookApp.notebook_dir/c c.NotebookApp.notebook_dir = '/root'" /root/.jupyter/jupyter_notebook_config.py \
+        && sed -i "/c.NotebookApp.password/c c.NotebookApp.password = 'sha1:5815fb7ca805:f09ed218dfcc908acb3e29c3b697079fea37486a'" /root/.jupyter/jupyter_notebook_config.py
+
+VOLUME /root/notebooks
+
+# Add Tini. Tini operates as a process subreaper for jupyter. This prevents kernel crashes.
+ENV TINI_VERSION 0.18.0
+ENV CFLAGS="-DPR_SET_CHILD_SUBREAPER=36 -DPR_GET_CHILD_SUBREAPER=37"
+
+ADD https://github.com/krallin/tini/archive/v${TINI_VERSION}.tar.gz /root/v${TINI_VERSION}.tar.gz
+RUN apt-get install -y cmake
+RUN tar zxvf v${TINI_VERSION}.tar.gz \
+        && cd tini-${TINI_VERSION} \
+        && cmake . \
+        && make \
+        && cp tini /usr/bin/. \
+        && cd .. \
+        && rm -rf "./tini-${TINI_VERSION}" \
+        && rm "./v${TINI_VERSION}.tar.gz"
+
+ENTRYPOINT ["/usr/bin/tini", "--"]
+
+EXPOSE 8888
+
+# passwd is "code"
+CMD ["jupyter", "lab", "--allow-root", "--NotebookApp.token=''", "--NotebookApp.password='argon2:$argon2id$v=19$m=10240,t=10,p=8$GXZHXm2yFviNanoy9hyULw$1YLbN5ymQxuwvwPVN5e0hA'"]

+ 2 - 2
matrix/fat/Dockerfile

@@ -67,7 +67,7 @@ RUN pyversions -d
 
 RUN git clone https://github.com/hzeller/rpi-rgb-led-matrix.git /matrix
 WORKDIR /matrix
-# RUN sed -i "s/=regular/=adafruit-hat-pwm/g" lib/Makefile
+RUN sed -i "s/=regular/=adafruit-hat-pwm/g" lib/Makefile
 
 # for C++-demos
 RUN make -C examples-api-use
@@ -75,7 +75,7 @@ RUN make -C examples-api-use
 # for python interface
 RUN cd bindings/python && make build-python install-python
 
-COPY *.py /
+# COPY *.py /
 # CMD python -u /pixelreceiver.py > /pixel/receive.log & jupyter notebook --allow-root
 # CMD jupyter notebook --allow-root
 CMD /bin/bash -c "sleep 10000000"

+ 67 - 15
services.yml

@@ -23,6 +23,15 @@ jupyter: # pw: letscode.00
   docker:
     build: jupyter
 
+jlab:
+  host: stachelbeere
+  docker:
+    build: jlab
+    image: jlab
+    ports: 80:8888
+    volumes:
+      - /opt/jlab/notebooks:/root/notebooks
+
 
 domoticz:
   host: himbeere
@@ -170,11 +179,10 @@ alexa: # https://alexa.amazon.de
       DOMO_ALEXA_PW: ibm92buVQ12nhipkP4fg
 
 matrix: # interface with RGB LED-Matrix
-  #~ fqdn: alexa.cere.duckdns.org
-  host: blaubeere
+  host: waldbeere
   docker:
     init: true
-    build: matrix
+    build: matrix/fat
     # matrix driver needs access to /dev/mem
     privileged: true
     ports: 17888:8888, 10000:10000/udp, 10001:10001/udp
@@ -187,29 +195,72 @@ matrix: # interface with RGB LED-Matrix
 
   commands:
     # some rotating square
-    demo00: examples-api-use/demo -c 4 --led-show-refresh -D0
+    demo00: examples-api-use/demo -c 6 -R 180 --led-show-refresh -D0
+    # forward scrolling an image
+    demo01: examples-api-use/demo -c 6 -R 180 --led-show-refresh -D1 examples-api-use/runtext.ppm
+    # test image
+    demo03: examples-api-use/demo -c 6 -R 180 -D3
+    # Abelian sandpile model (-m <time-step-ms>)
+    demo06: examples-api-use/demo -c 6 -R 180 -D6
+    # Conway's game of life (-m <time-step-ms>)
+    demo07: /bin/bash -c "while true; do examples-api-use/demo -c 6 -R 180 -b 100 -D7 -t 15; done"
+    # Langton's ant (-m <time-step-ms>)
+    demo08: examples-api-use/demo -c 6 -R 180 -m 1  --led-show-refresh -D8
+    # Volume bars
+    demo09: examples-api-use/demo -c 6 -R 180 -D9
+    # Evolution of color
+    demo10: examples-api-use/demo -c 6 -R 180 -D10
+    # Brightness pulse generator
+    demo11: examples-api-use/demo -c 6 -R 180 --led-pwm-bits=11 -D11
+    # python sample: rotatatin block
+    pydemo1: bindings/python/samples/rotating-block-generator.py -c 6 -R 180 --led-show-refresh
+    # python sample: like demo01
+    pydemo2: bindings/python/samples/image-scroller.py -c 6 -R 180 --led-show-refresh -i examples-api-use/runtext.ppm
+    # python sample: rotatatin block
+    pydemo3: bindings/python/samples/simple-square.py -c 6 -R 180 --led-show-refresh
+    # tail logs of pixelreceiver (udp server)
+    pixel_logs: tail -f /pixel/receive.log
+    # kill pixel receiver
+    pixel_kill: pkill -f "python -u /pixelreceiver.py"
+
+matrix2: # zerow: interface with RGB LED-Matrix
+  host: blaubeere
+  docker:
+    init: true
+    build: matrix/light
+    import: pixel
+
+    # matrix driver needs access to /dev/mem
+    privileged: true
+    # ports: 10000:10000/udp, 10001:10001/udp
+    volumes:
+      - /opt/pixel:/pixel
+
+  commands:
+    # some rotating square
+    demo00: examples-api-use/demo -c 6 --led-rows=64 --led-show-refresh -D0
     # forward scrolling an image
-    demo01: examples-api-use/demo -c 4 --led-show-refresh -D1 examples-api-use/runtext.ppm
+    demo01: examples-api-use/demo -c 6 --led-rows=64 --led-show-refresh -D1 examples-api-use/runtext.ppm
     # test image
-    demo03: examples-api-use/demo -c 4 -D3
+    demo03: examples-api-use/demo -c 6 --led-rows=64 -D3
     # Abelian sandpile model (-m <time-step-ms>)
-    demo06: examples-api-use/demo -c 4 -D6
+    demo06: examples-api-use/demo -c 6 --led-rows=64 -D6
     # Conway's game of life (-m <time-step-ms>)
-    demo07: /bin/bash -c "while true; do examples-api-use/demo -c 4 -b 20 -D7 -t 15; done"
+    demo07: /bin/bash -c "while true; do examples-api-use/demo -c 6 --led-rows=64 --led-show-refresh -b 20 -D7 -t 60; done"
     # Langton's ant (-m <time-step-ms>)
-    demo08: examples-api-use/demo -c 4 -m 1  --led-show-refresh -D8
+    demo08: examples-api-use/demo -c 6 --led-rows=64 -m 1  --led-show-refresh -D8
     # Volume bars
-    demo09: examples-api-use/demo -c 4 -D9
+    demo09: examples-api-use/demo -c 6 --led-rows=64 -D9
     # Evolution of color
-    demo10: examples-api-use/demo -c 4 -D10
+    demo10: examples-api-use/demo -c 6 --led-rows=64 -D10
     # Brightness pulse generator
-    demo11: examples-api-use/demo -c 4 --led-pwm-bits=11 -D11
+    demo11: examples-api-use/demo -c 6 --led-rows=64 --led-pwm-bits=11 -D11
     # python sample: rotatatin block
-    pydemo1: bindings/python/samples/rotating-block-generator.py -c 4 --led-show-refresh
+    pydemo1: bindings/python/samples/rotating-block-generator.py -c 6 --led-rows=64 --led-show-refresh
     # python sample: like demo01
-    pydemo2: bindings/python/samples/image-scroller.py -c 4 --led-show-refresh -i examples-api-use/runtext.ppm
+    pydemo2: bindings/python/samples/image-scroller.py -c 6 --led-rows=64 --led-show-refresh -i examples-api-use/runtext.ppm
     # python sample: rotatatin block
-    pydemo3: bindings/python/samples/simple-square.py -c 4 --led-show-refresh
+    pydemo3: bindings/python/samples/simple-square.py -c 6 --led-rows=64 --led-show-refresh
     # tail logs of pixelreceiver (udp server)
     pixel_logs: tail -f /pixel/receive.log
     # kill pixel receiver
@@ -220,5 +271,6 @@ vaping:
   docker:
     build: vaping
     ports: 6080:7021
+    log_config: {type: none}
 
 

+ 46 - 10
vaping/config.yml

@@ -9,6 +9,9 @@ probes:
         - host: 8.8.8.8
           name: Google
           color: red
+        - host: 9.9.9.9
+          name: Quad9
+          color: magenta
         - host: 4.2.2.1
           name: Level(3)
           color: white
@@ -42,19 +45,27 @@ probes:
         - host: 192.168.178.1
           name: FritzBox-7490
           color: white
-        - host: 192.168.178.25
+        - host: 192.168.178.66
+          name: Repeater1750-3
+          color: magenta
+        - host: 192.168.178.23
           name: Repeater1750-1
           color: orange
-        - host: 192.168.178.26
+        - host: 192.168.178.25
           name: Repeater1750-2
           color: green
+        - host: 192.168.178.47
+          name: Repeater1750-4
+          color: yellow
+
+
 
     pc:
       hosts:
-        - host: 192.168.178.36
+        - host: cbase.fritz.box
           name: cbase
           color: red
-        - host: 192.168.178.28
+        - host: blackbox.fritz.box
           name: blackbox
           color: white
         - host: 192.168.178.33
@@ -73,18 +84,27 @@ probes:
 
     mobil:
       hosts:
-        - host: 192.168.178.51
-          name: lilith-redmi
-          color: red
-        - host: 192.168.178.27
+
+        - host: cg-android.fritz.box
           name: cg-android
           color: white
-        - host: 192.168.178.45
+
+        - host: cr-ip4.fritz.box
           name: cr-ip4
           color: orange
-        - host: 192.168.178.40
+
+        - host: er-ip4.fritz.box
           name: er-ip4
           color: green
+
+        - host: cr-ip6.fritz.box
+          name: cr-ip6
+          color: yellow
+
+        - host: lr-redmi.fritz.box
+          name: lr-redmi
+          color: red
+
     sonos:
       hosts:
         - host: 192.168.178.31
@@ -100,6 +120,22 @@ probes:
           name: amp
           color: green
 
+    devices:
+      hosts:
+        # no icmp support
+        #~ - host: 192.168.178.21
+          #~ name: Echo
+          #~ color: magenta
+        #~ - host: 192.168.178.54
+          #~ name: Dot1
+          #~ color: orange
+        - host: CG-Stream65i.fritz.box
+          name: CG-Stream65i
+          color: green
+        - host: CG-TV.fritz.box
+          name: CG-TV
+          color: white
+
 plugins:
   - name: std_fping
     type: fping