forked from mainsail-crew/MainsailOS
-
-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fe20614
commit c9f9205
Showing
18 changed files
with
362 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
export DIST_NAME=VCoreOS | ||
export DIST_VERSION=0.5.0 | ||
export DIST_VERSION=0.7.0 | ||
export BASE_IMAGE_ENLARGEROOT=4000 | ||
export BASE_IMAGE_RESIZEROOT=500 | ||
export MODULES="base(network,raspicam,klipper_moonraker,mainsail,mjpgstreamer,ratrig,password-for-sudo)" | ||
export BASE_RELEASE_IMG_NAME=vcoreos-raspios-lite-latest.img | ||
export BASE_IMG_NAME=vcoreos-raspios-lite-latest.img | ||
export MODULES="base(network,raspicam,klipper_moonraker,fluidd,mjpgstreamer,ratrig,password-for-sudo)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
FLUIDD_VAR="This is a module variable" |
Empty file.
16 changes: 16 additions & 0 deletions
16
src/modules/fluidd/filesystem/home/pi/klipper_config/client.cfg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# These are required for Fluidd to correctly function. | ||
# You can copy these entries into your printer.cfg. | ||
# | ||
# Alternatively, import this file by adding | ||
# this line into your printer.cfg; | ||
# | ||
# [include client.cfg] | ||
|
||
# Virtual SD Card | ||
[virtual_sdcard] | ||
path: ~/gcode_files | ||
|
||
# Pause/Resume Functionality | ||
[pause_resume] | ||
|
||
[display_status] |
54 changes: 54 additions & 0 deletions
54
src/modules/fluidd/filesystem/home/pi/klipper_config/client_macros.cfg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# These macros are required for Fluidd to correctly function. | ||
# You can copy these entries into your printer.cfg. | ||
# | ||
# Alternatively, import this file by adding | ||
# this line into your printer.cfg; | ||
# | ||
# [include client_macros.cfg] | ||
|
||
[gcode_macro CANCEL_PRINT] | ||
rename_existing: BASE_CANCEL_PRINT | ||
gcode: | ||
TURN_OFF_HEATERS | ||
CLEAR_PAUSE | ||
SDCARD_RESET_FILE | ||
BASE_CANCEL_PRINT | ||
|
||
[gcode_macro PAUSE] | ||
rename_existing: BASE_PAUSE | ||
# change this if you need more or less extrusion | ||
variable_extrude: 1.0 | ||
gcode: | ||
##### read E from pause macro ##### | ||
{% set E = printer["gcode_macro PAUSE"].extrude|float %} | ||
##### set park positon for x and y ##### | ||
# default is your max posion from your printer.cfg | ||
{% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} | ||
{% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %} | ||
##### calculate save lift position ##### | ||
{% set max_z = printer.toolhead.axis_maximum.z|float %} | ||
{% set act_z = printer.toolhead.position.z|float %} | ||
{% if act_z < (max_z - 2.0) %} | ||
{% set z_safe = 2.0 %} | ||
{% else %} | ||
{% set z_safe = max_z - act_z %} | ||
{% endif %} | ||
##### end of definitions ##### | ||
SAVE_GCODE_STATE NAME=PAUSE_state | ||
BASE_PAUSE | ||
G91 | ||
G1 E-{E} F2100 | ||
G1 Z{z_safe} F900 | ||
G90 | ||
G1 X{x_park} Y{y_park} F6000 | ||
|
||
[gcode_macro RESUME] | ||
rename_existing: BASE_RESUME | ||
gcode: | ||
##### read E from pause macro ##### | ||
{% set E = printer["gcode_macro PAUSE"].extrude|float %} | ||
##### end of definitions ##### | ||
G91 | ||
G1 E{E} F2100 | ||
RESTORE_GCODE_STATE NAME=PAUSE_state | ||
BASE_RESUME |
39 changes: 39 additions & 0 deletions
39
src/modules/fluidd/filesystem/root/etc/logrotate.d/rsyslog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/var/log/syslog | ||
{ | ||
rotate 4 | ||
daily | ||
maxsize 256M | ||
missingok | ||
notifempty | ||
delaycompress | ||
compress | ||
postrotate | ||
/usr/lib/rsyslog/rsyslog-rotate | ||
endscript | ||
} | ||
|
||
/var/log/mail.info | ||
/var/log/mail.warn | ||
/var/log/mail.err | ||
/var/log/mail.log | ||
/var/log/daemon.log | ||
/var/log/kern.log | ||
/var/log/auth.log | ||
/var/log/user.log | ||
/var/log/lpr.log | ||
/var/log/cron.log | ||
/var/log/debug | ||
/var/log/messages | ||
{ | ||
rotate 4 | ||
weekly | ||
maxsize 256M | ||
missingok | ||
notifempty | ||
compress | ||
delaycompress | ||
sharedscripts | ||
postrotate | ||
/usr/lib/rsyslog/rsyslog-rotate | ||
endscript | ||
} |
4 changes: 4 additions & 0 deletions
4
src/modules/fluidd/filesystem/root/etc/nginx/conf.d/common_vars.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
map $http_upgrade $connection_upgrade { | ||
default upgrade; | ||
'' close; | ||
} |
9 changes: 9 additions & 0 deletions
9
src/modules/fluidd/filesystem/root/etc/nginx/conf.d/upstreams.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
upstream apiserver { | ||
ip_hash; | ||
server 127.0.0.1:7125; | ||
} | ||
|
||
upstream mjpgstreamer { | ||
ip_hash; | ||
server 127.0.0.1:8080; | ||
} |
63 changes: 63 additions & 0 deletions
63
src/modules/fluidd/filesystem/root/etc/nginx/sites-available/fluidd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
server { | ||
listen 80 default_server; | ||
|
||
access_log /var/log/nginx/fluidd-access.log; | ||
error_log /var/log/nginx/fluidd-error.log; | ||
|
||
# disable this section on smaller hardware like a pi zero | ||
gzip on; | ||
gzip_vary on; | ||
gzip_proxied any; | ||
gzip_proxied expired no-cache no-store private auth; | ||
gzip_comp_level 4; | ||
gzip_buffers 16 8k; | ||
gzip_http_version 1.1; | ||
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/json application/xml; | ||
|
||
# web_path from fluidd static files | ||
root /home/pi/fluidd; | ||
|
||
index index.html; | ||
server_name _; | ||
|
||
# disable max upload size checks | ||
client_max_body_size 0; | ||
|
||
# disable proxy request buffering | ||
proxy_request_buffering off; | ||
|
||
location / { | ||
try_files $uri $uri/ /index.html; | ||
} | ||
|
||
location = /index.html { | ||
add_header Cache-Control "no-store, no-cache, must-revalidate"; | ||
} | ||
|
||
location /websocket { | ||
proxy_pass http://apiserver/websocket; | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection $connection_upgrade; | ||
proxy_set_header Host $http_host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_read_timeout 86400; | ||
} | ||
|
||
location ~ ^/(printer|api|access|machine|server)/ { | ||
proxy_pass http://apiserver$request_uri; | ||
proxy_set_header Host $http_host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Scheme $scheme; | ||
} | ||
|
||
location /webcam/ { | ||
proxy_pass http://mjpgstreamer/; | ||
} | ||
|
||
location = /vcore.log { | ||
alias "/var/log/vcore.log"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env bash | ||
# Fluidd installation script | ||
# Installs Fluidd and nginx | ||
# Written by Craig Bassett | ||
# Thanks to Raymond Himle | ||
# GPL V3 | ||
######## | ||
|
||
|
||
# Source error handling, leave this in place | ||
set -x | ||
set -e | ||
|
||
source /common.sh | ||
install_cleanup_trap | ||
|
||
unpack /filesystem/home/pi /home/pi pi | ||
|
||
echo "Installing nginx and Fluidd" | ||
|
||
apt update | ||
apt install nginx -y | ||
rm /etc/nginx/sites-enabled/default | ||
ln -s /etc/nginx/sites-available/fluidd /etc/nginx/sites-enabled/ | ||
cd /home/pi/ | ||
sudo -u pi mkdir /home/pi/fluidd | ||
sudo -u pi wget -q -O fluidd.zip https://github.com/cadriel/fluidd/releases/latest/download/fluidd.zip && sudo -u pi unzip fluidd.zip -d /home/pi/fluidd && rm fluidd.zip | ||
# Run installation steps defined above | ||
|
||
# Unpack root at the end, so files are modified before | ||
unpack /filesystem/root / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/modules/mjpgstreamer/filesystem/root/etc/systemd/system/webcamd.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# CONFIG_LOW_LEVEL_OPTIONS is not set | ||
# CONFIG_MACH_AVR is not set | ||
# CONFIG_MACH_ATSAM is not set | ||
# CONFIG_MACH_ATSAMD is not set | ||
# CONFIG_MACH_LPC176X is not set | ||
CONFIG_MACH_STM32=y | ||
# CONFIG_MACH_PRU is not set | ||
# CONFIG_MACH_LINUX is not set | ||
# CONFIG_MACH_SIMU is not set | ||
CONFIG_STEP_DELAY=2 | ||
CONFIG_BOARD_DIRECTORY="stm32" | ||
CONFIG_MCU="stm32f407xx" | ||
CONFIG_CLOCK_FREQ=168000000 | ||
CONFIG_USBSERIAL=y | ||
CONFIG_FLASH_START=0x8008000 | ||
CONFIG_FLASH_SIZE=0x80000 | ||
CONFIG_RAM_START=0x20000000 | ||
CONFIG_RAM_SIZE=0x20000 | ||
CONFIG_STACK_SIZE=512 | ||
CONFIG_STM32_SELECT=y | ||
# CONFIG_MACH_STM32F103 is not set | ||
# CONFIG_MACH_STM32F207 is not set | ||
# CONFIG_MACH_STM32F401 is not set | ||
# CONFIG_MACH_STM32F405 is not set | ||
CONFIG_MACH_STM32F407=y | ||
# CONFIG_MACH_STM32F429 is not set | ||
# CONFIG_MACH_STM32F446 is not set | ||
# CONFIG_MACH_STM32F031 is not set | ||
# CONFIG_MACH_STM32F042 is not set | ||
# CONFIG_MACH_STM32F070 is not set | ||
CONFIG_MACH_STM32F4=y | ||
CONFIG_HAVE_STM32_USBOTG=y | ||
CONFIG_HAVE_STM32_CANBUS=y | ||
# CONFIG_STM32_FLASH_START_C000 is not set | ||
CONFIG_STM32_FLASH_START_8000=y | ||
# CONFIG_STM32_FLASH_START_4000 is not set | ||
# CONFIG_STM32_FLASH_START_0000 is not set | ||
CONFIG_CLOCK_REF_FREQ=8000000 | ||
CONFIG_STM32F0_TRIM=16 | ||
CONFIG_STM32_USB_PA11_PA12=y | ||
# CONFIG_STM32_SERIAL_USART1 is not set | ||
# CONFIG_STM32_CANBUS_PA11_PA12 is not set | ||
CONFIG_CANBUS_FREQUENCY=500000 | ||
CONFIG_USB_VENDOR_ID=0x1d50 | ||
CONFIG_USB_DEVICE_ID=0x614e | ||
CONFIG_USB_SERIAL_NUMBER_CHIPID=y | ||
CONFIG_USB_SERIAL_NUMBER="12345" | ||
CONFIG_HAVE_GPIO=y | ||
CONFIG_HAVE_GPIO_ADC=y | ||
CONFIG_HAVE_GPIO_SPI=y | ||
CONFIG_HAVE_GPIO_I2C=y | ||
CONFIG_HAVE_GPIO_BITBANGING=y | ||
CONFIG_HAVE_STRICT_TIMING=y | ||
CONFIG_HAVE_CHIPID=y | ||
CONFIG_INLINE_STEPPER_HACK=y |
Oops, something went wrong.