Skip to content

Interactive Photo Gallery. A system for interactive display of pictures on multiple screens/projectors controlled by tablets.

Notifications You must be signed in to change notification settings

pg-andersson/iapg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iapg (interactive photo gallery)

A system for interactive display of pictures - on multiple screens/projectors - controlled by tablets

Purpose

Suppose one or a few photography clubs will have an interactive picture exhibition with the following features:
  • Pictures from the members should be displayed on screens/projectors.
  • It should be possible to display a picture simultaneously on multiple screens/projectors.
  • The viewing should be controlled by thumbnails on tablets.
  • When a thumbnail is clicked the corresponding picture should be displayed on the associated screens/projectors.
  • When there has not been a thumbnail click for a while, a slide-show should run.
  • It should be possible to run the exhibition in many rooms by using multiple tablets, each with its own set of screens/projectors.
  • Many clubs should have the possibility to take part in the exhibition, but they should be independent of each other.
  • To be fair to the photographers, all should have equal chance where their thumbnails are placed/ordered on a tablet.
  • "club" should be used in a broad sense. It could be just pictures from a specific theme like street photography, birds, cars, etc. (or a collection for a slide show)
  • If you just want simple slideshows you do not need tablets at all. The system will automatically run slideshows on all screens that have "connected" to the various clubs.

Environment

This system requires:

  • A LAN.
  • A tablet. Its browser will show thumbnails for the viewers to click on.
  • A browser (on any computer) or a dedicated "kiosk" with a screen/projector. It will retrieve a tablet (browser) clicked picture from a picture server and display it.
  • A picture server. It will host the pictures and respond to requests from the tablets and the kiosks.
  • A laptop to maintain the system and view its status.
  • Pictures in jpeg format (a picture size of 2 MB should be enough). Thumbnails are automatically created by the system.

For a trial or a demo the system can be set up as follows

  • A LAN
  • The tablet could be a browser window on a laptop.
  • The "kiosk" could be another browser window on a laptop. The window is thus the "screen"
  • The picture server could run in any Debian computer, for example a Raspberry Pi or in a Virtual Box.

This kit includes a ready-to-run demo-gallery :

  • HW requirements as in the trial above.
  • For the sake of simplicity the picture server is assumed to have the IP address 192.168.0.250.
  • When the actions in the SW Installation chapter are done you can run the demo. See the chapter "To run the pre-installed demo-gallery"

The environment in a gallery

A minimal scenario



From the demo-gallery

The tablet with the thumbnails

The control view

The display screen/projector on the kiosk

The display screen


The default setup

  • After the SW is installed the system is independent of Internet access.
  • The system needs support from a router with at least one LAN port, WiFi and DHCP.
  • For simplicity the picture server should be connected via an ethernet cable to the router.
  • In a show room it is more convenient to use WiFi in the kiosks but with ethernet cables it is less to configure.
  • Kiosks and tablets are "associated" in groups. In a group the same picture will be shown on all screens when a thumbnail is clicked.

The "gallery" was tried out with the following HW

  • A tp-link Archer AX12 on a LAN without internet.
  • Raspberry Pi4 and Pi5 with 64-bit raspian as picture server and kiosk.
  • Browsers and tablets.

The "server room" in the "gallery"

Server hall



Principles of operation

Both the picture server and a dedicated kiosk are designed to run headless, without monitor, keyboard and mouse.

You can though use the desktop on the picture server (if the peripherals are connected.)

If you use a browser on an ordinary computer as a kiosk the desktop is there as well.

A dedicated kiosk can only run headless because its desktop is bound to the screen/projector.

An installed system does not need internet access in the gallery. But the clocks on the servers will not be accurate without Internet time synchronisation . This will not disturb the showings.

When the picture server and dedicated kiosk(s) are booted a supervisor program in each of them will be started.

  • It will look for proper configuration files. If a configuration file is missing or bad it will alarm and wait until the file is proper. When the configuration files look proper the actual server or kiosk will be started.

  • It will immediately detect a configuration change or when pictures have been added/deleted etc. It will validate the changes and restart the related server programs in order for them to use the new configuration.

With a (monitoring) browser you can view the configuration files, the uploaded member pictures, the status and get notifies on errors.
The browser will continuously show system status and configuration errors (as long as the LAN is up).

Computers that rely on WiFi are much more prone to network failures than those with ethernet cable connections.
The "Network problem" section in Miscellaneous describes the method used to try to keep WiFi connected kiosks "up".

The configuration files and the pictures are supposed to be updated/uploaded with FileZilla.


SW Installation

Installation on both picture server and kiosks

Prepare a system image (micro-SD or USB stick):
  1. Use "Raspberry Pi Imager" to create a bootable image for the Pi.

  2. In "EDIT SETTINGS" add the user "fg" and configure WiFi with the SSID that will be used in the router in the gallery.

    Be aware that "EDIT SETTINGS" will not keep the passwords you have once "SAVE". If you go back to "EDIT SETTINGS" and if the passwords fields are filled with **************** the passwords are gone.


    If it looks like this, the "wrong" passwords will be saved on the image. A kiosk will thus not startup because it can't find the network/router.
    Pi imager
    If it looks like this, the passwords you have entered will be saved on the image.
    Pi imager

    Boot the Raspberry Pi and do the installation:

  1. Enable SSH remote terminal access. FileZilla needs it. You can then also login remotely via ssh.
    sudo raspi-config
    
    Select "3 Interface Options" -> "I1 SSH Enable/disable remote command line access using SSH" -> "Would ... Yes"

  2. The servers use Node.js JavaScript runtime environment and its package manager.
    sudo apt-get install node.js
    sudo apt-get install npm
    
  3. Install the iapg kit:
    You should be in /home/fg as soon as the system has booted. If not: reboot and login as "fg".

    To get the kit, browse to:
    https://github.com/pg-andersson/iapg and click on "<>Code" and then "Download ZIP"
    Github will create iapg-main.zip that will be copied to Downloads.

  4. When you unzip iapg-main.zip the directory /home/fg/iapg-main will be created and the files copied to it.
    Make sure you are in /home/fg and run:
    unzip Downloads/iapg-main.zip (You must be in "/home/fg" and the user must be "fg" when you unzip).

  5. Node.js dependencies must be installed now.
    Go to the just created /home/fg/iapg-main and run:
    npm install(You must be in "/home/fg/iapg-main" and the user must be "fg").
    npm install sharp (it creates thumbnails).
    npm install better-sqlite3 (thumbnails are cached here).

Specific to the picture server

  1. Important. The picture server needs a static IP address.

    The router will give the server a static IP address if you define a static lease for the server (actually its MAC) in the gallery router (DHCP).
    Run this command to get the MAC:
    ip address    The output will be like this: 
    2: eth0: ...
        link/ether e4:5f:01:a9:4c:ed ...   This is the MAC you later on shall add in the static lease in the gallery router
        inet .....
    
  2. The supervisor shall be started by systemd at boot time.
    sudo mv /home/fg/iapg-main/iapg_init_server.service /etc/systemd/system/
    sudo systemctl enable iapg_init_server.service
    
  3. The system image is now ready to be used as a picture server in a gallery now.

Specific if you use dedicated kiosk(s)

  1. The kiosk and the supervisor shall be started by systemd at boot time.
    sudo mv /home/fg/iapg-main/iapg_init_kiosk.service /etc/systemd/system/
    sudo systemctl enable iapg_init_kiosk.service
    
  2. systemd shall start the program that will reboot the kiosk on network failures.
    sudo mv /home/fg/iapg-main/iapg_kiosk_rebooter.service /etc/systemd/system/
    sudo systemctl enable iapg_kiosk_rebooter.service
    
  3. There is only one parameter file in a kiosk. To update it in the gallery, via FileZilla, you must know the IP of the kiosk.
    Once the kiosk is up:
    • The status monitor will show the IP of active kiosks.

    • If show_kiosk_ip_as_footer=1 (the default is 0 off) in /home/fg/iapg-main/etc/iapg_server.conf in the picture server,
      the IP, port and club-id for a kiosk will be shown in a footer on the kiosk displays.
      This annoys and even spoils the experience of the showings and must only be used when the kiosks are tested in the gallery.

  4. The kiosk requires autologin to start the main program.
    sudo raspi-config
    Select "1 System Options" -> "S5 Boot / Auto Login" -> "B4 Desktop Autologin"
    The kiosk is now set up to run headless (without monitor, keyboard and mouse) as a "kiosk" at the next boot.

  5. If a kiosk has problems to startup its screen will show the cause of the problems.

    The system image is now ready to be used as a "dedicated" kiosk in a gallery now.

Related information

The picture server can run headless or with a desktop.
  1. The default is to run the picture server as headless (but you can of course connect a monitor, keyboard and mouse.)
A kiosk can only run headless because its desktop is bound to the screen/projector.
  1. You can thus only use FileZilla to update iapg_kiosk.conf (or from your laptop via SSH).
Any update in the picture server or a kiosk will be verified by the supervisor program.
  1. Errors will be shown on the monitoring web page.

  2. An update in the picture server (new pictures, clublist.conf, iapg_server.conf) will work immediately (well, in less than 10s).

  3. An update in a kiosk (iapg_kiosk.conf) will also work immediately

The system starts with a slideshow per group (tablet). Such a slideshow will run until it is interrupted by a thumbnail request.

To stop the system
Just power off.

To run the pre-installed demo-gallery

The picture server has the IP address 192.168.0.250. Change "192.168.0.250" in the three "open" statements below if your server has another IP address.
  1. Boot the picture server.

  2. Run a browser for status viewing. A "reload of the web page" may be needed if the server is not yet up.
    open http://192.168.0.250:53000/index.html

  3. Run the browser as a kiosk.
    open http://192.168.0.250:53001/show.html

  4. Load the tablet (or a browser window) with the pre-installed thumbnails. Click on one and the picture shall be seen on the "kiosk".
    open http://192.168.0.250:53001/index.html

The principle for storing pictures

  • The pictures are stored in club and member directories.

  • The following club directories /home/fg/iapg-main/html/club-1 , club-2 ... club-10 are predefined.

  • A directory for a photographer must have the name of the photographer.
    /home/fg/iapg-main/html/club-1/member-x

  • A picture file must be in jpg-format. A size of 2 MB should be enough
    /home/fg/iapg-main/html/club-1/member-x/A picture I want to show.jpg

Examples

  1. A server with only one club will have just one directory with sub-directories for the photographers:
    Club 1:
    /home/fg/iapg-main/html/club-1/
    /home/fg/iapg-main/html/club-1/Balder Friggsson/Balder Friggsson.jpg
    /home/fg/iapg-main/html/club-1/Balder Friggsson/mistletoe.jpg
    /home/fg/iapg-main/html/club-1/Tor Jordsson/Hugin.jpg
    /home/fg/iapg-main/html/club-1/Tor Jordsson/Sleipner.jpg>
    /home/fg/iapg-main/html/club-1/Tor Jordsson/Tor Jordsson.jpg
    
  2. A server with many clubs means one directory per club with sub-directories for the photographers:
    Club 1:
    /home/fg/iapg-main/html/club-1/
    /home/fg/iapg-main/html/club-1/Balder Friggsson/Balder Friggsson.jpg
    /home/fg/iapg-main/html/club-1/Balder Friggsson/mistletoe.jpg
    /home/fg/iapg-main/html/club-1/Tor Jordsson/Hugin.jpg
    /home/fg/iapg-main/html/club-1/Tor Jordsson/Sleipner.jpg
    /home/fg/iapg-main/html/club-1/Tor Jordsson/Tor Jordsson.jpg
    
    Club 2: /home/fg/iapg-main/html/club-2/ /home/fg/iapg-main/html/club-2/Louis Daguerre/Louis Daguerre.jpg /home/fg/iapg-main/html/club-2/Louis Daguerre/Notre Dame.jpg /home/fg/iapg-main/html/club-2/Louis Daguerre/Pont Neuf.jpg

    /home/fg/iapg-main/html/club-2/Robert Capa/Loyalist Militiaman.jpg /home/fg/iapg-main/html/club-2/Robert Capa/Robert Capa.jpg

Note
Because a "signature" picture of the photographer will be shown on the tablet, a picture with the name of the photographer(+.jpg) must exist in his directory.
The signature-picture without the extension ".jpg" will thus have the same name as the directory it is stored in.

The signature-picture will be shown as the first thumbnail in the block of the photographer but it is not meant to be displayed on the screens/projectors (and is thus not clickable). All other pictures will be displayed in directory order.

You can store as many "clubs" as you like on the server. Only those in the clublist.conf will be started.


Guidlines for configurations

The cooperation between the tablets, kiosks and the picture server are based on port numbers.

  • Tablets and kiosks work in groups.
  • Tablets and kiosks are grouped when they use the same "port" number.
  • The picture server use this port number to find the club that keeps the clicked picture.
  • This chain means that when a thumbnail is clicked the big picture will be sent to all kiosks in the same group as the tablet.
One club can serve up to 10 tablets/kiosks
Club ID Port numbers for pairing tablets and kiosks to a club
club_1 53001, 53002, ... 53010
club_2 53011, 53012, ... 53020
club_3 53021, 53022, ... 53030
club_99 53991, 53992, ... 53999

An example: lets say that 3 tablet/kiosk pairs will show pictures from club_2.
The first tablet must then use port=53011, the second 53012 etc.

The configurations

The picture server in the examples will get the IP address 192.168.0.250 from DHCP in the gallery router. This has the lease range 192.168.0.2 - 192.168.0.250
The last address in the span is added in the DHCP config as a static lease with IP 192.168.0.250 for the MAC address of the picture server.

In the picture server
  1. The pictures are stored in club and member directories.

    See: "The principle for storing pictures".
    To upload pictures:
    1. A member should provide an USB-stick with pictures in a directory with his name.

    2. Use FileZilla to copy that directory to /home/fg/iapg-main/html/club-1, 2, .../ in the picture server.
      See the next picture.

    You can have "dormant" club directories and only those mentioned in the clublist file will be part of the slideshows.

  2. The parameters that control the behaviour of a slideshow are stored in /home/fg/iapg-main/etc/iapg_server.conf
    waittime_before_slideshow_starts = 60
    pict_displaytime_slideshow = 10
    
    This means:
    After 60 seconds display of a picture a slideshow will begin or resume until a thumbnail is pressed.
    During a slideshow a picture is displayed for 10 seconds.

    Edit the file on your laptop and "FileZilla" copy it to /home/fg/iapg-main/etc/iapg_server.conf in the picture server.

  3. Slideshows will be started for the clubs named in /home/fg/iapg-main/etc/clublist.conf
    A configuration example with two clubs:
    club:
    club_id: club-1
    club_name: Acity picture club
    nr_of_displays: 2
    member_position: r
    

    club: club_id: club-2 club_name: Bcity picture club nr_of_displays: 1 member_position: n

    This means:
    club-1 has directory /home/fg/iapg-main/html/club-1/ for the member pictures and has 2 kiosks controlled by one tablet each.
    The sort order of the members placement on the tablet will be r=randomized. "Acity picture club" is the name of the club.

    club-2 uses /home/fg/iapg-main/html/club-2/ and 1 kiosk controlled by one tablet.
    The sort order of the members placement on the tablet will in n=name order.

    Edit the file on your laptop and "FileZilla" copy it to /home/fg/iapg-main/etc/clublist.conf in the picture server.

In a dedicated kiosk
  1. The parameters for a kiosk are stored in /home/fg/iapg-main/etc/kiosk.conf
    A configuration example:
    addr_server=192.168.0.250
    club_id=club-1
    port_nr_for_this_kiosk=53001
    
    This means:
    This kiosk will get pictures for club-1 from the picture server 192.168.0.250 using port 53001.

    Edit the file on your laptop and "FileZilla" copy it to /home/fg/iapg-main/etc/kiosk.conf in the kiosk.
In a browser that is used as a kiosk
  1. The same "show" as in the example above:
    open http://192.168.0.250:53001/show.html
    This means:
    This browser will get pictures for club-1 from the picture server 192.168.0.250 using port 53001.
In a tablet
  1. To get the thumbnails page:
    open http://192.168.0.250:53001/index.html
    This means:
    The tablet will get the thumbnails for club-1 from 192.168.0.250 using port 53001
N.B. A tablet and a kiosk are tied together by using the same port number.

Use FileZilla to copy a member's pictures from the USB stick to /home/fg/iapg-main/html/club-?

In this screencopy "Nils Nilsson" has his pictures in the directory "Nils Nilsson" on the USB "NNPICT".
That directory is copied to his club's directory in the picture server.

copy


Monitoring

open http://192.168.0.250:53000

You get a page from the picture server where you can:

  • View:
    • status
    • error messages
    • configurations
    • member pictures
    • click statistics

  • Open a status window:
    • That will show server status every 10 seconds
      • Errors
      • The parameters used when the Clubs were activated for viewing
      • Details about the Clubs activated for viewing
      • Snapshots of the communication between the picture server and the kiosks

      • Links to status windows in the active kiosks
        • The status page in the selected kiosk

Schreenshots of monitor and status windows in the picture server

(The screens are roughly related to example 3 further down)

gs

gs


Three examples of a setup in a gallery

1: A setup for a small exhibition with one club, one tablet and one screen

The club is called club-1.
A small exhibition

The configurations:
  1. In the picture server
    In /home/fg/iapg-main/etc/clublist.conf
    club:
    club_id: club-1
    club_name: The photoclub in Acity
    nr_of_displays: 1
    member_position: r
    
  2. In the kiosk
    In /home/fg/iapg-main/etc/iapg_kiosk.conf
    addr_server=192.168.0.250
    club_id=club-1
    port_nr_for_this_kiosk=53001
    
  3. For the tablet
    open http://192.168.0.250:53001/index.html
    
A tablet is "paired" to a kiosk by using the same port number. They are thus in the same group.

2: A setup where one club will use three rooms for slide shows

Three tablets will be setup to load thumbnails from the same "club-directory".
Three rooms

The configurations:
  1. In the picture server
    In /home/fg/iapg-main/etc/clublist.conf
    club:
    club_id: club-1
    club_name: The photoclub in Bcity
    nr_of_displays: 3
    member_position: r
    
  2. In kiosk 1
    In /home/fg/iapg-main/etc/iapg_kiosk.conf
    addr_server=192.168.0.250
    club_id=club-1
    port_nr_for_this_kiosk=53001
    
  3. In kiosk 2
    In /home/fg/iapg-main/etc/iapg_kiosk.conf
    addr_server=192.168.0.250
    club_id=club-1
    port_nr_for_this_kiosk=53002
    
  4. In kiosk 3
    In /home/fg/iapg-main/etc/iapg_kiosk.conf
    addr_server=192.168.0.250
    club_id=club-1
    port_nr_for_this_kiosk=53003
    
  5. For the tablets
    open http://192.168.0.250:53001/index.html
    open http://192.168.0.250:53002/index.html
    open http://192.168.0.250:53003/index.html
    
A tablet is "paired" to a kiosk by using the same port number. They are thus in the same group.

3: A setup with two clubs where each will have a "club-directory", tablets and kiosks

Two clubs

The configurations:
  1. In the picture server
    In /home/fg/iapg-main/etc/clublist.conf
    club:
    club_id: club-1
    club_name: The photoclub in Acity
    nr_of_displays: 1
    member_position: r
    

    club: club_id: club-2 club_name: The photoclub in Bcity nr_of_displays: 2 member_position: n

  2. In the kiosk for club_1
    In /home/fg/iapg-main/etc/iapg_kiosk.conf
    addr_server=192.168.0.250
    club_id=club-1
    port_nr_for_this_kiosk=53001
    
  3. In the first kiosk for club_2
    In /home/fg/iapg-main/etc/iapg_kiosk.conf>
    addr_server=192.168.0.250>
    club_id=club-2
    port_nr_for_this_kiosk=53011
    
  4. In the second kiosk for club_2 (Not visible in the drawing above)
    In /home/fg/iapg-main/etc/iapg_kiosk.conf
    addr_server=192.168.0.250
    club_id=club-2
    port_nr_for_this_kiosk=53012
    
  5. In the tablets
    open http://192.168.0.250:53001/index.html
    open http://192.168.0.250:53011/index.html
    open http://192.168.0.250:53012/index.html (Not visible in the drawing above)
    
A tablet is "paired" to a kiosk by using the same port number. They are thus in the same group.

Statistics

The system counts thumbnail and "slideshow" clicks and save them in json/csv files in /home/fg/iapg-main/var/stat/.
The following statistics can be viewed from the monitoring web page.
  • Accumulated statistics for all tablets. One per day.
  • Statistics per tablet. One per day
  • Statistics every time a thumbnails page on a tablet is "loaded/reloaded"

Miscellaneous

Security issues in public places.

Assume that you will have a show in a "gallery".
Bring along a router that is purely configured for your "showing"-LAN (No internet so the LAN will be fenced off from the world).
An attack from an intruder in your dedicated gallery LAN is then restricted to the router and the micro-SD cards in the Raspberry Pis. The tablets work as in any public area

Network problems

If there are network problems a kiosk will reboot and display the reason on the screen. This will will go on until the network (router) is up again. Then the kiosk will boot into the normal slideshow behaviour.


About

Interactive Photo Gallery. A system for interactive display of pictures on multiple screens/projectors controlled by tablets.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •