Giter VIP home page Giter VIP logo

klipperwrt's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

klipperwrt's Issues

Factory reset

How could I factory reset the device?

I've successfully installed KlipperWrt, managed to connect to it's Wifi hotspot.
I've connect the device to my local WiFi and restarted.

Now I can see it's connected, but cannot get on it over ssh and local IP with port 81 does not show configuration page.

I've tried to one more time add bz file to reinstall it, but it does not work.

How can I reset the configuration or enable the hotspot one more time or connect to it via ssh?

[dev] moonraker machine.py adaptation

  • Make a symlink from webcamd -> mjpg-streamer

ln -s /etc/init.d/mjpg-streamer /etc/init.d/webcamd

  • Change to the following to make the cllient buttons work:
async def shutdown_machine(self) -> None:
        await self._execute_cmd("poweroff")

    async def reboot_machine(self) -> None:
        await self._execute_cmd("reboot")

    async def do_service_action(self,
                                action: str,
                                service_name: str
                                ) -> None:
        await self._execute_cmd(
            f'/etc/init.d/{service_name} {action}')
  • Change to the following to check allowed services:
async def _find_active_services(self):
        services = os.listdir("/etc/init.d/")
        for svc in services:
            for allowed in ALLOWED_SERVICES:
                if svc.startswith(allowed):
                    self.available_services.append(svc)
        self.system_info['available_services'] = self.available_services

[dev] Remote access - Tailscale

⚠️ Encrypting webcam stream takes quite a lot of CPU power so this approach might not be recommended ⚠️

Home network: webcam stream (no encryption) - low CPU load
Remote VPN access: webcam stream encryption - increased CPU load

This will enable remote access to the box. Tailscale is a very simple to setup VPN without the need to create your own server or mange configs or open/forward ports. At its core it's based on WireGuard.

❗ Apparently Tailscale is now officially in Openwrt package repository. Yey! See here and here

Note!
Tailscale package has a kernel module dependency called kmod tun. Due to the box not officially supported yet, kmods can only be installed first day until the next daily build happens. To overcome that I either have to compile a new bin file with the kmod preinstalled or as a separate package that can be manually installed later.

❗ New .bin with kmod tun coming soon ❗


🔢 Steps to install and configure Tailscale on the box:

  1. Register to Tailscale
  2. Install packages
opkg update && opkg install tailscaled tailscale
  1. Start and enable daemon service
/etc/init.d/tailscale enable
/etc/init.d/tailscale start
  1. Authenticate the box with the given URL:
tailscale up
  1. In your Tailscale account you should see your box with an ip assigned

📶 Tailscale for OpenWrt here - thanks adyanth
🔜 Tutorial to install tailscale daemon on OpenWrt ❗ coming soon...

🔢 Steps to configure Tailscale - thanks denkyem

  1. Make sure you've registered an account to tailscale
  2. Install Tailscale client on your phone/tablet/PC/mac (the remote device)
  3. Make sure Tailscale is configired on the box (see above )
  4. Make sure both devices appear in your Tailscale account:
    tailscale
  5. In your moonraker.conf add your remote device ip under trusted_clients in [authorization] block
[authorization]
force_logins: True
cors_domains:
  *.local
  *.lan
  *://app.fluidd.xyz

trusted_clients:
  10.0.0.0/8
  127.0.0.0/8
  169.254.0.0/16
  172.16.0.0/12
  192.168.0.0/16
  FE80::/10
  ::1/128
  100.115.167.93   #<-------- this is the remote phone ip found in your Tailscale account
  1. To access the box remotely make sure Tailscale app is running and active on your remote device
  2. Access URL http://100.99.160.51 #<-------- this is the ip of the box found in your Tailscale account
  3. Type the same thing here when prompted
    image

Webcam is not working with mjpg-streamer

Hi,

I installed openwrt on the Creality web box and was able to successfully able to run klipper and do prints. I was trying to install mjpg-steamer and webcam, but all methods failed. BTW, I am able to use ffmpeg to record video and download it and also run mjpg-streamer in command line and able to see the stream.

lsusb -v

