Mangoh Yellow - Magnetometer Not Connected?

Hi guys,

I’m having some issues getting data from the built in magnetometer on the MangOH yellow. According to the sample app, the sys interface implemented by the kernel module should be here:

/sys/bus/i2c/devices/6-0010/iio:device1/

However, this directory does not exist. Any ideas why this would be? The accelerometer/gyroscope directory exists and that’s working fine.

-Nick

In some earlier development versions of mangoH Yellow, the magnetometer was connected to the same i2c bus as the accelerometer. In the final version the magnetometer was placed on an i2c bus that downstream of the bmi160 accelerometer. The bmi160 can simultaneously act as an i2c slave to the WP module and an i2c master to the magnetometer. I think this theoretically offloads some work from the WP’s CPU and allows for accelerometer and magnetometer readings that are nicely correlated, but this requires some additional driver work that hasn’t been done yet.

This is the latest version of the upstream driver for the bmi160 and if you search around you can find some references to the magnetometer, but it’s not implemented. I would like to implement this, but I’m not sure if/when I will have time.

Thanks for the response!

I must have missed that in the schematic. I have decided to just talk to the BMI160/BMM150 from userland I2C for now, and I’ve got it working.

One other question for you, if you don’t mind. I can make another thread for this one, but I’m trying to figure out how to read from ADC0 on the IOT Expansion header, but not exactly sure how. I did some digging and didn’t find any sort of /sys kernel interface for that kind of stuff. Any guidance there?

-Nick

You can see the code for ADC reading here. It was done for mangoh red but will apply for yellow as well:

For the magnetometer, can you let us know your use case? If there is a widepsread use case, then we can put the right resources on it.

I am the Lead Embedded engineer for Atmosphere IoT and we are currently working on adding support for the MangOH yellow into our platform, which is a drag-and-drop IDE/Cloud Solution. Just trying to make sure all the sensors and various peripherals work.

Feel free to send me a PM if you’d like to talk more!

Just getting around to trying the ADC, I’ll let you know how that goes.

Another question: Userland SPI support. I see the IoT header has a few SPI pins on it. Can I get to those? I don’t see any spidev devices.

Thanks for the help,
Nick

Also is there hardware PWM support on anything except for the Buzzer? Ideally some pins on the IoT expansion header.

For spidev automatically showing up, we will update firmware to make that happen.

There is no hardware PWM as it is not supported on the module. I will send you a PM for further discussions.

Cool thanks for the help! This is a nifty little board for sure.

Nick