Compare commits
No commits in common. "4d68cace69bf22daec2a34302549fb55cee97a07" and "ce2e05165c0bb702d3ad2a8aac652e8e827a886e" have entirely different histories.
4d68cace69
...
ce2e05165c
8 changed files with 29 additions and 21 deletions
|
@ -6,8 +6,8 @@ RUN apt-get -y update && \
|
|||
apt-get -y install --no-install-recommends \
|
||||
git vim parted \
|
||||
quilt coreutils qemu-user-static debootstrap zerofree zip dosfstools \
|
||||
bsdtar libcap2-bin rsync grep udev xz-utils curl xxd file kmod bc \
|
||||
binfmt-support ca-certificates golang \
|
||||
bsdtar libcap2-bin rsync grep udev xz-utils curl xxd file kmod bc\
|
||||
binfmt-support ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY . /pi-gen/
|
||||
|
|
|
@ -45,15 +45,14 @@ TODO
|
|||
|
||||
### OctoPrint Setup
|
||||
- If the GUI is enabled, you can setup OctoPrint on the Raspberry Pi. You can also setup OctoPrint by opening up a web browser on another computer and navigating to `https://RPI-IP`, replacing RPI-IP with the IP address of your Raspberry Pi.
|
||||
- If MJPG-Streamer is enabled, you can put `/webcam` into the Stream URL box to enable it in OctoPrint.
|
||||
- If MJPG-Streamer is enabled, you can put `/webcam/?action=stream` into the Stream URL box to enable it in OctoPrint.
|
||||
|
||||
### Accessing OctoPrint
|
||||
- If OctoPrint is enabled, you can access it at `https://RPI-IP`, replacing RPI-IP with the IP address of your Raspberry Pi.
|
||||
|
||||
### Reporting Bugs
|
||||
Please report any bugs by [filing an issue](/issues). Please include as much detail as you can, including (but not limited to):
|
||||
Please report any bugs by [filing an issue](/issues). Please include as much detail as you can, including:
|
||||
- Raspberry Pi Model
|
||||
- Version of TouchPrint
|
||||
- What you were doing when the bug occured
|
||||
- Steps to reproduce
|
||||
- Logs
|
||||
|
|
5
TODO.md
5
TODO.md
|
@ -3,14 +3,13 @@
|
|||
## First time/Octo-Config
|
||||
- Add network configuration (replace nmtui)
|
||||
- Add hostname configuration (replace nmtui)
|
||||
- Better service configuration (deeper menu)
|
||||
- System check
|
||||
|
||||
## Misc
|
||||
- More security
|
||||
- Wiki
|
||||
|
||||
## Things to consider
|
||||
- Wayland using labwc/waybox
|
||||
- Python 3
|
||||
- Detect if frontend did not load correctly (probably not easy)
|
||||
- HTTP/Port 80 redirect
|
||||
- https://github.com/blueimp/mjpeg-server
|
||||
|
|
2
build.sh
2
build.sh
|
@ -177,7 +177,7 @@ export LOCALE_DEFAULT="${LOCALE_DEFAULT:-en_US.UTF-8}"
|
|||
export KEYBOARD_KEYMAP="${KEYBOARD_KEYMAP:-us}"
|
||||
export KEYBOARD_LAYOUT="${KEYBOARD_LAYOUT:-English (US)}"
|
||||
|
||||
export TIMEZONE_DEFAULT="${TIMEZONE_DEFAULT:-UTC}"
|
||||
export TIMEZONE_DEFAULT="${TIMEZONE_DEFAULT:-America/New_York}"
|
||||
|
||||
export GIT_HASH=${GIT_HASH:-"$(git rev-parse HEAD)"}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
}
|
||||
|
||||
upstream "mjpg-streamer" {
|
||||
server 127.0.0.1:9000;
|
||||
server 127.0.0.1:8080;
|
||||
}
|
||||
|
||||
server {
|
||||
|
|
|
@ -3,9 +3,23 @@
|
|||
install -m 644 files/mjpg-streamer.service ${ROOTFS_DIR}/etc/systemd/system/mjpg-streamer.service
|
||||
install -m 755 files/start-mjpg ${ROOTFS_DIR}/usr/local/bin/start-mjpg
|
||||
|
||||
if [[ ! -f ${ROOTFS_DIR}/usr/local/bin/mjpeg-server ]]; then
|
||||
# Do some semi janky cross compilation since Golang won't let me set GOBIN when cross compiling
|
||||
GOPATH=/tmp/go GOARCH=arm64 go get github.com/blueimp/mjpeg-server
|
||||
cp /tmp/go/bin/linux_arm64/mjpeg-server ${ROOTFS_DIR}/usr/local/bin/mjpeg-server
|
||||
rm -rf /tmp/go
|
||||
on_chroot << EOF
|
||||
# If mjpg is already installed, skip this (for debugging)
|
||||
if ! which mjpg_streamer; then
|
||||
cd /tmp
|
||||
# Making sure that this directory doesn't exist
|
||||
rm -rf /tmp/mjpg-streamer
|
||||
git clone https://github.com/jacksonliam/mjpg-streamer/
|
||||
cd mjpg-streamer/mjpg-streamer-experimental/
|
||||
make
|
||||
make install
|
||||
cd /
|
||||
# Cleanup
|
||||
rm -rf /tmp/mjpg-streamer
|
||||
# Create needed folder
|
||||
mkdir -p /var/www/mjpg
|
||||
# Permissions
|
||||
chown octoprint:octoprint /var/www/mjpg
|
||||
fi
|
||||
EOF
|
||||
|
||||
|
|
|
@ -1,6 +1,2 @@
|
|||
#!/bin/bash
|
||||
if [[ "$(ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of default=nokey=1:noprint_wrappers=1 /dev/video0)" == "h264" ]]; then
|
||||
/usr/local/bin/mjpeg-server -a 127.0.0.1:9000 -- ffmpeg -input_format h264 -i /dev/video0 -c:v h264_v4l2m2m -f mpjpeg -
|
||||
else
|
||||
/usr/local/bin/mjpeg-server -a 127.0.0.1:9000 -- ffmpeg -i /dev/video0 -f mpjpeg -
|
||||
fi
|
||||
/usr/local/bin/mjpg_streamer -i input_uvc.so -o "output_http.so --port 8080 -w /var/www/mjpg"
|
||||
|
|
|
@ -137,5 +137,5 @@ video_config () {
|
|||
[[ "$DEVICE_MENU" == "" ]] && return 0
|
||||
|
||||
# Write selected value to startup script
|
||||
echo -e '#!/bin/bash'"\n/usr/local/bin/mjpeg-server -a 127.0.0.1:9000 -- ffmpeg -i $DEVICE_MENU -f v4l2 -f mpjpeg -" > /usr/local/bin/start-mjpg
|
||||
echo -e '#!/bin/bash'"\n/usr/local/bin/mjpg_streamer -i \"input_uvc.so -d $DEVICE_MENU\" -o \"output_http.so --port 8080\"" > /usr/local/bin/start-mjpg
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue