Module fro HMC5883L based on Adafruit Arduino code and on think-bowl.com code.

Tested on BeableBone Black - should work on Raspberry Pi