Input Shaper with orangepi and Canbus
Hi,
I am trying to install input shaper on my installation. It is klipper running from an orangepi which is controlling an octopus pro running as a can adapter and a fly sb2040 running in can mode. Repetier and klipper are running great for printing but I am unable to get input shaper to install properly. The installer runs with some errors when updating the klipper config and then when it is finished there is no option to run input shaper but only an option to install again. Any ideas on how to get this to work?
Thanks
Here are possible relevant log info:
###### Adding required Input Shaping options in Klipper configuration ######
Added [mcu rpi] section
OK
cp: cannot stat '/opt/klipper/Printer/scripts/klipper-mcu-start.sh': No such file or directory
update-rc.d: error: unable to read /etc/init.d/klipper_mcu
usermod: user 'pi' does not exist
Creating symbolic link out/board
Creating symbolic link out/board
Building out/autoconf.h
Compiling out/src/sched.o
Compiling out/src/command.o
Compiling out/src/basecmd.o
Compiling out/src/debugcmds.o
Compiling out/src/initial_pins.o
Compiling out/src/gpiocmds.o
Compiling out/src/stepper.o
Compiling out/src/endstop.o
Compiling out/src/trsync.o
Compiling out/src/adccmds.o
Compiling out/src/spicmds.o
Compiling out/src/pwmcmds.o
Compiling out/src/linux/main.o
Compiling out/src/linux/timer.o
Compiling out/src/linux/console.o
Compiling out/src/linux/watchdog.o
Compiling out/src/linux/pca9685.o
Compiling out/src/linux/spidev.o
Compiling out/src/linux/analog.o
Compiling out/src/linux/hard_pwm.o
src/linux/hard_pwm.c: In function 'gpio_pwm_setup':
src/linux/hard_pwm.c:69:5: warning: ignoring return value of 'write' declared with attribute 'warn_unused_result' [-Wunused-result]
69 | write(fd, scratch, strlen(scratch));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/linux/hard_pwm.c: In function 'gpio_pwm_write':
src/linux/hard_pwm.c:105:9: warning: ignoring return value of 'write' declared with attribute 'warn_unused_result' [-Wunused-result]
105 | write(g.enable_fd, "0", 2);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
src/linux/hard_pwm.c:111:5: warning: ignoring return value of 'write' declared with attribute 'warn_unused_result' [-Wunused-result]
111 | write(g.duty_fd, scratch, len + 1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/linux/hard_pwm.c:112:5: warning: ignoring return value of 'write' declared with attribute 'warn_unused_result' [-Wunused-result]
112 | write(g.enable_fd, "1", 2);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
Compiling out/src/linux/i2c.o
Compiling out/src/linux/gpio.o
Compiling out/src/generic/crc16_ccitt.o
Compiling out/src/generic/alloc.o
Compiling out/src/linux/sensor_ds18b20.o
Building out/compile_time_request.o
Version: v0.11.0-297-g5edc7fee
Linking out/klipper.elf
/usr/bin/ld: out/src/spicmds.o: in function `spidev_transfer':
/opt/klipper/Printer/src/spicmds.c:96: undefined reference to `spi_software_prepare'
/usr/bin/ld: /opt/klipper/Printer/src/spicmds.c:104: undefined reference to `spi_software_transfer'
collect2: error: ld returned 1 exit status
make: *** [Makefile:72: out/klipper.elf] Error 1
###### Launching Klipper host software ######
Restarting klipper_Printer (via systemctl): klipper_Printer.service.
Added [mcu rpi] section
OK
cp: cannot stat '/opt/klipper/Printer/scripts/klipper-mcu-start.sh': No such file or directory
update-rc.d: error: unable to read /etc/init.d/klipper_mcu
usermod: user 'pi' does not exist
Creating symbolic link out/board
Creating symbolic link out/board
Building out/autoconf.h
Compiling out/src/sched.o
Compiling out/src/command.o
Compiling out/src/basecmd.o
Compiling out/src/debugcmds.o
Compiling out/src/initial_pins.o
Compiling out/src/gpiocmds.o
Compiling out/src/stepper.o
Compiling out/src/endstop.o
Compiling out/src/trsync.o
Compiling out/src/adccmds.o
Compiling out/src/spicmds.o
Compiling out/src/pwmcmds.o
Compiling out/src/linux/main.o
Compiling out/src/linux/timer.o
Compiling out/src/linux/console.o
Compiling out/src/linux/watchdog.o
Compiling out/src/linux/pca9685.o
Compiling out/src/linux/spidev.o
Compiling out/src/linux/analog.o
Compiling out/src/linux/hard_pwm.o
src/linux/hard_pwm.c: In function 'gpio_pwm_setup':
src/linux/hard_pwm.c:69:5: warning: ignoring return value of 'write' declared with attribute 'warn_unused_result' [-Wunused-result]
69 | write(fd, scratch, strlen(scratch));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/linux/hard_pwm.c: In function 'gpio_pwm_write':
src/linux/hard_pwm.c:105:9: warning: ignoring return value of 'write' declared with attribute 'warn_unused_result' [-Wunused-result]
105 | write(g.enable_fd, "0", 2);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
src/linux/hard_pwm.c:111:5: warning: ignoring return value of 'write' declared with attribute 'warn_unused_result' [-Wunused-result]
111 | write(g.duty_fd, scratch, len + 1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/linux/hard_pwm.c:112:5: warning: ignoring return value of 'write' declared with attribute 'warn_unused_result' [-Wunused-result]
112 | write(g.enable_fd, "1", 2);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
Compiling out/src/linux/i2c.o
Compiling out/src/linux/gpio.o
Compiling out/src/generic/crc16_ccitt.o
Compiling out/src/generic/alloc.o
Compiling out/src/linux/sensor_ds18b20.o
Building out/compile_time_request.o
Version: v0.11.0-297-g5edc7fee
Linking out/klipper.elf
/usr/bin/ld: out/src/spicmds.o: in function `spidev_transfer':
/opt/klipper/Printer/src/spicmds.c:96: undefined reference to `spi_software_prepare'
/usr/bin/ld: /opt/klipper/Printer/src/spicmds.c:104: undefined reference to `spi_software_transfer'
collect2: error: ld returned 1 exit status
make: *** [Makefile:72: out/klipper.elf] Error 1
###### Launching Klipper host software ######
Restarting klipper_Printer (via systemctl): klipper_Printer.service.
Comments
Requirement already satisfied: cffi==1.14.6 in /opt/klipper/GDTW/klippy-env/lib/python3.10/site-packages (from -r /opt/klipper/GDTW/scripts/klippy-requirements.txt (line 5)) (1.14.6)
Requirement already satisfied: pyserial==3.4 in /opt/klipper/GDTW/klippy-env/lib/python3.10/site-packages (from -r /opt/klipper/GDTW/scripts/klippy-requirements.txt (line 6)) (3.4)
Requirement already satisfied: greenlet==2.0.2 in /opt/klipper/GDTW/klippy-env/lib/python3.10/site-packages (from -r /opt/klipper/GDTW/scripts/klippy-requirements.txt (line 7)) (2.0.2)
Requirement already satisfied: Jinja2==2.11.3 in /opt/klipper/GDTW/klippy-env/lib/python3.10/site-packages (from -r /opt/klipper/GDTW/scripts/klippy-requirements.txt (line 8)) (2.11.3)
Requirement already satisfied: python-can==3.3.4 in /opt/klipper/GDTW/klippy-env/lib/python3.10/site-packages (from -r /opt/klipper/GDTW/scripts/klippy-requirements.txt (line 9)) (3.3.4)
Requirement already satisfied: markupsafe==1.1.1 in /opt/klipper/GDTW/klippy-env/lib/python3.10/site-packages (from -r /opt/klipper/GDTW/scripts/klippy-requirements.txt (line 10)) (1.1.1)
Requirement already satisfied: pycparser in /opt/klipper/GDTW/klippy-env/lib/python3.10/site-packages (from cffi==1.14.6->-r /opt/klipper/GDTW/scripts/klippy-requirements.txt (line 5)) (2.21)
Requirement already satisfied: aenum in /opt/klipper/GDTW/klippy-env/lib/python3.10/site-packages (from python-can==3.3.4->-r /opt/klipper/GDTW/scripts/klippy-requirements.txt (line 9)) (3.1.15)
Requirement already satisfied: wrapt~=1.10 in /opt/klipper/GDTW/klippy-env/lib/python3.10/site-packages (from python-can==3.3.4->-r /opt/klipper/GDTW/scripts/klippy-requirements.txt (line 9)) (1.15.0)
###### Adding required Input Shaping options in Klipper configuration ######
OK
Installing klipper-mcu service over systemd
usermod: user 'pi' does not exist
Creating symbolic link out/board
Creating symbolic link out/board
Building out/autoconf.h
Compiling out/src/sched.o
Compiling out/src/command.o
Compiling out/src/basecmd.o
Compiling out/src/debugcmds.o
Compiling out/src/initial_pins.o
Compiling out/src/gpiocmds.o
Compiling out/src/stepper.o
Compiling out/src/endstop.o
Compiling out/src/trsync.o
Compiling out/src/adccmds.o
Compiling out/src/spicmds.o
Compiling out/src/i2ccmds.o
Compiling out/src/pwmcmds.o
Compiling out/src/buttons.o
Compiling out/src/tmcuart.o
Compiling out/src/neopixel.o
Compiling out/src/pulse_counter.o
Compiling out/src/lcd_st7920.o
Compiling out/src/lcd_hd44780.o
Compiling out/src/spi_software.o
Compiling out/src/i2c_software.o
Compiling out/src/sensor_lis2dw.o
Compiling out/src/thermocouple.o
Compiling out/src/sensor_adxl345.o
Compiling out/src/sensor_angle.o
Compiling out/src/sensor_mpu9250.o
Compiling out/src/linux/main.o
Compiling out/src/linux/timer.o
Compiling out/src/linux/console.o
Compiling out/src/linux/watchdog.o
Compiling out/src/linux/pca9685.o
Compiling out/src/linux/spidev.o
Compiling out/src/linux/analog.o
Compiling out/src/linux/hard_pwm.o
src/linux/hard_pwm.c: In function 'gpio_pwm_setup':
src/linux/hard_pwm.c:69:5: warning: ignoring return value of 'write' declared with attribute 'warn_unused_result' [-Wunused-result]
69 | write(fd, scratch, strlen(scratch));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/linux/hard_pwm.c: In function 'gpio_pwm_write':
src/linux/hard_pwm.c:105:9: warning: ignoring return value of 'write' declared with attribute 'warn_unused_result' [-Wunused-result]
105 | write(g.enable_fd, "0", 2);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
src/linux/hard_pwm.c:111:5: warning: ignoring return value of 'write' declared with attribute 'warn_unused_result' [-Wunused-result]
111 | write(g.duty_fd, scratch, len + 1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/linux/hard_pwm.c:112:5: warning: ignoring return value of 'write' declared with attribute 'warn_unused_result' [-Wunused-result]
112 | write(g.enable_fd, "1", 2);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
Compiling out/src/linux/i2c.o
Compiling out/src/linux/gpio.o
Compiling out/src/generic/crc16_ccitt.o
Compiling out/src/generic/alloc.o
Compiling out/src/linux/sensor_ds18b20.o
Building out/compile_time_request.o
Version: v0.11.0-297-g5edc7fee
Linking out/klipper.elf
Flashing
Installing micro-controller code to /usr/local/bin/
Attempting host MCU restart...
###### Launching Klipper host software ######
Restarting klipper_GDTW (via systemctl): klipper_GDTW.service.
Actually so far it looks goot. Check using
ps aux | grep kli
if you see a line like
root 3704 0.1 0.0 2348 1844 ? SLs Oct11 2:01 /usr/local/bin/klipper_mcu -r -I /tmp/klipper_host_mcu
indicating that the cpu mcu is running. Or try directly
It would also show any error message on startup.
If that is running check klipper log what is going wrong. All the install does is adding required python modules and compiling and installing this cpu service. All remaining is configuration. Not sure how good this works on non pi systems. Especially the method to activate spi/i2c are optimised for pi and will eventually not work on other boards not using config.txt to configure them.
cs_pin: rpi:gpio1
spi_software_sclk_pin: rpi:gpio0
spi_software_mosi_pin: rpi:gpio3
spi_software_miso_pin: rpi:gpio2
[resonance_tester]
accel_chip: adxl345
probe_points:
150, 150, 20 # an example
[input_shaper]
canbus_uuid: 23a08e371e40
touch /etc/init.d/klipper_mcu
and reload klipper page and you should see the start klipper menu entry.
Tomorrow the nightly builds will already contain the fix for detection.