# Anycybic I3 Mega/orangepi zero 3/ adxl345/ i2c

**URL:** <https://klipper.discourse.group/t/anycybic-i3-mega-orangepi-zero-3-adxl345-i2c/10868>\
**Category:** General Discussion\
**Created:** [October 7, 2023, 4:13pm UTC](https://klipper.discourse.group/t/anycybic-i3-mega-orangepi-zero-3-adxl345-i2c/10868 "2023-10-07T16:13:59Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![snakesanti](https://avatars.discourse-cdn.com/v4/letter/s/3ec8ea/32.png) [@snakesanti](https://klipper.discourse.group/u/snakesanti)\
**Post date:** [October 7, 2023, 4:13pm UTC](https://klipper.discourse.group/t/anycybic-i3-mega-orangepi-zero-3-adxl345-i2c/10868/1 "2023-10-07T16:13:59Z")

</div>

### Basic Information:

Printer Model:  
 MCU / Printerboard:  
 `klippy.log`

Hi. Im driving crazy with this. Im absolutely new in linux and pi boards, but know about electronics. I’ve asked and searched as much as i could, but not able to make it run, so came here.

1. I connected 4 wires correctly between both boards (+3.3/gnd/sda/scl).
2. I followed instructions from manual to activate i2c ports, and installed all manual says.
3. i2cdetect -y 3 answers fine: 0x53
4. Now comes my crazynest. Into klipper, dont know wtf put on adxl345.cfg file. tried a lot of variants useless.  
nearest one is:  
[adxl345]  
cs\_pin:None  
[resonance\_tester]  
accel\_chip: adxl345  
probe\_points: 100, 100, 20  
At least, that one lets mcu connect and klipper dont give an y error…  
But when asking accelerometer\_query, i obtain Invalid adxl345 id (got 0 vs e5).  
Dont know what to do, all info I find is for raspbery, spi connection and is not useful for me…  
Need some expert here!  
Thanks ans sorry for my english  
[klippy.log](https://klipper.discourse.group/uploads/short-url/zaJlZh3ejxVFljQPybOrmkt7tY6.log) (1.4 MB)

---

<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:** [October 8, 2023, 4:03pm UTC](https://klipper.discourse.group/t/anycybic-i3-mega-orangepi-zero-3-adxl345-i2c/10868/2 "2023-10-08T16:03:24Z")

</div>

See [Measuring Resonances - Klipper documentation](https://www.klipper3d.org/Measuring_Resonances.html#configure-adxl345-with-rpi)

The ADXLs are extremely sensitive about the cable. An Ethernet cable Cat 5e is recommended using the wiring as described in [wiring](https://www.klipper3d.org/Measuring_Resonances.html#wiring)

---

<div class="post-metadata">

**Author:** ![snakesanti](https://avatars.discourse-cdn.com/v4/letter/s/3ec8ea/32.png) [@snakesanti](https://klipper.discourse.group/u/snakesanti)\
**Post date:** [October 9, 2023, 1:09pm UTC](https://klipper.discourse.group/t/anycybic-i3-mega-orangepi-zero-3-adxl345-i2c/10868/3 "2023-10-09T13:09:03Z")

</div>

Hi  
Frst…thanks for answering!  
I am pretty sure wiring is not the problem. Distance is really short, wires are good quality ones, and they are solded in both boards to avoid false contacts.  
I’m having issues with " [RPi microcontroller - Klipper documentation (klipper3d.org)](https://www.klipper3d.org/RPi_microcontroller.html)", that commands are written to use it on rasp, nor orange. I could do almost all, varying routes as needed, and obtain a (i think) correct mcu at route “/usr/local/bin/klipper\_host\_mcu”  
So, I write it on axl345.cfg on [mcu pi] part as serial: /usr/…mcu  
Klipper amswers with a “cant conect to printer…”  
So I suppose i need to go with next step on guide:  
If klippy.log reports a “Permission denied” error when attempting to connect to `/tmp/klipper_host_mcu` then you need to add your user to the tty group. The following command will add the “pi” user to the tty group:

```auto
sudo usermod -a -G tty pi

```

But that step is not working with orangepi neither.  
Im driving myself crazy with this  
Dont know were the problem should be

---

<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:** [October 9, 2023, 1:30pm UTC](https://klipper.discourse.group/t/anycybic-i3-mega-orangepi-zero-3-adxl345-i2c/10868/4 "2023-10-09T13:30:46Z")

</div>

> [@snakesanti](#):
>
> I am pretty sure wiring is not the problem.

I read this statement all too often. I have warned you

> [@snakesanti](#):
>
> If klippy.log reports a “Permission denied” error when attempting to connect to `/tmp/klipper_host_mcu` then you need to add your user to the tty group. The following command will add the “pi” user to the tty group:

If you are not using the Pi then you will have to fight this through yourself.

- The steps needed to get SPI up and running depends on the distribution you are using → Refer to the OPi documentation
- The success rate with this depends on how well the board manufacturer implemented this in his distribution
- All commands involving a username of course needs to be tailored to your actual user, e.g.`sudo usermod -a -G tty pi` → `sudo usermod -a -G tty <my_actual_username_here>`
- Etc

If you do not feel like digging this deep into it, I’d recommend to get a Raspberry Pi Pico and connect the ADXL there. A complete instruction is in the official documentation.

---

<div class="post-metadata">

**Author:** ![rvdr](https://avatars.discourse-cdn.com/v4/letter/r/b9e5f3/32.png) [@rvdr](https://klipper.discourse.group/u/rvdr)\
**Post date:** [December 6, 2023, 4:36pm UTC](https://klipper.discourse.group/t/anycybic-i3-mega-orangepi-zero-3-adxl345-i2c/10868/5 "2023-12-06T16:36:37Z")

</div>

Did you get it to work? Im getting the same “Invalid adxl345 id (got 0 vs e5).” error on my orange pi zero 3.  
I even used an CAT 6 cable, used the official wiki to get the correct orangepi-config and so on. Im considering to either get a Pi Pico or a new sensor, as already put far more time into it than I should

---

<div class="post-metadata">

**Author:** ![hcet14](https://avatars.discourse-cdn.com/v4/letter/h/ecd19e/32.png) [@hcet14](https://klipper.discourse.group/u/hcet14)\
**Post date:** [December 6, 2023, 5:07pm UTC](https://klipper.discourse.group/t/anycybic-i3-mega-orangepi-zero-3-adxl345-i2c/10868/6 "2023-12-06T17:07:50Z")

</div>

> [@Fysetc portable input shaper adxl345: spi must be on same muc](https://klipper.discourse.group/t/fysetc-portable-input-shaper-adxl345-spi-must-be-on-same-muc/11938/7):
>
> Understand. I’ll check and reply if working or not. Why their default file like this i don’t know…

matanel83 had similar problems.

Good luck, hcet14

---

<div class="post-metadata">

**Author:** ![snakesanti](https://avatars.discourse-cdn.com/v4/letter/s/3ec8ea/32.png) [@snakesanti](https://klipper.discourse.group/u/snakesanti)\
**Post date:** [December 6, 2023, 5:40pm UTC](https://klipper.discourse.group/t/anycybic-i3-mega-orangepi-zero-3-adxl345-i2c/10868/7 "2023-12-06T17:40:18Z")

</div>

No. Noway…i let that on a storage and forget allí baout that…Lost too much time and didnt get It work…  
Orangepizero3 IS different,uses different routes, and you have to know well how Linux, SSH and that boards work, because you cannot follow nay step by step guide.  
I recommend you to buy nay adxl with an USB interface, It Will be the easiest way, i suppose.

---

<div class="post-metadata">

**Author:** ![LifeOfBrian](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/lifeofbrian/32/2380_2.png) [@LifeOfBrian](https://klipper.discourse.group/u/LifeOfBrian)\
**Post date:** [December 6, 2023, 6:18pm UTC](https://klipper.discourse.group/t/anycybic-i3-mega-orangepi-zero-3-adxl345-i2c/10868/8 "2023-12-06T18:18:14Z")

</div>

This is no rocket science!  
I had an ADXL345 working with my OrangePi Zero. The only problem was getting Numpy installed. Therefor the RAM of the OPi was too small and had to be outsourced to the SD card into a temporary RAM file. This worked though it took ages… 😃

---

<div class="post-metadata">

**Author:** ![snakesanti](https://avatars.discourse-cdn.com/v4/letter/s/3ec8ea/32.png) [@snakesanti](https://klipper.discourse.group/u/snakesanti)\
**Post date:** [December 6, 2023, 6:50pm UTC](https://klipper.discourse.group/t/anycybic-i3-mega-orangepi-zero-3-adxl345-i2c/10868/9 "2023-12-06T18:50:02Z")

</div>

Sure ir isnt…bu i was not capoable to make It work.  
First time i read about Numpy…what the hell IS that?  
I think my problem IS dont know anything about Linux or ssh…  
Anyway, i have surrender about that and made printing tests…

---

<div class="post-metadata">

**Author:** ![snakesanti](https://avatars.discourse-cdn.com/v4/letter/s/3ec8ea/32.png) [@snakesanti](https://klipper.discourse.group/u/snakesanti)\
**Post date:** [December 6, 2023, 6:50pm UTC](https://klipper.discourse.group/t/anycybic-i3-mega-orangepi-zero-3-adxl345-i2c/10868/10 "2023-12-06T18:50:46Z")

</div>

And in my case, RAM IS not a problem, mine IS a 2gb

---

<div class="post-metadata">

**Author:** ![rvdr](https://avatars.discourse-cdn.com/v4/letter/r/b9e5f3/32.png) [@rvdr](https://klipper.discourse.group/u/rvdr)\
**Post date:** [December 6, 2023, 8:21pm UTC](https://klipper.discourse.group/t/anycybic-i3-mega-orangepi-zero-3-adxl345-i2c/10868/11 "2023-12-06T20:21:46Z")

</div>

Everything installed without a problem on my side.  
What I did so far:  
Activated ph-i2c2 and spi1-cs0-spidev under orangepi-config  
Added i2c-dev and spi-dev in /etc/modules

My printer.cfg:

> Blockquote  
> [mcu rpi]  
> serial: /tmp/klipper\_host\_mcu  
> [adxl345]  
> cs\_pin: rpi:None  
> spi\_speed: 488000  
> spi\_bus:spidev1.1  
> [resonance\_tester]  
> accel\_chip: adxl345  
> probe\_points:  
> 100, 100, 20 # an example

Under /boot/orangepiEnv.txt I added

> Blockquote  
> param\_spidev\_spi\_bus=0  
> param\_spidev\_max\_freq=488000

Installed numpy:

> Blockquote  
> sudo apt install python3-numpy python3-matplotlib libatlas-base-dev  
> ~/klippy-env/bin/pip install -v numpy

Followed the [mcu](https://www.klipper3d.org/RPi_microcontroller.html) guide

Installed dependecies

> Blockquote  
> sudo apt-get install python3-dev python3-pip python3-smbus i2c-tools libi2c-dev  
> sudo apt install python3-numpy python3-matplotlib libatlas-base-dev python3-spidev

And still getting a “Invalid adxl345 id (got 0 vs e5).” error

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/klipper/original/1X/64419bf2aac6639e6ef5cef200dcd456b0a01ac3.png) [@system](https://klipper.discourse.group/u/system)\
**Post date:** [February 4, 2024, 8:22pm UTC](https://klipper.discourse.group/t/anycybic-i3-mega-orangepi-zero-3-adxl345-i2c/10868/12 "2024-02-04T20:22:08Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
