-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect values. #1
Comments
Do you use delays? Can you maybe show the code? What device is it btw? |
#include "AGS02MA.h" #define WIFI_SSID "NETGEAR" // Raspberry Pi Mosquitto MQTT Broker // Temperature MQTT Topics float ppm25; #define INTERVAL_COUNTDOWN 1000 #include <KarserDSM501.h> unsigned long timer = 0; unsigned long previousMillis = 0; // Stores last time temperature was published void connectToWifi() { void connectToMqtt() { void setup() { WiFi.onEvent(WiFiEvent); mqttClient.onConnect(onMqttConnect); void loop() { if (!pm10.isReady() && (millis() >= timer + INTERVAL_COUNTDOWN)) { } else if (millis() >= timer + INTERVAL_READ) { |
I'm not selenium in programming. I have one sample, I connect different sensors in the image and likeness. |
Are you Russian? then you can use Russian, it will be easier this way |
Let's stick to English since this might help somebody else. Try commenting out this line |
I've done it before. It doesn't help. I completely removed everything from the "void loop", leaving only your code. And still the values are not correct. I think the problem is connecting to wi-fi and to the mqtt server. Somewhere in this place there is a delay that causes the pulses to be counted incorrectly. |
I have now tried another example. And the same thing, after I add the code to send to the mqtt server, the values begin to be incorrect. Apparently I turned to the wrong address( |
If interrupts don't work during wi-fi connection you probably should split this task into 2 boards so that pulses will be counted uninterruptedly. I'm wondering if ATTINY13 can handle this task. |
in general, have examples on esp8266 with sending to the mqtt server. But they are too sophisticated. They are on platform.io and there is a lot of excess, for example, temperature sensors. It takes a very long time to clean all this. |
Hello. I came across your library and an example for taking readings from the dsm501 sensor. Your example is the best. But here's the problem when I add mqtt to your example. All indications become incorrect. I guess the problem is in time. But I can't figure out how to solve it.
The text was updated successfully, but these errors were encountered: