Skip to content

Latest commit

 

History

History
167 lines (108 loc) · 4.72 KB

README-EN.md

File metadata and controls

167 lines (108 loc) · 4.72 KB

Net-Flux

Ultra simple signage boards in the local or public network

Objective:

Mainly signage boards, but also publish and/or receive content from other machines on the local or public network.
The contents are in fact complete or partial screenshots.
The machines are clients and/or servers located indifferently on the local or public network
A simple browser and a local IP will be enough to manage this matter.

Principle

There are 2 operating modes:

There are 3 services:

  • Simple local publication: ./webserver --handle capture

  • MQTT messaging clients: ./webserver --handle monitor

  • Publication by MQTT messaging, screenshot: ./snoop.py

Machines can be both listening or being listened to.
Under Linux, supervisor will be used to start or stop these services
All scripts are in python3
The display is done only from a single html file flux/web/index.html which is easily modifiable.

Machines used

  • Linux machines preferred, but not mandatory.
  • Raspberry pi 3, 4 5 are ideal.
  • Firefox, Chromium, Chrome and derivatives are recommended
About raspberry pi

Provide ssh access to install VNC. A connected screen is not necessary.
All manipulations can then be done directly by VNC.

Preview with a raspberry pi4

The machine is in 192.168.1.10:8080
In a console:

etc...

Installation

Clone or download the code from https://github.com/deunix-educ/Net-Flux

    $> git clone git@github.com:deunix-educ/Net-Flux.git
    or
    $> tar xzfv Net-Flux-main.zip
    $> mv Net-Flux-main Net-Flux
    
    $> cd Net-Flux
  • In etc directory

    • bin some utilities
    • conf example of configuration for a raspberry pi4
    • install example of system installation for a raspberry pi4
  • Install the following packages:

      $> sudo apt update
      $> sudo apt -y install build-essential git supervisor
      $> sudo apt -y python3-dev python3-pip python3-venv chromium-chromedriver
      $> sudo cp /etc/supervisor/supervisord.conf /etc/supervisor/supervisord.conf.old
      $> sudo cat >> /etc/supervisor/supervisord.conf << EOF
      [inet_http_server]
      port=*:9001
      username=root
      password=toor
      EOF
    
  • Install mosquitto if necessary on a machine on the local network

      $> sudo apt -y install mosquitto
    
  • Otherwise use a public mqtt server

  • Change the rights of the following files

      $> chmod +x netflux/*.py
      $> chmod +x etc/bin/*.sh
    
  • Install the python virtual environment (in .venv)

      $> etc/bin/venv-install etc/install/requirements.txt
    
  • Finally install the service supervisor configuration file

      $> sudo cp etc/conf/netflux_service.conf /etc/supervisor/conf.d/
      $> sudo supervisorctl reread && sudo supervisorctl update
    

Operation

Test by hand.

    $> cd netflux
  • copy config_example.yaml

      $> cp config_example.yaml config.yaml
    
  • Edit the services configuration from config.yaml

    • Complete the mqtt fields

    • Complete screen

      • fps x image/s
      • title screen title
      • display: blank or (x11 display: 0.0 for linux)
    • complete server

      • host: ip or 0.0.0.0 for any ip
      • port: 8080

Simple local publication

Local mode if the machine server/capture is in 192.168.1.10:8080

    $> ./webserver --handle capture

Clients visit the page with chromium

    http://192.168.1.10:8080

Clients can also launch chromium directly

    $> ./browser.py --host 192.168.1.10 --port 8080

On the server machine we can launch the demonstration

    $> ./demo_webpage.py

Publication and capture by MQTT messaging

Publishing by MQTT messaging by screenshot
On the machines that must publish,

  • Service to launch

     ./snoop.py
    

MQTT messaging clients in 192.168.1.20:8080