-->
Page 1 of 3

HMC5883L magnetometer

PostPosted: Fri Jun 23, 2017 9:12 am
by alex_g
I am trying to get one of these magnetometers up and running.
I get a warning that the documented call hmc5883l.init(sda,scl) is deprecated and will be removed in the next release. I am instructed to use the hmc5883l.setup() call instead, but nowhere is this new call documented nor can I even find any source code for it.

Subsequently, my system announces that it can't find the device, so there might be something wrong with it, but I want to eliminate all other possibilities first. I am using a custom-built firmware, off the dev branch. ( BTW, where is the source for this, if different from the main branch?)

Anyone have this running successfully, I'd be interested to hear...

-------

PS. The unit I am actually using is a GY-271, which is hmc5883l-based. I don't know if this causes some problem (I shouldn't imagine so) , but I'll try it with Arduino later, too, just to be sure.

Re: HMC5883L magnetometer

PostPosted: Fri Jun 23, 2017 3:03 pm
by marcelstoer
alex_g wrote:I am trying to get one of these magnetometers up and running.
I get a warning that the documented call hmc5883l.init(sda,scl) is deprecated and will be removed in the next release. I am instructed to use the hmc5883l.setup() call instead, but nowhere is this new call documented nor can I even find any source code for it.


You're obviously using a binary from the current 'dev' branch where init has been deprecated already. Hence, you also need docs and source from 'dev'.

https://nodemcu.readthedocs.io/en/dev/e ... /hmc5883l/
https://github.com/nodemcu/nodemcu-firm ... hmc5883l.c

Re: HMC5883L magnetometer

PostPosted: Sat Jun 24, 2017 7:42 am
by alex_g
marcelstoer wrote:
alex_g wrote:You're obviously using a binary from the current 'dev' branch where init has been deprecated already. Hence, you also need docs and source from 'dev'.

https://nodemcu.readthedocs.io/en/dev/e ... /hmc5883l/
https://github.com/nodemcu/nodemcu-firm ... hmc5883l.c


Thanks again Marcel!
I don't know why I had so much difficulty finding the dev source and docs. I tried Google and everything. Oh, well, I've got it bookmarked now!

BTW, I think my GY-271 unit is broken, I tried it under Arduino and it wouldn't work there either. Ho-hum, fleabay, here we go again...

Re: HMC5883L magnetometer

PostPosted: Sun Jun 25, 2017 12:19 pm
by marcelstoer
alex_g wrote:I don't know why I had so much difficulty finding the dev source and docs.


Try the "Read The Docs" fly-out menu in the lower left corner of the doc pages. It's partially broken (not our fault) but contains links to all branches. The source file for each module is linked right at the top of its corresponding doc page.