Jump to content

HermitCrab not communicating over canbus with klipper

Recommended Posts

After some trial and error, I was finally able to get Klipper to compile and install to my BTT HermitCrab controller…


pi@octoPizzle2:~/klipper $ lsusb

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Bus 001 Device 007: ID 0483:df11 STMicroelectronics STM Device in DFU Mode

Bus 001 Device 003: ID 046d:c31c Logitech, Inc. Keyboard K120

Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


pi@octoPizzle2:~/klipper $ make flash FLASH_DEVICE=0483:df11

  Flashing out/klipper.bin to 0483:df11

sudo dfu-util -d ,0483:df11 -R -a 0 -s 0x8000000:leave -D out/klipper.bin


dfu-util 0.9


Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.

Copyright 2010-2016 Tormod Volden and Stefan Schmidt

This program is Free Software and has ABSOLUTELY NO WARRANTY

Please report bugs to http://sourceforge.net/p/dfu-util/tickets/


dfu-util: Invalid DFU suffix signature

dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!

Opening DFU capable USB device...

ID 0483:df11

Run-time device DFU version 011a

Claiming USB DFU Interface...

Setting Alternate Setting #0 ...

Determining device status: state = dfuERROR, status = 10

dfuERROR, clearing status

Determining device status: state = dfuIDLE, status = 0

dfuIDLE, continuing

DFU mode device DFU version 011a

Device returned transfer size 2048

DfuSe interface name: "Internal Flash  "

Downloading to address = 0x08000000, size = 21464

Download        [=========================] 100%        21464 bytes

Download done.

File downloaded successfully

Transitioning to dfuMANIFEST state

dfu-util: can't detach

Resetting USB to switch back to runtime mode


 and initialize properly (verified by running “dmesg | grep -i can”)


[    6.346440] CAN device driver interface

[    6.363660] mcp251x spi0.0 can0: MCP2515 successfully initialized.

[62184.029014] can: controller area network core

[62184.038379] can: raw protocol


However, when I run the "canbus_query.py" script, it executes and returns with no canbus IDs of devices found on the bus.


pi@octoPizzle2:~/klipper $ ~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0

Total 0 uuids found


The thing is, I DO see packets come back on the can0 interface, each time I run the query  

i.e. when I run the query script and then do "ifconfig can0" to check the interface packet counters, I see the TX Packets

increment by one packet and RX Packets increment by two packets for each time I run the script. 


root@octoPizzle2:~ # ifconfig can0

can0: flags=193<UP,RUNNING,NOARP>  mtu 16

        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 128  (UNSPEC)

        RX packets 28  bytes 209 (209.0 B)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 17  bytes 13 (13.0 B)

        TX errors 1  dropped 1 overruns 0  carrier 1  collisions 0


I even ran tcpdump on the can0 interface and see actual packets 'on the wire'.   

Note, I verified the packets are indeed coming back from the HermitCrab controller by running the packet capture with the HC connected and with it disconnected.   When it is disconnected I only see a single packet go out with the request but when it is connected, I see the additional return packets, as expected... yet they do not show up in the query script output


With the HermitCrab disconnected:

pi@octoPizzle2:~/klipper $ sudo tcpdump -i can0

tcpdump: verbose output suppressed, use -v or -vv for full protocol decode

listening on can0, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes



        0x0000:  f003 0000 0100 0000 0000 0000 0000 0000  ................ (this is the broadcast for other devices on the bus)


With the HermitCrab connected:

pi@octoPizzle2:~/klipper $ sudo tcpdump -i can0

tcpdump: verbose output suppressed, use -v or -vv for full protocol decode

listening on can0, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes



        0x0000:  f003 0000 0100 0000 0000 0000 0000 0000  ................


        0x0000:  187f ef87 0800 0000 dfdf ffdf ddfc 1f1d  ................   (These are packets back from the Hermit)


        0x0000:  f003 0000 0100 0000 0000 0000 0000 0000  ................


        0x0000:  f903 0040 0700 0000 303f 677f f71b 7600  ...@....0?g...v. 

I have tried changing the speed from the recommended 250000 to 115200 to see if a lower speed would help and I tried both 8MHz and 12 MHz for the reference oscillations, without any improvement.  


So, as far as I can tell from dmesg, ifconfig, etc… the canbus driver is initializing properly, the interface comes up without error and everything looks like it is working… it just fails to ever show there is anything else on the canbus, even when there are packets coming back from another device on the canbus. 


It seems like the packets the HermitCrab is sending back may be corrupted but I have no way of proving that as I can’t decode the canbus traffic.


I am not sure where to go next, troubleshooting wise, in order to get the HermitCrab talking with my other devices on the canbus so any suggestions or assistance would be greatly appreciated.


Thank you in advance for your assistance!

Link to comment
Share on other sites

  • 3 months later...
  • Administrators
On 6/26/2022 at 7:14 PM, Raymond said:

Have the same problem. Did you ever figure this out?


If you have any product issues, please submit a request and we will arrange for an engineer to communicate with you as soon as possible.

Click on the top navigation "Submit a request" or Please click

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...