Chat here is you are connecting ESP-xx type modules to existing AVR based Arduino

Moderator: igrr

User avatar
By Clemens
#38942
gregware wrote:Hi Jon,
There's a complete sketch with MQTT here also: http://blog.heredero.org/pese-personne-wifi/


On the posted link you can see the difference in the code what makes the default Arduino HX711 sketch
https://github.com/bogde/HX711/blob/mas ... Serial.ino
working with the ESP:

You have to add some yield(); calls to keep background functions (WiFi, TCP/IP) running, see
http://stackoverflow.com/questions/3449 ... ldfunction
User avatar
By kozoke
#48148 Hi. I've been trying to get the code examples above to run on an esp 8266 12e without luck.

I keep getting the following error. Any insights on what may be causing it? I've tried the JP scale example among others but none work. In the below example there is as follows. Appreciate any help.

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

Code example below:
#include <Wire.h>
#include "HX711.h"

#define NB_ECHANTILLON 10
uint32 index_moyenne=0;

HX711 scale(12, 14); // HX711.DOUT = GPIO12 / HX711.PD_SCK = GPIO14

float resultat[NB_ECHANTILLON];

void setup() {
Serial.begin(115200);
Serial.println("Test HX711");

scale.read();
yield(); // Redonne la main à l'ESP8266

/*
* Le nombre ci dessous permet de calibrer la balance. Pour l'obtenir, voir le fichier README de la bibliothèque HX711
*/
scale.set_scale(20108.1f);
scale.tare();
yield();
}

void loop() {
float poids,total;
uint8 n;

poids=scale.get_units(10);

resultat[index_moyenne++]=poids;
index_moyenne %= NB_ECHANTILLON;

total=0;
for(n=0;n<NB_ECHANTILLON;n++){
total+=resultat[n];
}
Serial.print(poids);
Serial.print("\t moyenne des 10 derniers poids = ");
Serial.println(total/NB_ECHANTILLON, 2);
delay(100);
}
User avatar
By kozoke
#48304 Hi, i'm having problems with a ESP 8266 12e (not 01) wired up to a hx711. I cannot get it to provide measures. It either keeps doing a wdt reset or sending back a value of 65535. I've been working with one of the developers -cheaplin on github - https://github.com/chaeplin/esp8266_and ... /issues/32
but I still can't seem to get it to work.

Anyone have any solid scrips/libraries that work on an esp826612e and hx711? I've chaned to feed 3v to the hx711 but that didn't help Cheaplin thought it might need "voltage level shifting" but not sure. So, looking for any thoughts/advice.

Thanks!