klipper and BBB+Cramps: tcflush: Inappropriate ioctl for device

When Klipper try to connect mcu, log file shows this error:
mcu ‘mcu’: Starting connect
Got error -1 in tcflush: (25)Inappropriate ioctl for device
cu ‘mcu’: got {‘count’: 40, ‘#receive_time’: 32403.603865071, ‘#name’: ‘identify’, ‘#sent_time’: 0.0, ‘offset’: 0}
mcu ‘mcu’: got {‘count’: 40, ‘#receive_time’: 32403.615771612, ‘#name’: ‘identify’, ‘#sent_time’: 0.0, ‘offset’: 0}

You have not really given any useful information here.

However this is Klipper giving an error. Have you tried their discord group ? Do they have user forums ?

This is a bit like posting on a Microsoft forum asking why Firefox crashes.

1 Like

Yes, I have already asked in a Klipper forum, and they suggested that perhaps the error depends on a specific port configuration for the BeagleBone.
Klipper is programmed in Python, and I was hoping that someone, even in different situations, had found instructions that generate ‘tlflush’ and ‘inappropriate ioctl’ errors. If I am suggested a solution to the problem, maybe I can correct the programming…
I also asked on the CRAMPS2.2 forum (since the communication is between the BeagleBone Black and the CRAMPS shield), but it is not a widely used board, and usually it is used with Machinekit (with which I did not have these problems).
I think it’s a good approach to ask multiple communities when you encounter errors involving different components (Klipper, CRAMPS, Beaglebone…): since the error could potentially be caused by any of these components, seeking help from all relevant forums can increase chances of finding a solution. Collaborating with different communities and getting input from users with various experiences can lead to valuable insights and potential solutions to the issue you’re facing!
Unfortunately I don’t have much experience with Beaglebone, but if you tell me what information can help comunity tounderstand the problem, I certainly will it.

Will need to know at least the Debian OS version.

Looking at the Klipper website that say to use Debian 9.9 That could be a problem, not sure it is even supported anymore.

In a console you could try running (drop sudo if logged in a s root)

sudo beagle-version

If it says command not found then try

sudo apt update
sudo apt install bb-beagle-version

However is the board is running Debian 9.9 that may well fail.

When setting all of this up, did you follow any sort of guide ?

Now i’ll try to run “sudo apt install bb-beagle-version”, i’ll never install it before :pensive:

I used Debian 10.13, because using 9.9 there are some problems with library.
I can’t find a “total” guide: basically I use this:

…but it doesn’t create /dev/rpmsg_pru30 and /dev/rpmsg_pru31 (solved with Debian 10.13) .
I use Python 2.7 instead of 3.x because the latest version is for Octoprint (but I preferred Fluidd that is lighter). Also /boot/uEnv.txt needed additional lines to work fine (uboot_overlay_pru=AM335X-PRU-UIO-00A0.dtbo). Also gcc-avr had to be removed , because of incompatibility with gcc-pru

1 Like

My first guessis thatthe pru firmware is not being loaded.

I think also there was a change.in the kernel as to how it handled the pru. I am not sure exactly when thia occurred @RobertCNelson would probably bw able to say. If the code is relying on the old way, then this could also be your problem.

I will have a look at the klipper code when i get time to see if there are any clues there.

Have tou tried searching Google for the error message?

The pru works (althought at first there was a lot of problems, now there both /dev/rpmsg30 and /dev/rpm31 are present)… testing with a script, the response is:
Running application:
Message received from PRU_0: hello world_0!

Message received from PRU_1: hello world_1!
Looking for a solution, someone wrote that klipper use a baud rate of 250000, and some boards have problem, but Beaglebone has to work well because the baud rate is pre-setting in klipper and different values are not present… so you can’t change it.
Thanks for all!

1 Like