wellenvogel / esp32-nmea2000

nmea2000 gateway with ESP32
GNU General Public License v2.0
65 stars 30 forks source link

9-DoF IMU for Magnetic heading and boat heeling. #59

Open oxbown opened 1 year ago

oxbown commented 1 year ago

I´m planning to use my ICM-20948 to measure Magnetic heading and boat heeling. The sensor is i2c compatible, I use a cable to connect it to the M5atom groove port.

@wellenvogel do you think that is possible to add the sensor to the "GwIicTask"??

Library info: https://github.com/adafruit/Adafruit_ICM20X

Related N2k PNGs: PGN 127250 - Vessel Heading PGN 127571 - Attitude (Roll, Pitch, Yaw)

wellenvogel commented 1 year ago

Should not be that much of an issue... But I have no device for testing. And someone would need to write some minimal documentation. If you only need this for your own you can easily write an own user task - just following the pattern from GwIicTask.

oxbown commented 1 year ago

A new product of M5stack M5Unit-IMU-Pro, could be a good candidate. Documentation here Is a i2c Six-axis Attitude Sensor (BMI270) + Three-axis Geomagnetic Sensor (BMM150) + Atmospheric Pressure Sensor (BMP280) Arduino library

oxbown commented 1 year ago

Should not be that much of an issue... But I have no device for testing. And someone would need to write some minimal documentation. If you only need this for your own you can easily write an own user task - just following the pattern from GwIicTask.

My plan is to help add more capabilities to the project (writing some code and testing with my equipment)

wellenvogel commented 1 year ago

That sounds great... I just heavily restructured the IICSensorTask. Now it should be much easier to write some code for a new sensor. Basically you need to implement a Sensor config that inherits from SensorBase - see e.g. https://github.com/wellenvogel/esp32-nmea2000/blob/28ae7d3bbdf9072afd67e8b2e6c80970d558260b/lib/iictask/GwQMP6988.cpp#L24 and a register function that we include in the sensor task. Additionally you need to add the necessary config to the config.json. I prepared the sensors now for 2 buses and each 2 sensor instances on one bus. You can control the sensors you would like to have via build flags (and the automated build for that is also on the way...). So if you are interested - maybe you would like to implement your sensor this way.

wellenvogel commented 8 months ago

Are you still interested ?

oxbown commented 8 months ago

Yes, I´m currently using an MPU9250 but not integrated into the ESP32 gateway. I use another esp32 to transmit the data (heading, pitch, roll) via TCP/IP in NMEA format.

wellenvogel commented 8 months ago

Ok, sounds intersting. Do you have a github repo for that part? At the end it's again about testing...

oxbown commented 8 months ago

My test MPU board. I use a M5 proto to make the wiring. IMG_1012

wellenvogel commented 8 months ago

cool. In the moment I'm just busy with a couple of other things... Not sure if you would like to go for a PR?

wellenvogel commented 1 week ago

Are you still working on this? What about a PR?