Skip to content

Commit

Permalink
Update bins and install script
Browse files Browse the repository at this point in the history
  • Loading branch information
ihrapsa committed Jul 6, 2022
1 parent 199fbfc commit bbbec5c
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 181 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ This method uses 2 scripts to foramt an sd card and make it extroot and another
#### STEPS:

- Make sure you've flahsed/sysupgraded latest `.bin` file from `/Firmware/OpenWrt_snapshot/` or from latest release.
- Connect to the `KlipperWrt` access point
- Connect to the `OpenWrt` access point
- Access LuCi web interface and log in on `192.168.1.1:81`
- _(**optional** but recommended)_ Add a password to the `KlipperWrt` access point: `Wireless` -> Under wireless overview `EDIT` the `KlipperWrt` interface -> `Wireless Security` -> Choose an encryption -> set a password -> `Save` -> `Save & Apply`
- _(**optional** but recommended)_ Add a password to the `OpenWrt` access point: `Wireless` -> Under wireless overview `EDIT` the `OpenWrt` interface -> `Wireless Security` -> Choose an encryption -> set a password -> `Save` -> `Save & Apply`
- _(**optional** but recommended)_ Add a password: `System` -> `Administration` -> `Router Password`
- ❗If your home network subnet is on 1 (192.168.1.x), in order to avoid any ip conflicts, change the static ip of the box LAN from 192.168.1.1 to something like 192.168.3.1. To do that access the luci webinterface -> `Network` -> `Interfaces` and edit the static ip -> `Save` -> press the down arow on the Save&Apply button -> `Apply Unchecked`. You can now access luci on the new ip and continue configureing Client setup.
- Connect as a client to your Internet router: `Network` -> `Wireless` -> `SCAN` -> `Join Network` -> check `Lock to BSSID` -> `Create/Assign Firewall zone` then under `custom` type `wwan` enter -> `Submit` -> `Save` -> `Save & Apply`
Expand Down Expand Up @@ -160,7 +160,7 @@ This method uses 2 scripts to foramt an sd card and make it extroot and another
- remove the scripts when done: `rm -rf /root/*.sh`
- Done!

- When done and rebooted use `http://klipperwrt.local` or `http://box-ip`to access the Klipper client
- When done and rebooted use `http://openwrt.local` or `http://box-ip`to access the Klipper client
- Done!


Expand All @@ -170,7 +170,7 @@ This method uses 2 scripts to foramt an sd card and make it extroot and another
- add these lines inside your `printer.cfg` depending on your klipper client (mainsail/fluidd):
- **Fluidd:**
`[include fluidd.cfg]`
`[include fluidd_macros.cfg] # include your macros inside this file`
`[include timelapse.cfg]`

- **Mainsail:**
`[include mainsail.cfg]`
Expand All @@ -184,7 +184,7 @@ This method uses 2 scripts to foramt an sd card and make it extroot and another
_____________________________________________
*Notes:*
- If the box doesn't connect back to your router wirelessly connect to it with an ethernet cable and setup/troubleshoot wifi.
- timelapse is set to autorender which might take a while to finish after a long print. You might set it to ` autorender: False` under `[timelapse]` block inside `moonraker.conf`. Check [here](https://github.com/FrYakaTKoP/moonraker/blob/dev-timelapse/docs/configuration.md#add-the-macro-to-your-slicer) for how to set your `TIMELAPSE_TAKE_FRAME` macro or `TIMELAPSE_TAKE_PARKED_FRAME` inside your slicer layer change.
- Check [here](https://github.com/mainsail-crew/moonraker-timelapse/blob/main/docs/configuration.md#slicer-setup) for how to set your `TIMELAPSE_TAKE_FRAME` macro inside your slicer layer change.

</details>

Expand Down
47 changes: 0 additions & 47 deletions klipper_config/fluidd_macros.cfg

This file was deleted.

7 changes: 5 additions & 2 deletions klipper_config/mainsail.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# This file may be distributed under the terms of the GNU GPLv3 license
#
# Version 1.7
# Version 1.11

# add [include mainsail.cfg] to your printer.cfg to include it to your printer.cfg
# modify x_park, y_park, z_park_delta and extrude value at the macro _TOOLHEAD_PARK_PAUSE_CANCEL if needed
Expand All @@ -13,6 +13,8 @@

[virtual_sdcard]
path: /root/gcode_files
on_error_gcode:
CANCEL_PRINT

[pause_resume]

Expand All @@ -28,6 +30,7 @@ gcode:
_TOOLHEAD_PARK_PAUSE_CANCEL
{% endif %}
TURN_OFF_HEATERS
M106 S0
CANCEL_PRINT_BASE

[gcode_macro PAUSE]
Expand Down Expand Up @@ -56,7 +59,7 @@ gcode:
{% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %}
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
{% endif %}
RESUME_BASE {get_params}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
Expand Down
59 changes: 19 additions & 40 deletions moonraker/fluidd_moonraker.conf
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,24 @@ trusted_clients:
# enables moonraker to track and store print history.
[history]

# this enables moonraker announcements for fluidd
[announcements]
subscriptions:
fluidd

[timelapse]
## Following basic configuration is default to most images and don't need
## to be changed in most scenarios. Only uncomment and change it if your
## Image differ from standart installations. In most common scenarios
## a User only need [timelapse] in there configuration.
output_path: /root/timelapse/
## Directory where the generated video will be saved
frame_path: /root/timelapse/snapshots/
## Directory where the temporary frames are saved
ffmpeg_binary_path: /usr/bin/ffmpeg
## Directory where ffmpeg is installed


# this enables moonraker's update manager
#[update_manager]
#enable_auto_refresh: True
Expand All @@ -51,43 +69,4 @@ trusted_clients:
#[update_manager client fluidd]
#type: web
#repo: cadriel/fluidd
#path: ~/fluidd


[timelapse]
enabled: True
## If this set to False the Gcode macros are ignored and
## the autorender is disabled at the end of the print.
## The idea is to disable the plugin by default and only activate
## it during runtime via the http endpoint if a timelapse is desired.
autorender: False
## If this is set to False, the autorender is disabled at the end of the print.
constant_rate_factor: 23
## The range of the CRF scale is 0–51, where 0 is lossless,
## 23 is the default, and 51 is worst quality possible.
## A lower value generally leads to higher quality, and a
## subjectively sane range is 17–28.
## more info: https://trac.ffmpeg.org/wiki/Encode/H.264
#output_framerate: 30
## Output framerate of the generated video
output_path: /root/timelapse/
## Path where the generated video will be saved
frame_path: /root/timelapse/snapshots/
## Path where the temporary frames are saved
ffmpeg_binary_path: /usr/bin/ffmpeg
## set location of ffmpeg binary
time_format_code: %Y%m%d_%H%M
## Manipulates datetime format of the output filename
## see: https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes
snapshoturl: http://localhost:8080/?action=snapshot
## url to your webcamstream
pixelformat: yuv420p
## set pixelformat for output video
## default to yuv420p because eg. yuvj422p will not play on
## on most smartphones or older media players
#extraoutputparams:
## here you can extra output parameters to FFMPEG
## further info: https://ffmpeg.org/ffmpeg.html
## eg rotate video by 180° "-vf transpose=2,transpose=2"
## or repeat last frame for 5 seconds:
## -filter_complex "[0]trim=0:5[hold];[0][hold]concat[extended];[extended][0]overlay"
#path: ~/fluidd
58 changes: 13 additions & 45 deletions moonraker/mainsail_moonraker.conf
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,10 @@ trusted_clients:
# enables moonraker to track and store print history.
[history]

# this enables moonraker's update manager
#[update_manager]

#[update_manager client mainsail]
#type: web
#repo: meteyou/mainsail
#path: ~/mainsail

# this enables moonraker announcements for mainsail
[announcements]
subscriptions:
mainsail

[timelapse]
## Following basic configuration is default to most images and don't need
Expand All @@ -59,40 +55,12 @@ ffmpeg_binary_path: /usr/bin/ffmpeg
## Directory where ffmpeg is installed


#[timelapse]
#enabled: True
## If this set to False the Gcode macros are ignored and
## the autorender is disabled at the end of the print.
## The idea is to disable the plugin by default and only activate
## it during runtime via the http endpoint if a timelapse is desired.
#autorender: False
## If this is set to False, the autorender is disabled at the end of the print.
#constant_rate_factor: 23
## The range of the CRF scale is 0–51, where 0 is lossless,
## 23 is the default, and 51 is worst quality possible.
## A lower value generally leads to higher quality, and a
## subjectively sane range is 17–28.
## more info: https://trac.ffmpeg.org/wiki/Encode/H.264
#output_framerate: 30
## Output framerate of the generated video
#output_path: /root/timelapse/
## Path where the generated video will be saved
#frame_path: /root/timelapse/snapshots/
## Path where the temporary frames are saved
#ffmpeg_binary_path: /usr/bin/ffmpeg
## set location of ffmpeg binary
#time_format_code: %Y%m%d_%H%M
## Manipulates datetime format of the output filename
## see: https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes
#snapshoturl: http://localhost:8080/?action=snapshot
## url to your webcamstream
#pixelformat: yuv420p
## set pixelformat for output video
## default to yuv420p because eg. yuvj422p will not play on
## on most smartphones or older media players
#extraoutputparams:
## here you can extra output parameters to FFMPEG
## further info: https://ffmpeg.org/ffmpeg.html
## eg rotate video by 180° "-vf transpose=2,transpose=2"
## or repeat last frame for 5 seconds:
## -filter_complex "[0]trim=0:5[hold];[0][hold]concat[extended];[extended][0]overlay"
# this enables moonraker's update manager
#[update_manager]
#refresh_interval: 168

#[update_manager client mainsail]
#type: web
#repo: meteyou/mainsail
#path: ~/mainsail

48 changes: 6 additions & 42 deletions scripts/2_script_manual.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,32 +70,10 @@ echo "############################"
echo " "

echo "Installing klipper dependencies..."
### Backup no working distfeed.conf and opkg.conf for future use
mv /etc/opkg/distfeeds.conf /etc/opkg/distfeeds.conf_snapshot;
mv /etc/opkg.conf /etc/opkg.conf_orig;

## create new distfeeds.conf using 21.02.1 releases
cat << "EOF" > /etc/opkg/distfeeds.conf
src/gz openwrt_core https://downloads.openwrt.org/releases/21.02.1/targets/ramips/mt76x8/packages
src/gz openwrt_base https://downloads.openwrt.org/releases/21.02.1/packages/mipsel_24kc/base
src/gz openwrt_luci https://downloads.openwrt.org/releases/21.02.1/packages/mipsel_24kc/luci
src/gz openwrt_packages https://downloads.openwrt.org/releases/21.02.1/packages/mipsel_24kc/packages
src/gz openwrt_routing https://downloads.openwrt.org/releases/21.02.1/packages/mipsel_24kc/routing
src/gz openwrt_telephony https://downloads.openwrt.org/releases/21.02.1/packages/mipsel_24kc/telephony
EOF

## create new opkg.conf with check_signature disable
cat << "EOF" > /etc/opkg.conf
dest root /
dest ram /tmp
lists_dir ext /var/opkg-lists
option overlay_root /overlay
#option check_signature
EOF

opkg update && opkg install git-http unzip htop zram-swap gcc;
opkg update && opkg install git-http unzip htop gcc patch;

opkg install python3 python3-pip python3-cffi python3-dev python3-greenlet gcc;
opkg install python3 python3-pip python3-cffi python3-dev python3-greenlet;
/usr/bin/python3 -m pip install --upgrade pip;
pip install jinja2 python-can markupsafe configparser

Expand All @@ -115,27 +93,14 @@ echo " "


echo "Installing moonraker python3 packages..."
opkg install python3 python3-pip python3-pillow python3-tornado python3-distro python3-curl libcurl4 libsodium libffi ip-full --force-overwrite;


echo "Fixing libffi symlinks..."
ln -s /usr/lib/libffi.so.8 /usr/lib/libffi.so.7;
ln -s /usr/lib/libffi.so.8 /usr/lib/libffi.so.7.1.0;
opkg install python3-tornado python3-pillow python3-distro python3-curl ip-full libsodium;

echo "Upgrading setuptools..."
pip install --upgrade setuptools;

echo "Installing pip3 packages..."
pip install inotify-simple python-jose libnacl paho-mqtt==1.5.1 dbus-next zeroconf preprocess-cancellation jinja2;


echo "Downloading lmdb and streaming-form-data package..."

wget https://github.com/ihrapsa/KlipperWrt/raw/main/packages/python3-lmdb%2Bstreaming-form-data_packages_1.0-1_mipsel_24kc.ipk -P /root/;
pip install pyserial-asyncio lmdb streaming-form-data inotify-simple libnacl paho-mqtt==1.5.1 zeroconf preprocess-cancellation apprise ldap3 dbus-next;

echo "Installing lmdb and streaming-form-data package..."
opkg install /root/*ipk;
rm -rf *ipk;

echo " "
echo "###############"
Expand Down Expand Up @@ -169,7 +134,7 @@ echo "### Moonraker ###"
echo "#################"
echo " "

git clone https://github.com/ihrapsa/moonraker.git /root/moonraker;
git clone https://github.com/Arksine/moonraker.git /root/moonraker;
wget https://raw.githubusercontent.com/ihrapsa/KlipperWrt/main/Services/moonraker -P /etc/init.d/
chmod 755 /etc/init.d/moonraker
/etc/init.d/moonraker enable
Expand Down Expand Up @@ -208,7 +173,7 @@ choose(){
wget -q -O /root/klipper_config/moonraker.conf https://raw.githubusercontent.com/ihrapsa/KlipperWrt/main/moonraker/fluidd_moonraker.conf;
wget -q -O /etc/nginx/conf.d/fluidd.conf https://raw.githubusercontent.com/ihrapsa/KlipperWrt/main/nginx/fluidd.conf;
wget https://github.com/ihrapsa/KlipperWrt/raw/main/klipper_config/fluidd.cfg -P /root/klipper_config/
wget https://github.com/ihrapsa/KlipperWrt/raw/main/klipper_config/fluidd_macros.cfg -P /root/klipper_config/


echo "***************************"
echo "** Done! **"
Expand Down Expand Up @@ -322,7 +287,6 @@ rm -rf /root/ffmpeg;


echo "Installing Timelapse packages..."
#wget https://raw.githubusercontent.com/FrYakaTKoP/moonraker/c9ec89ca8a633501b200bce8748538b77b085a57/moonraker/components/timelapse.py -P /root/moonraker/moonraker/components;
git clone https://github.com/ihrapsa/moonraker-timelapse.git /root/moonraker-timelapse;
/root/moonraker-timelapse/install.sh;

Expand Down

4 comments on commit bbbec5c

@duchengyao
Copy link

Choose a reason for hiding this comment

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

🎉 🎉 🎉 🎉 🎉 🎉 🎉

@jaymemaurice
Copy link

Choose a reason for hiding this comment

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

Why did the firmware bin files shrink by 8MB? this commit is bad...

@ihrapsa
Copy link
Owner Author

Choose a reason for hiding this comment

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

Why did the firmware bin files shrink by 8MB? this commit is bad...

What are you talking about?

@jaymemaurice
Copy link

Choose a reason for hiding this comment

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

Sorry it is just me ..
I downloaded the firmware files and they seemed to be short... it is working now

Please sign in to comment.