As the title says... Chat on...

User avatar
By alex_g
#68155 Hey All!

After some weeks of headbanging and waiting for new magnetometer units to arrive (which also didn't work) I have finally discovered the following.

The common modules sold on fleabay, although marked 5883 are NOT HMC5883Ls but instead something called a QMC5883L! (mercy...)

I have found working Arduino code for these, hopefully at some stage we can incorporate it in the Lua codebase too, as these modules seem to be by far the most prevalent.
User avatar
By alex_g
#68157
marcelstoer wrote:Great, looking forward to a PR ;)


What's a PR, Marcel? Something to do with Public Relations?

Just kidding, I wish I had the time, at the moment I haven't even got a dev setup going, I am still working with your "custom builds". Maybe sometime soon, as I really would like to contribute to this project, but it's a bit in the hands of the gods at the moment.

Incidentally, if this was ported to Lua/NodeMCU do you you think it would be better to make it part of the existing hmc5883l module, transparently switching between modules depending on the I2C address it found (i.e. 0x1e or 0x0d) or as a separate module "qmc5883l"?
User avatar
By marcelstoer
#68175
alex_g wrote:Incidentally, if this was ported to Lua/NodeMCU do you you think it would be better to make it part of the existing hmc5883l module, transparently switching between modules depending on the I2C address it found (i.e. 0x1e or 0x0d) or as a separate module "qmc5883l"?


I was thinking about this after I posted the previous comment. Not being a C/firmware developer I can't give "authoritative" recommendations, though. Generally I'd say it should be a single module if the similarities outweigh the differences.
  • Do the two chips have the same characteristics e.g. wrt timing?
  • Is checking for the I2C address a reliable enough signal to tell them apart
  • What would be the name of the module if it supported both chips?