Bus 001 Device 004: ID 13d3:784b FLH-BY-0309-200514 Integrated Camera
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.01
bDeviceClass 239
bDeviceSubClass 2
bDeviceProtocol 1
bMaxPacketSize0 64
idVendor 0x13d3
idProduct 0x784b
bcdDevice 5.14
iManufacturer 1 FLH-BY-0309-200514
iProduct 2 Integrated Camera
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x01e2
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 500mA
Interface Association:
bLength 8
bDescriptorType 11
bFirstInterface 0
bInterfaceCount 2
bFunctionClass 14
bFunctionSubClass 3
bFunctionProtocol 0
iFunction 4 Integrated Camera
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 14
bInterfaceSubClass 1
bInterfaceProtocol 0
iInterface 4 Integrated Camera
VideoControl Interface Descriptor:
bLength 13
bDescriptorType 36
bDescriptorSubtype 1 (HEADER)
bcdUVC 1.00
wTotalLength 0x006d
dwClockFrequency 48.000000MHz
bInCollection 1
baInterfaceNr( 0) 1
VideoControl Interface Descriptor:
bLength 18
bDescriptorType 36
bDescriptorSubtype 2 (INPUT_TERMINAL)
bTerminalID 1
wTerminalType 0x0201 Camera Sensor
bAssocTerminal 0
iTerminal 0
wObjectiveFocalLengthMin 0
wObjectiveFocalLengthMax 0
wOcularFocalLength 0
bControlSize 3
bmControls 0x0000000e
Auto-Exposure Mode
Auto-Exposure Priority
Exposure Time (Absolute)
VideoControl Interface Descriptor:
bLength 11
bDescriptorType 36
bDescriptorSubtype 5 (PROCESSING_UNIT)
Warning: Descriptor too short
bUnitID 2
bSourceID 1
wMaxMultiplier 16384
bControlSize 2
bmControls 0x0000177f
Brightness
Contrast
Hue
Saturation
Sharpness
Gamma
White Balance Temperature
Backlight Compensation
Gain
Power Line Frequency
White Balance Temperature, Auto
iProcessing 0
bmVideoStandards 0x1d
None
PAL - 625/50
SECAM - 625/50
NTSC - 625/50
VideoControl Interface Descriptor:
bLength 29
bDescriptorType 36
bDescriptorSubtype 6 (EXTENSION_UNIT)
bUnitID 3
guidExtensionCode {0fb885c3-68c2-4547-90f7-8f47579d95fc}
bNumControls 5
bNrInPins 1
baSourceID( 0) 2
bControlSize 4
bmControls( 0) 0x1f
bmControls( 1) 0x00
bmControls( 2) 0x00
bmControls( 3) 0x00
iExtension 0
VideoControl Interface Descriptor:
bLength 29
bDescriptorType 36
bDescriptorSubtype 6 (EXTENSION_UNIT)
bUnitID 4
guidExtensionCode {63610682-5070-49ab-b8cc-b3855e8d221d}
bNumControls 20
bNrInPins 1
baSourceID( 0) 3
bControlSize 4
bmControls( 0) 0xff
bmControls( 1) 0xff
bmControls( 2) 0x71
bmControls( 3) 0x00
iExtension 0
VideoControl Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 3 (OUTPUT_TERMINAL)
bTerminalID 5
wTerminalType 0x0101 USB Streaming
bAssocTerminal 0
bSourceID 4
iTerminal 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x87 EP 7 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0010 1x 16 bytes
bInterval 8
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 14
bInterfaceSubClass 2
bInterfaceProtocol 0
iInterface 0
VideoStreaming Interface Descriptor:
bLength 15
bDescriptorType 36
bDescriptorSubtype 1 (INPUT_HEADER)
bNumFormats 2
wTotalLength 0x0096
bEndpointAddress 0x81 EP 1 IN
bmInfo 0
bTerminalLink 5
bStillCaptureMethod 2
bTriggerSupport 1
bTriggerUsage 0
bControlSize 1
bmaControls( 0) 4
bmaControls( 1) 0
VideoStreaming Interface Descriptor:
bLength 11
bDescriptorType 36
bDescriptorSubtype 6 (FORMAT_MJPEG)
bFormatIndex 1
bNumFrameDescriptors 1
bFlags 1
Fixed-size samples: Yes
bDefaultFrameIndex 1
bAspectRatioX 0
bAspectRatioY 0
bmInterlaceFlags 0x00
Interlaced stream or variable: No
Fields per frame: 1 fields
Field 1 first: No
Field pattern: Field 1 only
bCopyProtect 0
VideoStreaming Interface Descriptor:
bLength 30
bDescriptorType 36
bDescriptorSubtype 7 (FRAME_MJPEG)
bFrameIndex 1
bmCapabilities 0x01
Still image supported
wWidth 640
wHeight 480
dwMinBitRate 147456000
dwMaxBitRate 147456000
dwMaxVideoFrameBufferSize 614400
dwDefaultFrameInterval 333333
bFrameIntervalType 1
dwFrameInterval( 0) 333333
VideoStreaming Interface Descriptor:
bLength 14
bDescriptorType 36
bDescriptorSubtype 3 (STILL_IMAGE_FRAME)
bEndpointAddress 0x00 EP 0 OUT
bNumImageSizePatterns 1
wWidth( 0) 640
wHeight( 0) 480
bNumCompressionPatterns 4
bCompression( 0) 1
bCompression( 1) 5
bCompression( 2) 10
bCompression( 3) 20
VideoStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 13 (COLORFORMAT)
bColorPrimaries 1 (BT.709,sRGB)
bTransferCharacteristics 1 (BT.709)
bMatrixCoefficients 4 (SMPTE 170M (BT.601))
VideoStreaming Interface Descriptor:
bLength 27
bDescriptorType 36
bDescriptorSubtype 4 (FORMAT_UNCOMPRESSED)
bFormatIndex 2
bNumFrameDescriptors 1
guidFormat {32595559-0000-0010-8000-00aa00389b71}
bBitsPerPixel 16
bDefaultFrameIndex 1
bAspectRatioX 0
bAspectRatioY 0
bmInterlaceFlags 0x00
Interlaced stream or variable: No
Fields per frame: 2 fields
Field 1 first: No
Field pattern: Field 1 only
bCopyProtect 0
VideoStreaming Interface Descriptor:
bLength 30
bDescriptorType 36
bDescriptorSubtype 5 (FRAME_UNCOMPRESSED)
bFrameIndex 1
bmCapabilities 0x00
Still image unsupported
wWidth 640
wHeight 480
dwMinBitRate 147456000
dwMaxBitRate 147456000
dwMaxVideoFrameBufferSize 614400
dwDefaultFrameInterval 333333
bFrameIntervalType 1
dwFrameInterval( 0) 333333
VideoStreaming Interface Descriptor:
bLength 11
bDescriptorType 36
bDescriptorSubtype 3 (STILL_IMAGE_FRAME)
bEndpointAddress 0x00 EP 0 OUT
bNumImageSizePatterns 1
wWidth( 0) 640
wHeight( 0) 480
bNumCompressionPatterns 1
bCompression( 0) 1
VideoStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 13 (COLORFORMAT)
bColorPrimaries 1 (BT.709,sRGB)
bTransferCharacteristics 1 (BT.709)
bMatrixCoefficients 4 (SMPTE 170M (BT.601))
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 1
bNumEndpoints 1
bInterfaceClass 14
bInterfaceSubClass 2
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x00c0 1x 192 bytes
bInterval 1
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 2
bNumEndpoints 1
bInterfaceClass 14
bInterfaceSubClass 2
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x0180 1x 384 bytes
bInterval 1
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 3
bNumEndpoints 1
bInterfaceClass 14
bInterfaceSubClass 2
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 1
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 4
bNumEndpoints 1
bInterfaceClass 14
bInterfaceSubClass 2
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x0280 1x 640 bytes
bInterval 1
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 5
bNumEndpoints 1
bInterfaceClass 14
bInterfaceSubClass 2
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x0320 1x 800 bytes
bInterval 1
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 6
bNumEndpoints 1
bInterfaceClass 14
bInterfaceSubClass 2
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x03b0 1x 944 bytes
bInterval 1
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 7
bNumEndpoints 1
bInterfaceClass 14
bInterfaceSubClass 2
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x0a80 2x 640 bytes
bInterval 1
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 8
bNumEndpoints 1
bInterfaceClass 14
bInterfaceSubClass 2
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x0b20 2x 800 bytes
bInterval 1
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 9
bNumEndpoints 1
bInterfaceClass 14
bInterfaceSubClass 2
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x0be0 2x 992 bytes
bInterval 1
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 10
bNumEndpoints 1
bInterfaceClass 14
bInterfaceSubClass 2
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x13c0 3x 960 bytes
bInterval 1
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 11
bNumEndpoints 1
bInterfaceClass 14
bInterfaceSubClass 2
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x13fc 3x 1020 bytes
bInterval 1
Binary Object Store Descriptor:
bLength 5
bDescriptorType 15
wTotalLength 0x0019
bNumDeviceCaps 1
Container ID Device Capability:
bLength 20
bDescriptorType 16
bDevCapabilityType 4
bReserved 0
ContainerID {20b69f2c-34b3-4690-a228-67bd251277e9}
Device Status: 0x0000
(Bus Powered)

running v4l2-ctl --list-devices

Integrated Camera: Integrated C (usb-101c0000.ehci-1.2):
/dev/video0
/dev/video1

v4l2-ctl -l

                 brightness 0x00980900 (int)    : min=0 max=255 step=1 default=128 value=128
                   contrast 0x00980901 (int)    : min=0 max=255 step=1 default=42 value=42
                 saturation 0x00980902 (int)    : min=0 max=100 step=1 default=64 value=64
                        hue 0x00980903 (int)    : min=-180 max=180 step=1 default=0 value=0

white_balance_temperature_auto 0x0098090c (bool) : default=1 value=1
gamma 0x00980910 (int) : min=90 max=150 step=1 default=120 value=120
gain 0x00980913 (int) : min=4 max=8 step=1 default=4 value=4
power_line_frequency 0x00980918 (menu) : min=0 max=2 default=1 value=1
white_balance_temperature 0x0098091a (int) : min=2800 max=6500 step=1 default=4000 value=4000 flags=inactive
sharpness 0x0098091b (int) : min=0 max=7 step=1 default=2 value=2
backlight_compensation 0x0098091c (int) : min=0 max=2 step=1 default=0 value=0
exposure_auto 0x009a0901 (menu) : min=0 max=3 default=3 value=3
exposure_absolute 0x009a0902 (int) : min=10 max=2500 step=1 default=156 value=156 flags=inactive
error 5 getting ext_ctrl Exposure, Auto Priority

ffmpeg -f v4l2 -list_formats all -i /dev/video0

ffmpeg version 4.3.2 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 8.4.0 (OpenWrt GCC 8.4.0 r16936-e4f5ccf44d)
configuration: --enable-cross-compile --cross-prefix=mipsel-openwrt-linux-musl- --arch=mipsel --cpu=24kc --target-os=linux --prefix=/usr --pkg-config=pkg-config --enable-shared --enable-static --enable-pthreads --enable-zlib --disable-doc --disable-debug --disable-lzma --disable-vaapi --disable-vdpau --disable-outdevs --disable-altivec --disable-vsx --disable-power8 --disable-armv5te --disable-armv6 --disable-armv6t2 --disable-fast-unaligned --disable-runtime-cpudetect --disable-x86asm --enable-gnutls --enable-small --enable-libshine --enable-gpl --enable-libx264
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
[video4linux2,v4l2 @ 0x764fb140] Compressed: mjpeg : Motion-JPEG : 640x480
[video4linux2,v4l2 @ 0x764fb140] Raw : yuyv422 : YUYV 4:2:2 : 640x480
/dev/video0: Immediate exit requested

ffmpeg -f oss -f video4linux2 -s 640x480 -i /dev/video0 out.mpg

ffmpeg version 4.3.2 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 8.4.0 (OpenWrt GCC 8.4.0 r16936-e4f5ccf44d)
configuration: --enable-cross-compile --cross-prefix=mipsel-openwrt-linux-musl- --arch=mipsel --cpu=24kc --target-os=linux --prefix=/usr --pkg-config=pkg-config --enable-shared --enable-static --enable-pthreads --enable-zlib --disable-doc --disable-debug --disable-lzma --disable-vaapi --disable-vdpau --disable-outdevs --disable-altivec --disable-vsx --disable-power8 --disable-armv5te --disable-armv6 --disable-armv6t2 --disable-fast-unaligned --disable-runtime-cpudetect --disable-x86asm --enable-gnutls --enable-small --enable-libshine --enable-gpl --enable-libx264
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
Input #0, video4linux2,v4l2, from '/dev/video0':
Duration: N/A, start: 27755.562880, bitrate: 147456 kb/s
Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 147456 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> mpeg1video (native))
Press [q] to stop, [?] for help
[mpeg @ 0x77eac020] VBV buffer size not set, using default size of 230KB
If you want the mpeg file to be compliant to some specification
Like DVD, VCD or others, make sure you set the correct buffer size
Output #0, mpeg, to 'out.mpg':
Metadata:
encoder : Lavf58.45.100
Stream #0:0: Video: mpeg1video, yuv420p, 640x480, q=2-31, 200 kb/s, 30 fps, 90k tbn, 30 tbc
Metadata:
encoder : Lavc58.91.100 mpeg1video
Side data:
cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
frame= 27 fps=3.8 q=9.3 Lsize= 98kB time=00:00:00.83 bitrate= 963.4kbits/s dup=14 drop=0 speed=0.117x
video:97kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.455840%
Exiting normally, received signal 2.

/usr/bin/mjpg_streamer --input "input_uvc.so --device /dev/video0 -y" --output "output_http.so -p 8090"

MJPG Streamer Version.: 2.0
i: Using V4L2 device.: /dev/video0
i: Desired Resolution: 640 x 480
i: Frames Per Second.: -1
i: Format............: YUYV
i: JPEG Quality......: 80
i: TV-Norm...........: DEFAULT
UVCIOC_CTRL_ADD - Error at Pan (relative): Not a tty (25)
UVCIOC_CTRL_ADD - Error at Tilt (relative): Not a tty (25)
UVCIOC_CTRL_ADD - Error at Pan Reset: Not a tty (25)
UVCIOC_CTRL_ADD - Error at Tilt Reset: Not a tty (25)
UVCIOC_CTRL_ADD - Error at Pan/tilt Reset: Not a tty (25)
UVCIOC_CTRL_ADD - Error at Focus (absolute): Not a tty (25)
UVCIOC_CTRL_MAP - Error at Pan (relative): Not a tty (25)
UVCIOC_CTRL_MAP - Error at Tilt (relative): Not a tty (25)
UVCIOC_CTRL_MAP - Error at Pan Reset: Not a tty (25)
UVCIOC_CTRL_MAP - Error at Tilt Reset: Not a tty (25)
UVCIOC_CTRL_MAP - Error at Pan/tilt Reset: Not a tty (25)
UVCIOC_CTRL_MAP - Error at Focus (absolute): Not a tty (25)
UVCIOC_CTRL_MAP - Error at LED1 Mode: Not a tty (25)
UVCIOC_CTRL_MAP - Error at LED1 Frequency: Not a tty (25)
UVCIOC_CTRL_MAP - Error at Disable video processing: Not a tty (25)
UVCIOC_CTRL_MAP - Error at Raw bits per pixel: Not a tty (25)
o: www-folder-path......: disabled
o: HTTP TCP port........: 8090
o: HTTP Listen Address..: (null)
o: username:password....: disabled
o: commands.............: enabled
^Csetting signal to stop
i: cleaning up resources allocated by input thread
force cancellation of threads and cleanup resources
Segmentation fault

Cannot install nginx ssl with openwrt snapshot image for creality box

Hi,
i have tried to install package nginx-ssl with no luck.
I have an error :
`Unknown package 'nginx-ssl'.
Collected errors:

  • pkg_hash_fetch_best_installation_candidate: Packages for nginx-ssl found, but incompatible with the architectures configured
  • opkg_install_cmd: Cannot install package nginx-ssl.`

Here some info.
`uname -a

  • Linux OpenWrt 5.4.105 #0 Fri Mar 19 23:37:51 2021 mips GNU/Linux`

`cat /proc/cpuinfo

  • system type : MediaTek MT7688 ver:1 eco:2
    machine : Creality WB-01
    processor : 0
    cpu model : MIPS 24KEc V5.5
    BogoMIPS : 385.02
    wait instruction : yes
    microsecond timers : yes
    tlb_entries : 32
    extra interrupt vector : yes
    hardware watchpoint : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
    isa : mips1 mips2 mips32r1 mips32r2
    ASEs implemented : mips16 dsp
    Options implemented : tlb 4kex 4k_cache prefetch mcheck ejtag llsc pindexed_dcache userlocal vint perf_cntr_intr_bit perf
    shadow register sets : 1
    kscratch registers : 0
    package : 0
    core : 0
    VCED exceptions : not available
    VCEI exceptions : not available`

connect wifi

i was change like your file in Wifi folder. But Wb was not found on my network. i was try plug on PC and try connect by putty with ip 192.168.1.1 but error.

klipperwrt.local not known

Hi,

I am KlipperWrt v2.2 Finished following two script.

Download and execute the 1_format_extroot.sh script:
Download and execute the 2_script_manual.sh script:

But Klipperwrt.local is not know. cannot access the Klipper client

[guide] DSLR snapshots - mainboard GPIO triggered

This macro triggers pin PC6 on the Creality v4.2.2 board display port and can be used to trigger a 3.3V relay module in order to act as a shutter for your DSLR.
Call this cheese macro inside your slicer layer change post processing settings.

Note!
To make parked snapshots you have to put this cheese macro inside another macro that parks the head and call this latter macro inside the slicer instead.

Many thanks to Fry Sennberg for this

[output_pin dslr_shutter]
pin: PC6

[gcode_macro cheese]
gcode:
  SET_PIN PIN=dslr_shutter VALUE=1 ; set pin high
  G4  P200 ; dwell for x ms
  SET_PIN PIN=dslr_shutter VALUE=0 ; set pin low

image

image

Screenshots taken from here: https://klipper.wiki/index.php/Creality_4.2.2

klipperwrt.local not known

Nice project, thanks.
After setting up the WIFI Client by the instructions of V2.1 Release Notes I can connect with the IP given by DHCP (192.168.0.211).

The http://klipperwrt.local:81 seems not to work, klipperwrt.local is not known by the network.
How to set it up ?

Thanks.
George

[guide] add logroate.d files

This will rotate logs and prevent

  • Install: opkg update && opkg install logrotate
  • add this cron job in /etc/crontabs/root:
0 8 * * * *     /usr/sbin/logrotate /etc/logrotate.conf
  • Create and put inside /etc/logrotate.d/ the following files and its respective contents:

vi /etc/logrotate.d/klipper

  
/root/klipper_logs/klippy.log
{
    rotate 7
    daily
    maxsize 64M
    missingok
    notifempty
    compress
    delaycompress
    sharedscripts
}

vi /etc/logrotate.d/moonraker

  
/root/klipper_logs/moonraker.log
{
    rotate 7
    daily
    maxsize 64M
    missingok
    notifempty
    compress
    delaycompress
    sharedscripts
}

How to cross-compile a c program for creality box?

Hi, I'm trying to install octoprint on my box by following your guide and this one:

https://community.octoprint.org/t/assorted-guides-as-formerly-maintained-on-the-github-wiki/21146/8

