Compare commits
2 commits
ce2e05165c
...
4d68cace69
Author | SHA1 | Date | |
---|---|---|---|
4d68cace69 | |||
d9c15f9502 |
8 changed files with 21 additions and 29 deletions
|
@ -6,8 +6,8 @@ RUN apt-get -y update && \
|
||||||
apt-get -y install --no-install-recommends \
|
apt-get -y install --no-install-recommends \
|
||||||
git vim parted \
|
git vim parted \
|
||||||
quilt coreutils qemu-user-static debootstrap zerofree zip dosfstools \
|
quilt coreutils qemu-user-static debootstrap zerofree zip dosfstools \
|
||||||
bsdtar libcap2-bin rsync grep udev xz-utils curl xxd file kmod bc\
|
bsdtar libcap2-bin rsync grep udev xz-utils curl xxd file kmod bc \
|
||||||
binfmt-support ca-certificates \
|
binfmt-support ca-certificates golang \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY . /pi-gen/
|
COPY . /pi-gen/
|
||||||
|
|
|
@ -45,14 +45,15 @@ TODO
|
||||||
|
|
||||||
### OctoPrint Setup
|
### 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 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/?action=stream` into the Stream URL box to enable it in OctoPrint.
|
- If MJPG-Streamer is enabled, you can put `/webcam` into the Stream URL box to enable it in OctoPrint.
|
||||||
|
|
||||||
### Accessing 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.
|
- 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
|
### Reporting Bugs
|
||||||
Please report any bugs by [filing an issue](/issues). Please include as much detail as you can, including:
|
Please report any bugs by [filing an issue](/issues). Please include as much detail as you can, including (but not limited to):
|
||||||
- Raspberry Pi Model
|
- Raspberry Pi Model
|
||||||
|
- Version of TouchPrint
|
||||||
- What you were doing when the bug occured
|
- What you were doing when the bug occured
|
||||||
- Steps to reproduce
|
- Steps to reproduce
|
||||||
- Logs
|
- Logs
|
||||||
|
|
5
TODO.md
5
TODO.md
|
@ -3,13 +3,14 @@
|
||||||
## First time/Octo-Config
|
## First time/Octo-Config
|
||||||
- Add network configuration (replace nmtui)
|
- Add network configuration (replace nmtui)
|
||||||
- Add hostname configuration (replace nmtui)
|
- Add hostname configuration (replace nmtui)
|
||||||
|
- Better service configuration (deeper menu)
|
||||||
|
- System check
|
||||||
|
|
||||||
## Misc
|
## Misc
|
||||||
- More security
|
- More security
|
||||||
|
- Wiki
|
||||||
|
|
||||||
## Things to consider
|
## Things to consider
|
||||||
- Wayland using labwc/waybox
|
- Wayland using labwc/waybox
|
||||||
- Python 3
|
- Python 3
|
||||||
- Detect if frontend did not load correctly (probably not easy)
|
- 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_KEYMAP="${KEYBOARD_KEYMAP:-us}"
|
||||||
export KEYBOARD_LAYOUT="${KEYBOARD_LAYOUT:-English (US)}"
|
export KEYBOARD_LAYOUT="${KEYBOARD_LAYOUT:-English (US)}"
|
||||||
|
|
||||||
export TIMEZONE_DEFAULT="${TIMEZONE_DEFAULT:-America/New_York}"
|
export TIMEZONE_DEFAULT="${TIMEZONE_DEFAULT:-UTC}"
|
||||||
|
|
||||||
export GIT_HASH=${GIT_HASH:-"$(git rev-parse HEAD)"}
|
export GIT_HASH=${GIT_HASH:-"$(git rev-parse HEAD)"}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
upstream "mjpg-streamer" {
|
upstream "mjpg-streamer" {
|
||||||
server 127.0.0.1:8080;
|
server 127.0.0.1:9000;
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
|
|
|
@ -3,23 +3,9 @@
|
||||||
install -m 644 files/mjpg-streamer.service ${ROOTFS_DIR}/etc/systemd/system/mjpg-streamer.service
|
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
|
install -m 755 files/start-mjpg ${ROOTFS_DIR}/usr/local/bin/start-mjpg
|
||||||
|
|
||||||
on_chroot << EOF
|
if [[ ! -f ${ROOTFS_DIR}/usr/local/bin/mjpeg-server ]]; then
|
||||||
# If mjpg is already installed, skip this (for debugging)
|
# Do some semi janky cross compilation since Golang won't let me set GOBIN when cross compiling
|
||||||
if ! which mjpg_streamer; then
|
GOPATH=/tmp/go GOARCH=arm64 go get github.com/blueimp/mjpeg-server
|
||||||
cd /tmp
|
cp /tmp/go/bin/linux_arm64/mjpeg-server ${ROOTFS_DIR}/usr/local/bin/mjpeg-server
|
||||||
# Making sure that this directory doesn't exist
|
rm -rf /tmp/go
|
||||||
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
|
fi
|
||||||
EOF
|
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
/usr/local/bin/mjpg_streamer -i input_uvc.so -o "output_http.so --port 8080 -w /var/www/mjpg"
|
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
|
||||||
|
|
|
@ -137,5 +137,5 @@ video_config () {
|
||||||
[[ "$DEVICE_MENU" == "" ]] && return 0
|
[[ "$DEVICE_MENU" == "" ]] && return 0
|
||||||
|
|
||||||
# Write selected value to startup script
|
# Write selected value to startup script
|
||||||
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
|
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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue