Helper hardware to rapidly share images from a digital camera
Image Hub is a computer that joins your Wifi and accepts your camera memory card. It ingests JPEG images, creates a gallery web-app, and serves the app over the local network. Image Hub provides image browsing and saving for publishing to Instagram stories, facebook or other social media.
The intended hardware is a Raspberry Pi 3 board, USB card reader, and USB power bank. A little OLED display is optional.
The display isn't covered here.
- tested with jpegs created by a digital camera, this is easy way to avoid any missing data from jpegs from the web that may have EXIF stripped out
- two sd card readers are supported on Raspberry Pi, but it's easier to run on mac and drag files into
storage
to add to the ETL/db
- npm install the node application
- create the
/media
directory structure the node apps expect - create
.env
file
this is the directory structure on the root of the pi filesystem
media
βββ thumbs
βββ small
βββ storage
βββ stories
place a file named .env
in the project directory:
DISABLE_SERVER_RENDER=false
EXIFTOOL_PATH=/bin/exiftool
HOST=localhost
INITIAL_STATIC_SERVER=false
MEDIA_PATH=/media
PORT=3000
SQLITE_USE_WAL_MODE=true
SQLITE_WAL_CHECK_INTERVAL_SECONDS=10
- npm run etl in one terminal
- drag/drop a filename.JPG with exif data (an exif preview thumbnail is necessary, camera pictures work well for this) into the
storage
directory - use
npm run db:images
orr sqlite3 CLI (sqlite3 cam.db
) to check theimage
table has data - npm run server in another terminal
- load up
localhost:3000/all
(all ignores image create dates) to see the server loads
turn off server rendering for debugging
turn on a front-controller-style static file server for the media directroy (for emulating nginx sitting in front of the express app)
./live-logs.sh hub1sshhost
for node app access logs in journal./pull-nginx-journal-report.sh hub1sshhost
get and view nginx server report for hub1sshhost./pull-express-journal-report.sh hub1sshhost
get and view express server report for hub1sshhost./pull-nginx-access-report.sh someotherhost
get and view nginx access.log server report for someotherhost
- get a raspberry pi 3 with a large enough SD card to keep lots of JPEGS on (32gb+)
- install Raspbian Stretch lite or Stretch and expand the filesystem, set locales etc.
- set up the raspi with ssh key access i.e.
$ ssh mypi
lets you run commands via ssh - connect some Raspberry Pis with ssh access via their ssh host name on your network
- get a UGREEN 20250 or Transcend TS-RDF5K card reader to use with the pi
- connect prepared Raspberry Pis to the network
- install Ansible 2.4+ via homebrew
- create create ansible config file for deploys
- create create ansible inventory file for deploys
- create wpa_supplicant.conf
- put
~/.ssh/raspi-deploy
key in place that works to get this repository from github - npm run deploy
located in project directory
[defaults]
inventory=inventory.ini
located in project directory this has the channel and psk variables set for specified hosts
[hubs]
hub1sshhost
hub2sshhostwithdisplay
[display-hubs]
hub2sshhostwithdisplay
[ap-hubs]
hub1sshhost channel=7
hub2sshhostwithdisplay channel=6
[ap-hubs:vars]
psk=mywifipassword
cert_domain=mydomain.com
cert_path=/etc/letsencrypt/live/mydomain.com
located in this_project_directory/roles/wifi/files/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="My iPhone Hotspot"
key_mgmt=WPA-PSK
psk=wpa_passphrase_result0000000000000000000000000000000000000000000
priority=100
}
network={
ssid="my-home-network"
psk=wpa_passphrase_result0000000000000000000000000000000000000000000
key_mgmt=WPA-PSK
priority=99
}