The problem is that some octoprint dependencies, like "regex" (it's a pip package) requires a newer version of ggc in order to be built and installed.

My box has gcc 7.4 (from opkg repo) and this requires, at least, 8.4.

Not sure if it's better to cross-compile gcc itself, or just the dependencies that have no suitable wheel and cannot be compiled under gcc 7.4.

Since creality box version of OpenWRT is not official (yet), not sure if cross-compile it's even suitable there... I would greatly appreciate any hints on this...

Thanks in advance 👍

Install issue with 2_script_manual.sh

Issue with the pip install ... lmdb ... line in scripts/2_script_manual.sh

Error text

Collecting lmdb
  Using cached lmdb-1.3.0.tar.gz (881 kB)
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  Preparing metadata (setup.py) ... error
error: metadata-generation-failed

The above error did not highlight the actual problem. Running pip with -v did.

It seems lmdb is patched and built in situ. It needs pip install wheel and opkg install patch to install.

Ender3 Upgrade to Klipper

I have a Creality WIFi Box and have configured with Klipper/Fluidd and appears to be operational, with add digital camera which also works.
Where I am a little scared is the next step creating a 'Printer.cfg' file for the upgrade of the printer's board to klipper. I have read many pages which scare me because you lose control from the attached display to the printer.
Is this true??
How do you tell if my version of the Ender3 will loose control of onboard display?
I am not ready nor was I aware that this was an issue until I got down the rabbit hole.
As I IT Professional I have learned to listen to my instincts....

connection error

when i connect to the wifi box, I cannot connect to my home wifi on my laptop, what do I do? thanks.

Unable to install any packages as most of the packages are incompatible openwrt repository

Hi,

I was trying to install luci-app-mjpg-streamer and it throws error. Updating luci-base will make the matter worst as it ends up in incompatible files.

Any possibility of hosting openwrt packages or docker image or make-config to compile openwrt packages or stopping the opkg update process.

opkg install luci-app-mjpg-streamer

Installing luci-app-mjpg-streamer (git-20.108.38431-8f34e10) to root...
Downloading https://downloads.openwrt.org/snapshots/packages/mipsel_24kc/luci/luci-app-mjpg-streamer_git-20.108.38431-8f34e10_all.ipk
Installing luci-lua-runtime (git-22.325.41248-fa17c15) to root...
Downloading https://downloads.openwrt.org/snapshots/packages/mipsel_24kc/luci/luci-lua-runtime_git-22.325.41248-fa17c15_mipsel_24kc.ipk
Collected errors:

  • check_data_file_clashes: Package luci-lua-runtime wants to install file /usr/lib/lua/luci/cacheloader.lua
    But that file is already provided by package * luci-base
  • check_data_file_clashes: Package luci-lua-runtime wants to install file /usr/lib/lua/luci/ccache.lua
    But that file is already provided by package * luci-base
  • check_data_file_clashes: Package luci-lua-runtime wants to install file /usr/lib/lua/luci/config.lua
    But that file is already provided by package * luci-base
  • check_data_file_clashes: Package luci-lua-runtime wants to install file /usr/lib/lua/luci/dispatcher.lua
    But that file is already provided by package * luci-base
  • check_data_file_clashes: Package luci-lua-runtime wants to install file /usr/lib/lua/luci/i18n.lua
    But that file is already provided by package * luci-base
  • check_data_file_clashes: Package luci-lua-runtime wants to install file /usr/lib/lua/luci/model/uci.lua
    But that file is already provided by package * luci-base
  • check_data_file_clashes: Package luci-lua-runtime wants to install file /usr/lib/lua/luci/store.lua
    But that file is already provided by package * luci-base
  • check_data_file_clashes: Package luci-lua-runtime wants to install file /usr/lib/lua/luci/sys/zoneinfo/tzdata.lua
    But that file is already provided by package * luci-base
  • check_data_file_clashes: Package luci-lua-runtime wants to install file /usr/lib/lua/luci/sys/zoneinfo/tzoffset.lua
    But that file is already provided by package * luci-base
  • check_data_file_clashes: Package luci-lua-runtime wants to install file /usr/lib/lua/luci/sys/zoneinfo.lua
    But that file is already provided by package * luci-base
  • check_data_file_clashes: Package luci-lua-runtime wants to install file /usr/lib/lua/luci/sys.lua
    But that file is already provided by package * luci-base
  • check_data_file_clashes: Package luci-lua-runtime wants to install file /usr/lib/lua/luci/template/parser.so
    But that file is already provided by package * luci-base
  • check_data_file_clashes: Package luci-lua-runtime wants to install file /usr/lib/lua/luci/template.lua
    But that file is already provided by package * luci-base
  • check_data_file_clashes: Package luci-lua-runtime wants to install file /usr/lib/lua/luci/version.lua
    But that file is already provided by package * luci-base
  • check_data_file_clashes: Package luci-lua-runtime wants to install file /usr/lib/lua/luci/view/empty_node_placeholder.htm
    But that file is already provided by package * luci-base
  • check_data_file_clashes: Package luci-lua-runtime wants to install file /usr/lib/lua/luci/view/indexer.htm
    But that file is already provided by package * luci-base
  • check_data_file_clashes: Package luci-lua-runtime wants to install file /usr/lib/lua/luci/xml.lua
    But that file is already provided by package * luci-base
  • opkg_install_cmd: Cannot install package luci-app-mjpg-streamer.

[guide] Android phone snapshots - adb triggered

<----> <---->

Use adb tools to trigger phone camera through USB. This will allow to take snapshots on command allowing for a Klipper macro integration on Z layer change.

Inspired from here and here

🔢 Steps:

  1. Enable USB Debugging on your phone
  2. Download adb tools on your Klippy host or install it from repo: for OpenWrt that would be opkg install adb
  3. Install the unofficial klipper shell_command extension here by Arksine
    • That needs to be copied to klipper/klippy/extras/gcode_shell_command.py
    • Extra info and configurations here
  4. Insert the macros below in your printer.cfg
    5.Inside your slicer call the ADB_TAKE_FRAME macro on z layer change
    • If you want timelapse with head parked either integrate the ADB_TAKE_FRAME into another macro that does just that
      OR
    • If you use Cura, there's a Time Lapse post proccessing script. See below
  5. Make sure camera app is running and the phone doesn't have a sleep timeout.
  6. Execute the ADB_START_SERVER macro to make sure adb-server is running and listening to commands. You can add this macro to your START GCODE if you want
  7. Focus and lock exposure to where your print will sit/be parked
  8. Print!

⌨️ useful adb commands:

adb shell input keyevent CAMERA  #this command will trigger
adb shell input keyevent FOCUS #this command will focus
adb shell input tap x y #will send a tap at x and y pixel coordinates.
adb shell input swipe x1 x2 y1 y2 #will send a swipe from (x1,y1) to (x2,y2)

Note!

  • Some cameras have timeouts. To avoid that, Open Camera app is recommended.
  • Otherwise, to wake the camera if it times out, we can send a swipe before triggering. (If we send a tap while the camera hasn't timed out yet, it will focus there and you might not want that if you use manual focus).This is still tricky and focus resets to center after every wakeup.

⚙️ Macro template

#this macro will start the adb server on the klippy host
[gcode_shell_command adb_start]
command: adb start-server
timeout: 3.
verbose: False
[gcode_macro ADB_START_SERVER]
gcode:
    RUN_SHELL_COMMAND CMD=adb_start


#this macro will take a snapshot on your android phone using adb shell command
[gcode_shell_command adb_trigger]
command: adb shell input keyevent KEYCODE_CAMERA
timeout: 3.
verbose: False
[gcode_macro ADB_TAKE_FRAME]
gcode:
    RUN_SHELL_COMMAND CMD=adb_trigger

After you copy the above macros to printer.cfg, buttons should appear here. You can manually execute them if you want to test:
image


Static Timelapses

To create timelapses with the head out of the way, make another macro that parks the head and calls the ADB_TAKE_FRAME macro. Make sure to insert the newly created macro in your slicer layer change instead.

OR

If you use Cura, you can take advantage of the Time Lapse post proccesing script and insert the ADB_TAKE_FRAME in the Trigger camera command field

image

Here's a test print:

calicube.mp4

Many thanks to Kruze17 for testing and helping!

Update the What is the Creality Wi-Fi Box? spot

"A router box device released by Creality meant to add network control to your printer.
Big claims, lots of problems and frustrations. No desktop control, only mobile.
No custom slicing only cloud based. No camera support, only claims."

it has a cura plugin, so deaktop printing, it has a camera but only can buy in a kit, the app has had a rework and is much better
still needs a few fixes but it is much better

https://share.crealitycloud.com/creality-cloud/share-content/3362

Klipper screen Android and ADXL

Not so much a problem but more of a question.

Is it possible to run Klipper screen for android on the Creality box either though wifi or USB? and can the ADXL be used in the second USB port od do you have to do it via the main board?

[dev] consider zram / zswap

This is a kind of swap that resides on RAM in a compressed form. It will make swapping and ram usage more efficient and it will increase the lifespan of the sd card as well.

Resources:
https://openwrt.org/packages/pkgdata/zram-swap
https://openwrt.org/packages/pkgdata/kmod-zram
https://forum.openwrt.org/t/retracted-compressed-memory-this-project-is-officially-retracted-take-note-about-its-future/49076
https://forum.openwrt.org/t/mounting-swap-on-zram-with-discard/48451
https://forum.openwrt.org/t/possible-to-use-zswap/8916/6
https://stackoverflow.com/questions/24467604/swapon-failed-trying-to-enable-zram

Interesting read:
https://haydenjames.io/linux-performance-almost-always-add-swap-part2-zram/
https://ikarus.sg/using-zram-to-get-more-out-of-your-raspberry-pi/

Building:
kmod-zram kmod-lib-lzo (this is selected by default) kmod-lib-lz4 kmod-lib-zstd
Kernel config:
zswap zbud z3fold

Enabling zswap:
either:
opkg install zram-swap - will allocate half of ram size to zram0
echo 1 > /sys/module/zswap/parameters/enabled; in /etc/rc.local (if not enabled by default in kernel)
or

##inside rc.local

swapoff /dev/zram0;
echo 1 > /sys/block/zram0/reset;
echo lzo > /sys/block/zram0/comp_algorithm              
echo 60M > /sys/block/zram0/disksize;
echo 1 > /sys/module/zswap/parameters/enabled;       #seems to be enabled by default
mkswap /dev/zram0;
swapon -p 5 /dev/zram0;

#echo lz4 > /sys/module/zswap/parameters/compressor;
#echo z3fold > /sys/module/zswap/parameters/zpool;
#echo 20 > /sys/module/zswap/parameters/max_pool_percent;
#echo 75 > /proc/sys/vm/swappiness;

[guide] DSLR snapshots - gphoto2 triggered

Use gphoto2 to trigger a DSLR shutter. With this software you can also transfer pictures to the Linux controlling device as well. Luckily this package is available inside OpenWrt repo:
opkg update && opkg install gphoto2 libgphoto2-drivers-ptp2

Note!
There are a lot of other drivers so if with this one your cammera is not detected when you run gphoto2 --auto-detect you might have to try others. Look in here for libgphoto2-drivers-* packages to find a possible driver name.

Connection:

     📷 <----- USB cable -----> 📥
(DSLR camera)             (OpenWrt box)

Useful comands

gphoto2 --trigger-capture
gphoto2 --list-files
gphoto2 --get-config capturetarget
gphoto2 --set-config capturetarget=1 to change save location to SD card instead of camera RAM

Executing shell commands in klipper

Unofficial extension here by Arksine
Needs to be copied to klipper/klippy/extras
Configurations here

Macro tamplate
❗ Make sure the Capture Target is set to Memory card. Use gphoto2 --get-config capturetarget to check that and gphoto2 --set-config capturetarget=1 to change it

[gcode_shell_command gphoto_trigger]
command: gphoto2 --trigger-capture
timeout: 2.
verbose: False
[gcode_macro GPHOTO_TAKE_FRAME]
gcode:
    RUN_SHELL_COMMAND CMD=gphoto_trigger

Use GPHOTO_TAKE_FRAME in slicer after layer change

You can also create another macro (named for ex: GPHOTO_TAKE_PARKED_FRAME) that parks the head and calls the above GPHOTO_TAKE_FRAME macro. This will create nicer timelapses with the head out of the way. Don't forget to use GPHOTO_TAKE_PARKED_FRAME inside slicer Z layer change instead.

video tutorial:
https://www.youtube.com/watch?v=1eAYxnSU2aw

Maybe useful for my D3300:
https://github.com/gphoto/libgphoto2/blob/master/camlibs/ptp2/cameras/nikon-d3300.txt

installation errors oct 2022

Hello,

I have tried to install using the automation scripts (1_format_extroot.sh and 2_script_manual.sh)

Here are some errors I've got:

  • pip install streaming-form-data
root@OpenWrt:~# pip3 install streaming-form-data -v
Using pip 22.2.2 from /usr/lib/python3.10/site-packages/pip (python 3.10)
Collecting streaming-form-data
  Using cached streaming-form-data-1.11.0.tar.gz (93 kB)
  Running command pip subprocess to install build dependencies
  /usr/bin/python3: can't open file '/usr/lib/python3.10/site-packages/pip/__pip-runner__.py': [Errno 2] No such file or directory
  error: subprocess-exited-with-error

  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 2
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /usr/bin/python3 /usr/lib/python3.10/site-packages/pip/__pip-runner__.py install --ignore-installed --no-user --prefix /tmp/pip-build-env-v6e0mik_/overlay --no-warn-script-location -v --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel
  cwd: [inherit]
  Installing build dependencies ... error
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 2
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.


  • pip install apprise -
Using cached PyYAML-6.0.tar.gz (124 kB)
 error: subprocess-exited-with-error
  • pip install msgpack
    error: subprocess-exited-with-error

Webcam not working

If I plug my webcam (on USB2) I get this:

config mjpg-streamer 'core'
        option enabled '0'
        option input 'uvc'
        option output 'http'
        option device '/dev/video0'
        option resolution '640x480'
        option yuv '0'
        option quality '80'
        option fps '5'
        option led 'auto'
        option www '/www/webcam'
        option port '8080'
        #option listen_ip '192.168.1.1'
        #option username 'openwrt'
        #option password 'openwrt'

But I cannot see the stream on 8080 port.

Instal issue

Hi.
What an amazing work thats done...
According to be a newbie, i run in to a, for me, major problem by installing KlipperWrt on my Creality WiFi 1,0 box.
I followed descriptions, and great youtube video, but when i try to connect to, Http://klipperwrt.local or, in my case http://192.168.8.118 my browser isn't able to make the connection. . It works fine with :81 LuCI.
I used Auto steps, with newest v2.2
Running iOS High Sierra and Safari, but Mozilla, Chrome etc. is tried without any change.
Log is attached.. Hope that you can identify my problem since its just something others hasn't reported about as an issue.

Automatic install is not working.

After installing with the automatic scripts, I always get an error related to nginx when trying to reload the page.
502 Bad Gateway
nginx/1.21.3

http://192.168.1.208
No moonraker connection. Please check moonraker status and / or refresh.

Maybe this has something to do with newer version of moonraker, not sure.
Can anyone help with this?

Thank you in advance.

Can’t open fluidd in safari

Hi, first of all I want to say thank you, because of this I can finally use my useless box, but i have two issues, the first one is that I can’t open fluidd in my iPad, I was reading a lot but with any answer, but i can open the duet-web-control, so I think that is a fluidd problem with the msie6 browser or something like that, and the other issue is that I can’t run the autobed leveling, do you know what I am doing wrong? Thank you very much another time, this is awesome!

File Permission Issue

When I access the box via SSH in Command Prompt for Windows 10, it lets me into the console fine, but when I try to change the files for wireless setup, it says "Permission Denied". Have tried resetting the box via the button on the side, no dice. Also when I try to flash a new image to the box, it just goes through normal setup, and then does the "Permission Denied" thing again. Anyone have a solution for this?
Thanks!

(Sorry, don't have screenshots as I lost the SD card.)

Moonraker doesn't find the gcode path

I get this error from Fluidd: "GCode path received from Klipper does not exist: /gcode_files" (from Moonraker).

But I just set this:

[virtual_sdcard]
# for gcode upload
path: /root/printer_data/gcodes

and the /root/printer_data/gcodes exist.

How fix it?

[guide] Add instructions to create hotplug rules for persistent tty ports

  • opkg update && opkg install usbutils

  • use lsusb - find your mainboard ID: idVendor:idProduct

  • do grep idVendor/idProduct /sys/bus/usb/devices/*/uevent - replace idVendor and idProduct accordingly

  • note the values of PRODUCT: something like 1a86/7523/264 (these are specific to my mainboard type)

  • do the command block below that will create a hotplug rule (edit the file after: /etc/hotplug.d/usb/22-tty-symlink after running the below command) and replace PRODID to the values of PRODUCT= from the grep command above. Change SYMLINK name to your likings just don't use spaces.

  • plug/unplug your printer while on and check if symlink is created inside /dev with ls -l /dev. your SYMLINK name should point to a serial port something like SYMLINK -> /dev/ttyUSB0

  • inside printer.cfg replace the serial path under [mcu] to /dev/SYMLINK where SYMLINK should be your chosen name OR ttyPrinter (as it is by default)

cat << "EOF" > /etc/hotplug.d/usb/22-tty-symlink
# Description: Action executed on boot (bind) and with the system on the fly
PRODID="1a86/7523/264" #change here according to "PRODUCT=" from grep command 
SYMLINK="ttyPrinter" #you can change this to whatever you want just don't use spaces. Use this inside printer.cfg as serial port path
if [ "${ACTION}" = "bind" ] ; then
  case "${PRODUCT}" in
    ${PRODID}) # mainboard product id prefix
      DEVICE_TTY="$(ls /sys/${DEVPATH}/tty*/tty/)"
      # Mainboard connected to USB1 slot
      if [ "${DEVICENAME}" = "1-1.4:1.0" ] ; then
        ln -s /dev/${DEVICE_TTY} /dev/${SYMLINK}
        logger -t hotplug "Symlink from /dev/${DEVICE_TTY} to /dev/${SYMLINK} created"

      # Mainboard connected to USB2 slot
      elif [ "${DEVICENAME}" = "1-1.2:1.0" ] ; then
        ln -s /dev/${DEVICE_TTY} /dev/${SYMLINK}
        logger -t hotplug "Symlink from /dev/${DEVICE_TTY} to /dev/${SYMLINK} created"
      fi
    ;;
  esac
fi
# Action to remove the symlinks
if [ "${ACTION}" = "remove" ]  ; then
  case "${PRODUCT}" in
    ${PRODID})  #mainboard product id prefix
     # Mainboard connected to USB1 slot
      if [ "${DEVICENAME}" = "1-1.4:1.0" ] ; then
        rm /dev/${SYMLINK}
        logger -t hotplug "Symlink /dev/${SYMLINK} removed"

      # Mainboard connected to USB2 slot
      elif [ "${DEVICENAME}" = "1-1.2:1.0" ] ; then
        rm /dev/${SYMLINK}
        logger -t hotplug "Symlink /dev/${SYMLINK} removed"
      fi
    ;;
  esac
fi
EOF

[guide] Add timelapse instructions

Update guide with instructions to install timelapse moonraker component + dependencies

  • Download packages from packages/ffmpeg in my repo (make sure you don't clone into /tmp)
  • ❗ reboot the box -> DO NOT DO opkg update
  • cd to that folder and do opkg install *ipk
  • install wget-ssl with opkg update && opkg install wget-ssl
  • download timelapse.py into /root/moonraker/moonraker/components:
wget https://github.com/FrYakaTKoP/moonraker/raw/dev-timelapse/moonraker/components/timelapse.py -P /root/moonraker/moonraker/components
  • Put this inside moonraker.conf. Uncomment
# moonraker.conf

[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: /tmp/timelapse/
##   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"
  • macros into your printer.cfg:
#this macro is called by the slicer layer change command
[gcode_macro TIMELAPSE_TAKE_FRAME]
gcode:
 {action_call_remote_method("timelapse_newframe")}

#this macro will take snapshots with the printerhead parked. If you want that, add this in your slicer layer cahnge instead
[gcode_macro TIMELAPSE_TAKE_PARKED_FRAME]
gcode:
 SAVE_GCODE_STATE NAME=SNAPSHOT
 G1 E-10 F2100 ;Retract
 G91 ;Relative
 G1 Z5 ;move up 5
 G90 ;Absolute coordinates
 G1 X5 Y205 F6000 ;Move away from the print

 G4 P500 ;Wait for 500ms
 TIMELAPSE_TAKE_FRAME ;Take frame
 G4 P500 ;Wait for 500ms
 G1 E10 F2100 ;Extrude back

 RESTORE_GCODE_STATE NAME=SNAPSHOT MOVE=1 MOVE_SPEED=6000
 
    


#this macro allows you to render the timelapse if the print has failed or if `autorender` is set to `False`
[gcode_macro TIMELAPSE_RENDER]
gcode:
 {action_call_remote_method("timelapse_render")}
  • Follow instructions from here to configure your slicer for timelapse
  • To disable autorendering of the video (that is done immediately after the print finishes) set autorender: False undermoonraker.conf [timelapse] block. You'll be able to render it with TIMELAPSE_RENDER macro afterwards or you can copy the frames from /tmp/timelapse to your pc (with WinSCP) and render them there faster.
  • ❗ If you reboot the box frames from /tmp/timelase will be erased so copy them before rebooting.

256MB RAM support

Hello again! All works mostly ideal. But i whant to resolder RAM and make it 256mb. Do i need recompile openwrt?

[dev] Debian filesystem with OpenWrt kernel

Since Debian is not fully supported on ramips a workaround is to use the OpenWrt kernel and Debian filesystem as default.
OpenWrt kernel .bin file needs to be configured to use the Debian filesystem from the sd card.

Links:
https://forum.openwrt.org/t/i-just-got-debian-stretch-to-boot-on-linkit-smart-7688-but-need-some-help/17231
http://cyber-place.ru/showthread.php?t=2931
https://dev.t-firefly.com/thread-986-1-1.html
https://wiki.debian.org/InstallingDebianOn/D-Link/DIR-825
https://community.onion.io/topic/2394/installing-debian-on-omega2-board

go2rtc

Is possible (and how) install go2rtc?
I need convert RTSP of my cam

[guide] add sytem.log to klipper_logs

Edit /etc/config/system and make sure you have the following under system block

option log_file '/root/klipper_logs/system.log'
option log_size '512'
option log_remote '0'

image

you'll then be able to access and/or download the system log from fluidd:
image

http://openwrt.local not working

I have gone though the entire install process and now can not get access I went with the mainsail option and I have also changed the host name to KlipperWrtMax as I am using two 1 for a ender3v2 and 1 for a max.

I've tried http://openwrt.local http://openwrt.local:81 http://box-ip http://box-ip:81 http://KlipperWrtMax.local http://KlipperWrtMax.local:81 http://klipper.local http://klipper.local:81 http://mainsail.local http://mainsail.local:81

Nothing seems to work apart from LuCI though my networks assigned IP address for the box.

Can't connect using to box using Putty over wifi

image

Hello.
I have successfully followed and installed openwrt on my box and configured all /etc/config/xxxxx folders using rj-45 cable over ethernet. It connects to my router also. But i am not able to connect it over wifi using putty. It shows "Network error: Connection timed out".

Any heads up on what i am doing or going wrong?
Thanks.

OctoWRT to KlipperWRT

I have OctoWRP installed on my Creality Box, I would like to do a clean install and install KlipperWRT.
What is the procedure to follow?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.