No adxl345 measurements found error

Hi,

the last couple of days I’ve been converting my printer from Reprapfirmware on a Duet 2 Wifi over to Klipper. Now everything is running, except I can’t get the ADXL345 accelerometer to work. I followed the tutorial, connected the ADXL to my RPI, enabled SPI in raspi_config and updated my printer.cfg. When I issue ACCELEROMETER_QUERY I do get an “!! No adxl345 measurements found” error. Checking with klippy.log it states:

API Dump Helper start callback error
Traceback (most recent call last):
  File "/home/pi/klipper/klippy/extras/motion_report.py", line 39, in _start
    self.startstop_cb(True)
  File "/home/pi/klipper/klippy/extras/adxl345.py", line 400, in _api_startstop
    self._start_measurements()
  File "/home/pi/klipper/klippy/extras/adxl345.py", line 352, in _start_measurements
    self.set_reg(REG_POWER_CTL, 0x00)
  File "/home/pi/klipper/klippy/extras/adxl345.py", line 267, in set_reg
    reg, val, stored_val))
CommandError: Failed to set ADXL345 register [0x2d] to 0x0: got 0xcb. This is generally indicative of connection problems (e.g. faulty wiring) or a faulty adxl345 chip.

I double checked my wiring, rebooted the PI, recompiled mcu firmwares for rpi and duet. No luck. When checking the ADXL from SSH with adxl345spi (GitHub - nagimov/adxl345spi: ADXL345 three-axis accelerometer reader (SPI interface)) I do receive valid data. So I assume my chip and wiring are generally okay.

I even tried to use an SPI port on the duet, but the problem persist.

Did I miss anything? Input shaper was a huge motivation to switch from reprapfirmware to klipper. I really would like to use the accelerometer.

Many thanks,
elims

Please post your klippy.log file

Let’s see if this is working. I was told by the bot that I first need to advance to level 1 before being granted the permission to upload files.

Here it should be:
klippy (2).log (54.3 KB)

See here: ADXL345 Invalid ID · Issue #3637 · KevinOConnor/klipper · GitHub

Such errors were found to be either:

  • Cable length / quality
  • Different GND potentials
  • Pull Ups on the ADXL board

Config-wise it seems OK, although you have some strange surplus line breaks, but they should not cause the issue:

[resonance_tester]
accel_chip = adxl345
probe_points = 
	100,90,20

@Sineos Many thanks. When building back from the duet I indeed had a wiring issue, which is fixed now. Running ACCELEROMETER_QUERY gives a reading now. I don’t know why it is working today. I’m not aware of any differences to yesterday.

Cable is roughly 80cm ribbon. Tests are running and *.csv got written.

1 Like