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.

Comments

  • We are working on this. Klipper has changed required install procedure so with newer klipper versions the service file has changed from init.d to systemd. Hope to get it working today or tomorrow. Just retry to see if it was fixed.
  • Ok, I think the new install script should work. Did work in my test system at least.
  • Unfortunately I am still having the same issue. Should I update to the latest nightly repetier version? I see some similar problems at the end of the output. Are they relevant? I am wondering if it is because I am using the ARM build and not using a raspberry pi. One of the messages is 'usermod: user 'pi' does not exist'. Do I need to add a user named pi?

    ###### Updating python virtual environment ######

    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.

  • No it is not the user pi getting tty group. I see it runs as root anyway, so should be fine.

    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
    service klipper-mcu status
    ● klipper-mcu.service - Starts the MCU Linux firmware for klipper on startup
         Loaded: loaded (/lib/systemd/system/klipper-mcu.service; enabled; vendor preset: enabled)
         Active: active (running) since Wed 2023-10-11 10:55:33 CEST; 21h ago
       Main PID: 3704 (klipper_mcu)
          Tasks: 1 (limit: 3873)
            CPU: 2min 1.784s
         CGroup: /system.slice/klipper-mcu.service
                 └─3704 /usr/local/bin/klipper_mcu -r -I /tmp/klipper_host_mcu

    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.

  • It looks like the process is running and the log looks pretty clean. I an wondering then if the problem is just that repetier does not detect that it is installed and is not giving the option to run it. What does it look for in order to give those options. Can I manually set a flag somewhere to tell it that input shaper is installed? I have in my config file some input shaper stuff pertaining to the sb2040 which I am using

    [adxl345]
    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]

    And earlier in the file I have defined on canbus as so:
    [mcu rpi]
    canbus_uuid: 23a08e371e40

  • I see I missed the server detection feature. It tests for existence of mcu service in old installation position, so file /etc/init.d/klipper_mcu must exist, also it gets deleted during installation. So after installing it run
    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.
  • Awesome, it works. Thank you!
Sign In or Register to comment.