# Setting up ADXL345 on orange pi lite 2

**URL:** <https://klipper.discourse.group/t/setting-up-adxl345-on-orange-pi-lite-2/168>\
**Category:** General Discussion\
**Created:** [April 21, 2021, 8:38am UTC](https://klipper.discourse.group/t/setting-up-adxl345-on-orange-pi-lite-2/168 "2021-04-21T08:38:44Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![rafik](https://avatars.discourse-cdn.com/v4/letter/r/9d8465/32.png) [@rafik](https://klipper.discourse.group/u/rafik)\
**Post date:** [April 21, 2021, 8:38am UTC](https://klipper.discourse.group/t/setting-up-adxl345-on-orange-pi-lite-2/168/1 "2021-04-21T08:38:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Sineos](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/sineos/32/18_2.png) [@Sineos](https://klipper.discourse.group/u/Sineos)\
**Post date:** [April 21, 2021, 11:27am UTC](https://klipper.discourse.group/t/setting-up-adxl345-on-orange-pi-lite-2/168/2 "2021-04-21T11:27:50Z")

</div>

![grafik](https://global.discourse-cdn.com/free1/uploads/klipper/original/1X/387f055866170b53c7a0f4a2b0aa6c3d17d63017.jpeg)

> **[Measuring Resonances](https://www.klipper3d.org/Measuring_Resonances.html)**
>
> Klipper is a 3d-printer firmware

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 |

---

<div class="post-metadata">

**Author:** ![rafik](https://avatars.discourse-cdn.com/v4/letter/r/9d8465/32.png) [@rafik](https://klipper.discourse.group/u/rafik)\
**Post date:** [April 21, 2021, 12:00pm UTC](https://klipper.discourse.group/t/setting-up-adxl345-on-orange-pi-lite-2/168/3 "2021-04-21T12:00:06Z")

</div>

Hi @Sineos,

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

```auto
[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

---

<div class="post-metadata">

**Author:** ![Sineos](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/sineos/32/18_2.png) [@Sineos](https://klipper.discourse.group/u/Sineos)\
**Post date:** [April 21, 2021, 12:21pm UTC](https://klipper.discourse.group/t/setting-up-adxl345-on-orange-pi-lite-2/168/4 "2021-04-21T12:21:21Z")

</div>

Make sure to have followed [klipper/RPi\_microcontroller.md at master · KevinOConnor/klipper · GitHub](https://github.com/KevinOConnor/klipper/blob/master/docs/RPi_microcontroller.md)

What is the output of `ls -al /tmp`?

---

<div class="post-metadata">

**Author:** ![rafik](https://avatars.discourse-cdn.com/v4/letter/r/9d8465/32.png) [@rafik](https://klipper.discourse.group/u/rafik)\
**Post date:** [April 21, 2021, 3:25pm UTC](https://klipper.discourse.group/t/setting-up-adxl345-on-orange-pi-lite-2/168/5 "2021-04-21T15:25:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![No\_Understanding](https://avatars.discourse-cdn.com/v4/letter/n/77aa72/32.png) [@No\_Understanding](https://klipper.discourse.group/u/No_Understanding)\
**Post date:** [July 11, 2021, 12:21am UTC](https://klipper.discourse.group/t/setting-up-adxl345-on-orange-pi-lite-2/168/6 "2021-07-11T00:21:08Z")

</div>

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](https://neonaut.neocities.org/blog/2018/orange-pi-i2c-spi-setup.html))

---

<div class="post-metadata">

**Author:** ![madorax251](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@madorax251](https://klipper.discourse.group/u/madorax251)\
**Post date:** [August 18, 2021, 4:05pm UTC](https://klipper.discourse.group/t/setting-up-adxl345-on-orange-pi-lite-2/168/7 "2021-08-18T16:05:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rafik](https://avatars.discourse-cdn.com/v4/letter/r/9d8465/32.png) [@rafik](https://klipper.discourse.group/u/rafik)\
**Post date:** [August 18, 2021, 5:28pm UTC](https://klipper.discourse.group/t/setting-up-adxl345-on-orange-pi-lite-2/168/8 "2021-08-18T17:28:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![madorax251](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@madorax251](https://klipper.discourse.group/u/madorax251)\
**Post date:** [September 9, 2021, 6:03pm UTC](https://klipper.discourse.group/t/setting-up-adxl345-on-orange-pi-lite-2/168/9 "2021-09-09T18:03:24Z")

</div>

> [@madorax251](#):
>
> klipper input shaper

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

---

<div class="post-metadata">

**Author:** ![No\_Understanding](https://avatars.discourse-cdn.com/v4/letter/n/77aa72/32.png) [@No\_Understanding](https://klipper.discourse.group/u/No_Understanding)\
**Post date:** [October 30, 2021, 9:33am UTC](https://klipper.discourse.group/t/setting-up-adxl345-on-orange-pi-lite-2/168/10 "2021-10-30T09:33:35Z")

</div>

Hi take a look at

> **[GitHub - benjjyman/klipper-orangepi4-Kiauh: Klipper on orangepi 4 using...](https://GitHub.com/benjjyman/klipper-orangepi4-Kiauh)**
>
> Klipper on orangepi 4 using Kiauh, documentation of changes needed . work in progress - GitHub - benjjyman/klipper-orangepi4-Kiauh: Klipper on orangepi 4 using Kiauh, documentation of changes neede...

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.

---

<div class="post-metadata">

**Author:** ![No\_Understanding](https://avatars.discourse-cdn.com/v4/letter/n/77aa72/32.png) [@No\_Understanding](https://klipper.discourse.group/u/No_Understanding)\
**Post date:** [October 30, 2021, 9:00pm UTC](https://klipper.discourse.group/t/setting-up-adxl345-on-orange-pi-lite-2/168/11 "2021-10-30T21:00:58Z")

</div>

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

> **[GitHub - benjjyman/klipper-orangepi4-Kiauh: Klipper on orangepi 4 using...](https://github.com/benjjyman/klipper-orangepi4-Kiauh)**
>
> Klipper on orangepi 4 using Kiauh, documentation of changes needed . work in progress - GitHub - benjjyman/klipper-orangepi4-Kiauh: Klipper on orangepi 4 using Kiauh, documentation of changes neede...

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.

---

<div class="post-metadata">

**Author:** ![carl1961](https://avatars.discourse-cdn.com/v4/letter/c/a88e57/32.png) [@carl1961](https://klipper.discourse.group/u/carl1961)\
**Post date:** [May 26, 2022, 10:53am UTC](https://klipper.discourse.group/t/setting-up-adxl345-on-orange-pi-lite-2/168/12 "2022-05-26T10:53:25Z")

</div>

> [@Sineos](#):
>
> ls -al /tmp

@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

---

<div class="post-metadata">

**Author:** ![EddyMI3D](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/eddymi3d/32/1981_2.png) [@EddyMI3D](https://klipper.discourse.group/u/EddyMI3D)\
**Post date:** [August 10, 2024, 7:34pm UTC](https://klipper.discourse.group/t/setting-up-adxl345-on-orange-pi-lite-2/168/13 "2024-08-10T19:34:54Z")

</div>


