Can't detect / use lis3mdl magnetometer on Ras pi

HI,
I have a raspberry pi mounted to a Pimoroni display (PIM579) and I want to use my magnetometer (ADA4479) in a python program. However I can’t find any documentation anywhere, I’ve tried running some examples from this lis2mdl GitHub but with no Luck. I’ve tried using i2cdetect but it says there is no i2c in dev/…
I have tried i2cdetect -l and got i2c-11, i2c, i2c@0 and i2c adaptor but I don’t know what any of them means. The green on light is lit up so I know the module is getting power at least.

I can’t debug through the regular pins since I bought it specifically to work through the screen. I also plan on using a acell+gyro alongside (ADA3886) but I have the same problem.

Please. Anyone. Ive been working on this project for ages and really want to get this up and running, not to sound like a brat but if anyone has done this please send me everything.

Thanks for reading.

edit: ive also tried going through this tutorial along with hyper pixels documentation

2 Likes

Hi Stephen,

It sounds like I2C might not be enabled, or still be using the I2C1 pins (with the Hyperpixel we’ll need to use I2C3 which has different pins).

First I’d check out this guide on enabling I2C on the Raspberry Pi .

Once you’ve confirmed that its enabled run the command
sudo ln -s /dev/i2c-3 /dev/i2c-1 from the terminal on the Pi to re-route any I2C assignments

Running I2C detect(i2cdetect -l without any modules plugged in and working should look like this:

And with modules like this, the specific number can change, as long as there are as many numbers as modules its working!

Let us know how you go!
Liam

2 Likes

I2C is enabled through sudo raspi-config

here’s a screenshot:

I am using ras pi buster but if you want me to try it on the newer bullseye let me know.

1 Like

You may have copy-pasted an invalid character. The hyphen/dash (“-”) looks like the longer one???

if you’re referring to the i2cdetect "-"y 1 it’s definitely the correct character?

:+1: