Push data from device Wemos + HX711

Hi everybody, please i need your help so bad!
i need to connect a device with thinger. the first step is ok, I made to connect it from a sketch I found online link and other from the community.

When I try to adapt it to my project, just adding a sensor, (without calling any function… just #include the library, it doesn’t connect.

#define DEBUG // Grazie a questi finalmente si e’ connesso, dopo infiniti tentativi
#define DISABLE_TLS
#include <SPI.h>
#include <ESP8266WiFi.h>
#include <ThingerESP8266.h>

#include “DHT.h”
//#include <HX711.h> //appena lo attivi, non si connette piu… boh??

#define USERNAME “sistralsrl”
#define DEVICE_ID “test2”
#define DEVICE_CREDENTIAL “test1234”
ThingerESP8266 thing(USERNAME, DEVICE_ID, DEVICE_CREDENTIAL);

#define SSID “Rigert”
#define SSID_PASSWORD “albinoniE45”

int timer = 0;
//int freq = 20;

#define DHTPIN D2
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);

//#define sezione1_DOUT_PIN D6
//#define sezione1_SCK_PIN D7
//HX711 sezione1(sezione1_DOUT_PIN, sezione1_SCK_PIN);

void setup() {
// Setup WiFi
thing.add_wifi(SSID, SSID_PASSWORD);
// Define the ‘thing’ with a name and data direction
thing[“dht11”] >> [](pson& out){
// Add the values and the corresponding code
out[“humidity”] = dht.readHumidity();
out[“celsius”] = dht.readTemperature();
//out[“Hx711”] = sezione1.readvalue();

};
}

void loop() {
thing.handle();
if(millis()>timer+(60000*1)) { //call each “freq” minutes
thing.write_bucket(“BucketIFR”, “dht11”); //call thinger.io endpoint function and attacht the pson (ID Bucket, thing)
timer = millis(); //actualize time counter
}
}

My friend post the sketch in the right way, and show us the debug answer of the serial console to help you solve the issue as soon as possible.

Hi, thank you and sorry for my elementary mistakes! you can find attached the sketch and as you can see on the line, just adding the inclusion of a library, it does not work, attaching also the serial monitor:

Thanks

Preformatted text

#define DEBUG /
#define DISABLE_TLS
#include <SPI.h>
#include <ESP8266WiFi.h>
#include <ThingerESP8266.h>

#include “DHT.h”
#include “HX711.h” //just including this, it doesn’t connect!! without this yes!!
//even this way is not connecting: <HX711.h>

#define USERNAME “sistralsrl”
#define DEVICE_ID “devid”
#define DEVICE_CREDENTIAL “pass”
ThingerESP8266 thing(USERNAME, DEVICE_ID, DEVICE_CREDENTIAL);

#define SSID “Rigert”
#define SSID_PASSWORD “pass”

int timer = 0;
//int freq = 20;

#define DHTPIN D2
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);

//#define sezione1_DOUT_PIN D6
//#define sezione1_SCK_PIN D7
//HX711 sezione1(sezione1_DOUT_PIN, sezione1_SCK_PIN);

void setup() {
Serial.begin(9600);
delay(100);
Serial.println(“Booting”);

// Setup WiFi
thing.add_wifi(SSID, SSID_PASSWORD);
// Define the ‘thing’ with a name and data direction
thing[“dht11”] >> (pson& out){
// Add the values and the corresponding code
out[“humidity”] = dht.readHumidity();
out[“celsius”] = dht.readTemperature();
//out[“Hx711”] = sezione1.read();

};
}

void loop() {
thing.handle();
if(millis()>timer+(60000*1)) { //call each “freq” minutes
thing.write_bucket(“BucketIFR”, “dht11”); //call thinger.io endpoint function and attacht the pson (ID Bucket, thing)
timer = millis(); //actualize time counter
}
}

Not working sketch

Working Sketch

The issue is that the library is not compatible with the working sketch, sometimes there are libraries that uses resources of the microcontroller that are blocked by other process, or in someway triggers a watchdog and makes the microcontroller freak out.

It is weird, but it happens, that you have two different sketches working and when you try to mix them, doesn’t work by no apparent reason.

I recommend to try another library, I’ve take a little look and there are more that works with that device.

Let me know how it goes.

Thank you, i solved by changing the library! I got the one recognized by Arduino very thankful to the community for help every time!

Well done!!

I was reading your last issue, but you updated the post haha.

What I can recommend you after seeing the code, is to have things separately, on one side the calibration parameters and on other side the outputs, you may have everything together, but it is a good practice to have it separately, even you may restrict the access to configuration without restrincting the access to the output.

Bests,

Thank you very much. The last question, I bought the monthly profile, buying a domain. How can I add this to my basic profile so I can have unlimited devices?

No worries, I’m sorry but I don’t understand your question, did you pay a plan but cannot have unlimited devices?

I solved it! i bought the monthly payment, and I thought there was a possibility to add the unlimited devices on my account, but I got that I was creating my domine, and inside that, I had to create an account… and in the account my devices. i think is not that easy for one that starts on the makers account and want to developed, to understand this step… but anyway I got it.

P.s. i had to insert #define THINGER_SERVER “mydomine.aws.thinger.io” at the very beginning of the sketch… but as always in many posts you already said that and want to thank for the support!

Wow so cool!

I’m glad maily by two things, that you are not just waiting for responses but also looking for your own how to solve issues, and that the work that is done in the forum keeps helping as documentation.

My work here is done with you, go and discover the world!!! hahaha

Just kidding, any doubt you may have we are here to help.

Regards,