Setting up ADXL345 on orange pi lite 2

Hi Community !

I am trying to setup the ADXL345 on my orange pi lite 2 (arm64) on which Klipper is running and would need help with the settings since all the examples are related to an external RPI/MCU but could not figure out how I would define the connection/pins to the local ADXL345 connected over the CON12 connector SPI pins.

Sorry I did not provide a klippy log but I am not even at the stage where I have anything configured but just physically wired which is not likely to popup on klipper log yet.

Could you please help ?

Thanks in advance,
Rafik

You will want to use following pins on the Organge Pi:

ADXL345 Pin Organge Pi Pin
3.3V VCC CON12-P01
GND CON12-P06
CS CON12-P24
SDO CON12-P21
SDA CON12-P19
SCL CON12-P23

Hi @Sineos,

Thank you for your help, I had the wiring right however what I am looking for is the config file settings like:

[mcu rpi]
serial: /tmp/klipper_host_mcu

[adxl345]
cs_pin: rpi:None

Would this be correct since both Klipper and the ADXL345 are connected/running on the same orange pi ?

I do not see a /tmp/klipper_host_mcu socket on my orange pi so I was wondering how to talk to the sensor and define the con12 pins so they are known to Klipper to access over SPI ?

Thanks,
Rafik

Make sure to have followed klipper/RPi_microcontroller.md at master · KevinOConnor/klipper · GitHub

What is the output of ls -al /tmp?

Hi @Sineos,

Thank you for pointing me in the right direction, I missed on the using the board as a second MCU bit.

I have deployed the klipper_mcu service however it does create a PID file but exits straight away hence why I do not have a /tmp/klipper_host_mcu

I looked up the pid in the PID file and it is not in my process list.

running /usr/local/bin/klipper_mcu --background --pidfile /var/run/klipper_mcu.pid -r
manually I get an ‘illegal instruction’ with exit 132 and same running the binary without arguments.

So it seem after all that klipper_mcu has instructions that are not supported by my platform Allwinner H6 even if it has been compiled locally.

I will switch to an RPI for now to validate my sensor setup works there and probably back to my orange pi to raise a bug in Klipper.

Many thanks,
Rafik

Did you ever get this sorted as I have it running on a OrangePi 4 running armbian, followed by klipper installation via KIAUH installer.
I did go through downloading several libraries to trick the software into thinking it was running on a Rpi,( WiringPi and OPi.GPIO, but they didnt help).
The missing piece was SPI-DEV , heres a useful installation Guide for armbian :- Orange Pi I2C & SPI Setup (Orange Pi I2C & SPI Setup | neonaut)

1 Like

hi i have orange pi zero H2+ and orange pi one can i run klipper input shaper with adxl345 like in rpi?

Hi @No_Understanding,

Thank you for providing the instruction !

@madorax251 I never got to finalise my setup as I have been away from home for months.

Thanks,
Rafik

i have successfully run klipper input shaper with adxl345 but i connect ny on the printer mcu board. i tried with gpio pin on orange pi it didn’t work

Hi take a look at

The last section is about getting spi to work with adxl345.

Basically we have to switch on spi, set the environment.

Then klipper standard python numpy & matplotlib wouldn’t work on my version of armbian so I had to use python3, your version maybe different.

It’s my first time on GitHub so it’s a mess, if you get any questions, I’ll help where I can but I only have access to orangey. Zero & orangepi4. But most of the problems are down to naming, or armbian vs raspbian.

Hi I haven’t got round to running my zero with the adxl345 yet, but this is my notes for the orange pi 4.

I should imagine it’s either the spi not being enabled, or opi.gpio library and point it to correct pins. Or it may need wiringop library to translate pins.

I tended to use SHAPER_CALIBRATE AXIS=X on the O’pi 4, it takes the guess work out. But if the zero struggles you can save the raw data and process it on a PC.

I’m going to get one of the raspberry pi zero 2 when available sounds the Same as an orange zero only we have to mess about with libraries and work arounds.

@No_Understanding on your notes you have 2 pin 23 or those jumped together ? or a typo error

pin 23 SPI1_CLK scl

pin 23 SPI1_CS cs

EDIT: I think you meant 24 SPI1_CS cs