Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image sequencer, infragram, and RPi Cam for Raspberry Pi camera #73

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 22 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion builder/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ ls -alh /image_with_kernel_*.tar.gz

# download the ready-made raw image for the RPi
if [ ! -f "${BUILD_RESULT_PATH}/${RAW_IMAGE}.zip" ]; then
wget -q -O "${BUILD_RESULT_PATH}/${RAW_IMAGE}.zip" "https://github.com/hypriot/image-builder-raw/releases/download/${RAW_IMAGE_VERSION}/${RAW_IMAGE}.zip"
wget -q -O "${BUILD_RESULT_PATH}/${RAW_IMAGE}.zip" "https://jenkins.laboratoriopublico.org/job/image-builder-raw/ws/${RAW_IMAGE}.zip"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should revert this, I think?

fi

# verify checksum of the ready-made raw image
Expand Down
46 changes: 46 additions & 0 deletions builder/chroot-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ apt-get -o Dpkg::Options::=--force-confdef \
pi-bluetooth \
lsb-release \
gettext \
unzip \
zip \
libav-tools \
gstreamer1.0-tools \
motion \
gpac \
cloud-init


Expand Down Expand Up @@ -202,10 +208,50 @@ lighttpd-enable-mod fastcgi-php
systemctl disable dhcpcd
systemctl disable hciuart

echo "Installing infragram"

# install npm/node:
curl -o node-v9.7.1-linux-armv6l.tar.gz https://nodejs.org/dist/v9.7.1/node-v9.7.1-linux-armv6l.tar.gz
tar -xzf node-v9.7.1-linux-armv6l.tar.gz
sudo cp -r node-v9.7.1-linux-armv6l/* /usr/local/
sudo apt-get install git

cd /var/www/

# install infragram in the web public folder:
# prerequisites:
sudo apt-get install -y build-essential libxi-dev libgl1-mesa-dev libglew-dev pkg-config python python-dev
git clone https://github.com/publiclab/infragram.git
cd infragram
npm install
cd /var/www/

echo "Installing image-sequencer"
# install image-sequencer in the web public folder:
git clone https://github.com/publiclab/image-sequencer.git
cd image-sequencer
npm install
cd /

echo "Installing spectral-workbench.js"
# install spectral-workbench.js in the web public folder:
git clone https://github.com/publiclab/spectral-workbench.js.git
cd spectral-workbench.js
npm install
cd /

echo "Installing rpi-serial-console script"
wget -q https://raw.githubusercontent.com/lurch/rpi-serial-console/master/rpi-serial-console -O usr/local/bin/rpi-serial-console
chmod +x usr/local/bin/rpi-serial-console

echo "Installing RPi Cam Web Interface"
wget -q https://github.com/silvanmelchior/RPi_Cam_Web_Interface/archive/master.zip -O /tmp/rpicam.zip
cd /tmp/
unzip rpicam.zip
cd RPi_Cam_Web_Interface-master
cp /etc/rpicam_config.txt config.txt
bash ./install.sh q

# fix eth0 interface name
ln -s /dev/null /etc/systemd/network/99-default.link

Expand Down
14 changes: 14 additions & 0 deletions builder/files/etc/rc.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

exit 0
8 changes: 8 additions & 0 deletions builder/files/etc/rpicam_config.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
rpicamdir="cam"
webserver=""
webport="80"
user=""
webpasswd=""
autostart="yes"
jpglink="no"
phpversion="7"
7 changes: 6 additions & 1 deletion builder/files/var/www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@ <h2>Public Lab Pi Camera Kit</h2>
<p>If you're seeing this in a pop-up, close it and open <a href="http://pi.local">http://pi.local</a> in a browser.</p>
<p>On Android devices, you may have to turn off cellular data to use this in a browser.</p>


<p>While connected to this camera, you won't have regular internet access.</p>

<p><a class="btn" href="http://pi.local/cam/">Access the camera</a></p>
<p><a class="btn" href="http://pi.local/infragram/pi/">Access Infragram software</a></p>
<p><a class="btn" href="http://pi.local/image-sequencer/examples/">Access Image Sequencer software</a></p>
<p><a class="btn" href="http://pi.local/image-sequencer/examples/">Access Image Sequencer VR</a></p>
<p><a class="btn" href="http://pi.local/spectral-workbench.js/examples/capture/">Access Spectral Workbench software</a></p>

</body>
</html>
6 changes: 3 additions & 3 deletions versions.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ ROOTFS_TAR_CHECKSUM="d1e7e6d48a25b4a206c5df99ecb8815388ec6945e4f97e78413d5a80778

# name of the ready made raw image for RPi
RAW_IMAGE="rpi-raw.img"
RAW_IMAGE_VERSION="v0.2.2"
RAW_IMAGE_CHECKSUM="2fbeb13b7b0f2308dbd0d82780b54c33003ad43d145ff08498b25fb8bbe1c2c6"
RAW_IMAGE_VERSION="master"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And should this be reverted too?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried reverting this file but seem not to be able to???

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how so "not able to" is it a permissions issue?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are finding issues building, it's a good idea to check the upstream project https://github.com/hypriot/image-builder-rpi/blob/master/versions.config - as Raspbian is a moving target that gets updated and requires tweaking the build.

RAW_IMAGE_CHECKSUM="e32c0b9f3cdb9c60bad97a724103fc1283cdc135848e6142d588cd96fac1d6a8"

# specific versions of kernel/firmware and docker tools
export KERNEL_BUILD="1.20190517-1"
export KERNEL_BUILD="1.20190709~stretch-1"
# For testing a new kernel, use the CircleCI artifacts URL.
# export KERNEL_URL=https://62-32913687-gh.circle-artifacts.com/0/home/circleci/project/output/20180320-092128/raspberrypi-kernel_20180320-092128_armhf.deb
# export KERNEL_VERSION="4.14.98"
Expand Down