USB ADXL345 serial problem

Basic Information:

Printer Model: Ender3, Orange Pi Zero 2
MCU / BTT E3 mini V3,
klippy (2).log (190.4 KB)

I’m trying to setup a Fly USB ADXL345 on an Orange Pi Zero 2. I’ve Followed the instructions on the manufactures Github and despite that :laughing: I’ve gotten the firmware loaded on it. I used their config for it and modified it correctly, I think, but when I start Klipper I get “Option ‘serial’ in section ‘mcu’ must be specified” though it is configured. So what have I missed?
TIA

Fill out above information and in all cases attach your klippy.log file (use zip to compress it, if too big). Pasting your printer.cfg is not needed
Be sure to check our “Knowledge Base” Category first. Most relevant items, e.g. error messages, are covered there

Describe your issue:

Please try again to upload the klippy.log.

You solidly messed up your configuration:

You deleted your main [mcu] section, I guess it was:

[mcu]
serial = /dev/serial/by-id/usb-Klipper_stm32g0b1xx_300034001950344D30363620-if00

You added something that looks like:

[mcu adxl]
usb_id = /dev/serial/by-id/usb-Klipper_rp2040_12345-if00
serial = /dev/serial/by-id/usb-Klipper_rp2040_12345-if00

You need to:

  • Keep your orginal [mcu] setting
  • Add your ADXL looking like:
[mcu fly_adxl]
serial: /dev/serial/by-id/usb-Klipper_rp2040_E6625887D37E3234-if00

[adxl345]
cs_pin: fly_adxl:gpio9
spi_software_sclk_pin: fly_adxl:gpio10
spi_software_mosi_pin: fly_adxl:gpio11
spi_software_miso_pin: fly_adxl:gpio12
rate: 3200
axes_map: y,x,z

[resonance_tester]
accel_chip: adxl345
probe_points: 117,123,50

[static_digital_output]
pins: fly_adxl:gpio23
  • In [mcu fly_adxl] use your own serial address that you obtained via ls /dev/serial/by-id/* after flashing the proper firmware to the board
  • Adapt the probe point to your setup

Well, I knew something was amiss but didn’t think I hosed it THAT bad. That’s what I get for trying to follow directions that are partly in Chinese. Most was copy & pasted from their web site. Not sure why I took out the original [mcu]. but that definetly makes sense since now there’s 2 mcu’s. I should have deduced that from the error message.

One thing that confused me was which to use, [usb] or serial: so that clears that up.
One other question (edited, OK now 2), “fly_adxl” for the pins could be anything as long as it matches what is in [mcu] correct?
What does the [static_digital_output] do?
Again, your advice is much appreciated.

OK.
klippy (1).log (117.7 KB)

klippy (1).log (794.0 KB)

OK, I’ve solved this issue by using an older functioning backup and adding any ADXL related settings manually. I think something got messed up with all the cutting and pasting. I was getting pin must be defined errors for pins that as far as I could tell were defined. Now no errors loading the config file but I’m getting this:
MCU Protocol error
This is frequently caused by running an older version of the
firmware on the MCU(s). Fix by recompiling and flashing the
firmware.

Your Klipper version is: v0.12.0-132-ge37b007f
MCU(s) which should be updated:
mcu: Current version v0.12.0-124-g09a78c31
fly_adxl: Current version v0.11.0-275-g8ef0f7d7

And:mcu ‘fly_adxl’: Command format mismatch: query_adxl345 oid=%c rest_ticks=%u vs query_adxl345 oid=%c clock=%u rest_ticks=%u

So I went through the whole flashing process over again successfully for the ADXL and I think the printer since there’s no indication when the firmware is loaded from the SD card. But I get the exact same message, same firmware versions.
I’m totally confused.

The firmware part on your ADXL board is too old. You need to build a new one a reflash it.
Follow Measuring Resonances - Klipper documentation

How is it possible for it to be outdated when I had flashed it just 2 days prior? I have built/reflashed it twice and get the same error down to the firmware versions. I thought of wiping the MCU before reflashing it but I don’t know how.

Did you really flash the ADXL or your main board?
According to the error message, your fly_adxl is still on v0.11

If the way as described in the above link is not working, you can try the solution described here: Raspberry Pi Pico + ADXL345: Portable resonance measurement

Yes, fly_adxl is an arbitrary name. You can replace each occurrence with something else.

This sets a specific pin on the RPi Pico MCU that turns off its power saving mode. This leads to a cleaner voltage supply and better readings of the ADXL values.

I found an alternate method to flash it similar to the one you linked to and was going to try it but I was unable to find the klipper.uf2 file anywhere.

Any special reason, why you do not simply follow the instruction I have linked? It contains all information, including where to find the uf2 file

I was just remarking on the similar processes , I haven’t had a chance to do anything about it yet. Going to check it out shortly.

This is what I was referring to. klipper.uf2 isn’t in the /out directory or anywhere else when I searched for it.

pi@octopi:~/klipper$ sudo mount /dev/sda1 /mnt
[sudo] password for pi:
pi@octopi:~/klipper$ sudo cp out/klipper.uf2 /mnt
cp: cannot stat ‘out/klipper.uf2’: No such file or directory
pi@octopi:~/klipper$

pi@octopi:~/klipper$ ls -a out
** board-generic compile_time_request.o klipper.elf**
board-link compile_time_request.txt lib
autoconf.h compile_time_request.c klipper.bin src
board compile_time_request.d klipper.dict
pi@octopi:~/klipper$

When you upload code snippets, please use the Preformatted Text feature of the forum editor, so that no information gets lost.

Format

Thanks, good to know

pi@octopi:~/klipper$ sudo mount /dev/sda1 /mnt
[sudo] password for pi:
pi@octopi:~/klipper$ sudo cp out/klipper.uf2 /mnt
cp: cannot stat 'out/klipper.uf2': No such file or directory

pi@octopi:~/klipper$ ls -a out
.           board-generic           compile_time_request.o    klipper.elf
..          board-link              compile_time_request.txt  lib
autoconf.h  compile_time_request.c  klipper.bin               src
board       compile_time_request.d  klipper.dict
pi@octopi:~/klipper$

Ah, your right much better!

1 Like

Then it is highly likely that you did not set the correct parameters during make menuconfig.
To avoid that you try again with some messed settings issue make distclean and then make menuconfig. Make sure your settings look like as in the screenshot.

Here’s the lastest: IT WORKS!!! No errors, printer works as it should and

10:37:50 AM 
$ ACCELEROMETER_QUERY
10:37:51 AM 
// accelerometer values (x, y, z): -5847.626942, -370.102971, 7354.516781

Hopefully these numbers are appropriate for it sitting on the bench. On to the next project, a touch screen, when that’s working I’ll get into the resonance testing so you probably haven’t heard the last from me.
Thanks for the help, I learned a lot but still have a long way to go.

1 Like

Glad that you got it sorted.

I hope this is not a threat :wink:

Oh it definetly is. :grin: