-->
Page 1 of 2

ESP 8266 and HX711

PostPosted: Sat Oct 10, 2015 10:52 am
by jonm
Hi,
I am trying to get the HX711 arduino library to work on the 8266 through the arduino IDE.

The HX711 library controls the load cell chip to allow it to talk to the processor. It works great when i have the HX711 connected to an Arduino Nano. The masses are read and processed easily.

But when I compile it for the 8266, it comes up with this:

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1264, room 16
tail 0
chksum 0x42
csum 0x42
~ld

The chip is fine as it runs other programs, but something is causing it to reset when i try to use the 711 library and associated commands.

I have connected the 711 clock to GPIO 16 and data to GPIO 14 on a ESP12

Any suggestions. Has anyone else managed to use the 711 library directly on the 8266?

Thanks

Re: ESP 8266 and HX711

PostPosted: Sat Oct 10, 2015 12:08 pm
by gregware
Hi Jon,

It's funny you should ask right now, I've been running through this over the last 2 weeks, and got mixed results.

My finding so far are that HX711 can be made to work with ESP8266, by using the bit-banging sketch posted by JP at viewtopic.php?f=29&t=4100&start=0 (or search for JP ESCALE)

If you look at it closely, you'll find out it's a bit more streamlined than the bodge/HX711 library (in the way JP shifts the bits in the result), plus there are delayMicroseconds(2) in the code to get a correct pace for ESP8266 (I'm using GPIO12 and 13, although it doesn't matter)

I could get this working in Arduino IDE, I need to try again in eclipse. Previously, I had tried the bodge/HX711 lib in eclipse/Arduino but could not make it work. I had added this to a bit of code that was already doing DS18B20 and MQTT, so there could have been adverse timing issues with interrupts, or it could have been a bad init, not sure.

To your initial question, I also at some point got myself in the bootloop situation, I suspect it was because the setup() was stuck waiting for DOUT to come HIGH, and this caused ESP to reboot.

There's a complete sketch with MQTT here also: http://blog.heredero.org/pese-personne-wifi/

Greg

Re: ESP 8266 and HX711

PostPosted: Sun Oct 11, 2015 8:04 am
by jonm
Thanks, thats great.
Now working with the JP code!
Thanks for your help
Cheers
Jon

Re: ESP 8266 and HX711

PostPosted: Wed Dec 16, 2015 2:17 pm
by kandurivk
Hi I am pretty new to these, but am trying to connect load cell to HX 711 and connect to ESP 8266. But i am too naive to connect all these hence need your help. I dont understand how to proceed. Please help.