Page 1 of 2

ADC Problem, reading is ok but no value

Posted: 12 Nov 2023, 22:18
by obstbauer
Hello,
I read a pressure sensor with ESP_EASY on a Lolin NodeMCU V3. The reading works and I can see the correct pressure.
I want to send the values to iobroker. MQTT is working (I use it with other ESP_Easy devices) but I get no values?

What is wrong with my configuration?
Thank you!
Regards
Thomas

Re: ADC Problem, reading is ok but no value

Posted: 12 Nov 2023, 22:32
by Ath
What binary file did you upload to the unit? If it includes "VCC" in the name, then the analog pin is wired to read the 3.3V power of the ESP8266...
You can upload the same binary without VCC in the name to fix that.

Re: ADC Problem, reading is ok but no value

Posted: 12 Nov 2023, 22:34
by TD-er
I think you should have a look at the controller configuration.

Also, what build are you using?
Are you sure the JavaScript files are active for refreshing the devices page?

Re: ADC Problem, reading is ok but no value

Posted: 12 Nov 2023, 23:47
by obstbauer
I use Build: ESP_Easy_mega_20230507_normal_ESP8266_4M1M May 7 2023

I guess without VCC
But the measurement is working? I get correct values.

The controller configuration is the same as in the other devices which work

"Are you sure the JavaScript files are active for refreshing the devices page?"
How can I check this ?

Re: ADC Problem, reading is ok but no value

Posted: 13 Nov 2023, 00:04
by TD-er
You can add a task which doesn't require any hardware interaction like the sysinfo plugin and set it to 1 second interval.
This should allow you to see the values update every second.

So maybe use some value that will frequently update like free memory, internal temperature (only on newer ESP32 builds), WiFi TX power or RSSI.

Re: ADC Problem, reading is ok but no value

Posted: 13 Nov 2023, 14:52
by obstbauer
I added a task and I have the same problem
no values like free Ram etc. are shown

Re: ADC Problem, reading is ok but no value

Posted: 13 Nov 2023, 14:52
by obstbauer
"Are you sure the JavaScript files are active for refreshing the devices page?"
How can I check this ?

Re: ADC Problem, reading is ok but no value

Posted: 13 Nov 2023, 15:11
by TD-er
You could look at the "inspect" window of your browser.
Right-click on the page and open "inspect"
Then see in the "console" if there is an error loading files.
You can also look at the "Network" tab in the inspect window and reload the page to see if some files give an error loading.

Re: ADC Problem, reading is ok but no value

Posted: 13 Nov 2023, 16:40
by obstbauer
there are no issues in the console
I tested with chrome firefox and Edge

I checked the options, Javascript is enabled for websites

Re: ADC Problem, reading is ok but no value

Posted: 13 Nov 2023, 22:10
by TD-er
In another topic, a zip file was posted with all .js files and the CSS file.
viewtopic.php?p=66902#p66902

You could try to unzip this file and upload the files one-by-one to the file system and see if it works after uploading the files.

Re: ADC Problem, reading is ok but no value

Posted: 13 Nov 2023, 23:38
by obstbauer
this post was from me too
with my ESP01 it works now

but here I have another problem, the web interface looks normal, the measurements shows right values but not on the page I showed

Re: ADC Problem, reading is ok but no value

Posted: 13 Nov 2023, 23:41
by TD-er
You also need to extract the file "update_sensor_values_device_page.js" from that same ZIP file
Rename it to "upd_values_device_page.js" and upload it to the file system.

Re: ADC Problem, reading is ok but no value

Posted: 14 Nov 2023, 09:38
by obstbauer
ok, this is a 4 MB Lolin NodeMCU V3.
Would it be better to make a firmware update with the newest version ?
now it is ESP_Easy_mega_20230507_normal_ESP8266_4M1M May 7 2023

Re: ADC Problem, reading is ok but no value

Posted: 14 Nov 2023, 10:04
by TD-er
If you managed to get it working with the files uploaded to the ESP, then I suggest to wait for a new build.
Working on a few fixes and will try to mitigate the CDN server issues and hopefully later this week there will be a new build.

Re: ADC Problem, reading is ok but no value

Posted: 14 Nov 2023, 22:27
by obstbauer
it works, thank you
now I can see the values

Re: ADC Problem, reading is ok but no value

Posted: 14 Nov 2023, 22:31
by obstbauer
do I need all files or only the "upd_values_device_page.js" file?

Because I can see the values now on the esp web interface but I don't see the values in iobroker
the other esp devices are sending the values to iobroker

Re: ADC Problem, reading is ok but no value

Posted: 14 Nov 2023, 22:39
by obstbauer
sensor appears but no values

Re: ADC Problem, reading is ok but no value

Posted: 14 Nov 2023, 22:44
by TD-er
The JavaScript files and CSS are only there for interacting with the ESP via your brower.
All other functionality does not need those files.

Re: ADC Problem, reading is ok but no value

Posted: 14 Nov 2023, 23:28
by obstbauer
mh, ok.. then there is still another problem why I don't see the value in iobroker

Re: ADC Problem, reading is ok but no value

Posted: 15 Nov 2023, 21:55
by obstbauer
no idea ?

Re: ADC Problem, reading is ok but no value

Posted: 15 Nov 2023, 22:19
by Ath
obstbauer wrote: 14 Nov 2023, 23:28 mh, ok.. then there is still another problem why I don't see the value in iobroker
Are the SysInfo values visible in iobroker?

Re: ADC Problem, reading is ok but no value

Posted: 15 Nov 2023, 22:46
by obstbauer
no
no values are shown
only indicator reachable on the picture I posted

Re: ADC Problem, reading is ok but no value

Posted: 15 Nov 2023, 23:09
by Ath
You haven't shown your Controller configuration yet, can you share that?
I assume you've validated the server address, username & password multiple times? (that's usually where the mistakes can be found...)
For some servers the "Client Timeout" setting needs to be increased, 1000 msec should usually be enough.

Re: ADC Problem, reading is ok but no value

Posted: 15 Nov 2023, 23:23
by obstbauer
I have three ESP01 which all sent their data to iobroker without problems
and I use the same settings of them for this devide so I don't think that the controler setup is a problem?

Re: ADC Problem, reading is ok but no value

Posted: 15 Nov 2023, 23:25
by obstbauer
with 1000 ms same problem

Re: ADC Problem, reading is ok but no value

Posted: 15 Nov 2023, 23:33
by TD-er
Each have a different client ID?
A MQTT broker may refuse connections if there's already one connected using the same client ID.

Is the subnet/Gateway correct on your ESP?
In the same subnet as the broker, or is it a different subnet?

Re: ADC Problem, reading is ok but no value

Posted: 15 Nov 2023, 23:41
by obstbauer
subnet is the same
all esp have different IDs
you can see on my screenshot above that the iobroker see the ESP but there are no value so in principle comunication is available

Re: ADC Problem, reading is ok but no value

Posted: 15 Nov 2023, 23:57
by TD-er
Is the connection to the MQTT broker stable?
Or does ESPEasy try to reconnect over-and-over again?
Does the client have permission to publish on the topic?

Re: ADC Problem, reading is ok but no value

Posted: 16 Nov 2023, 20:01
by obstbauer
subnet is the same
all esp have different IDs
you can see on my screenshot above that the iobroker see the ESP but there are no value so in principle comunication is available

Re: ADC Problem, reading is ok but no value

Posted: 16 Nov 2023, 20:11
by obstbauer
I have additionally a wemos S2 mini running and communication with iobroker is no problem too
with the same settings in the controler

Re: ADC Problem, reading is ok but no value

Posted: 16 Nov 2023, 20:48
by Ath
obstbauer wrote: 16 Nov 2023, 20:11 I have additionally a wemos S2 mini running and communication with iobroker is no problem too
with the same settings in the controler
That's the best clue that there is something wrong with the configuration of this specific unit.
Best solution, IMHO: Flash a blank_4M.bin file on the unit, re-flash with the latest ESPEasy release (mega-20231013), and configure the device from the ground up. (Don't restore a config backup!)

Re: ADC Problem, reading is ok but no value

Posted: 16 Nov 2023, 20:52
by obstbauer
ok, I will try it
there is no blank 4_M filge available?

https://td-er.nl/ESPEasy/

Re: ADC Problem, reading is ok but no value

Posted: 16 Nov 2023, 21:06
by TD-er
You can check the checkbox to erase all.
That's effectively the same as flashing a blank image, only faster and in the same run as flashing the build.

Re: ADC Problem, reading is ok but no value

Posted: 18 Nov 2023, 21:39
by obstbauer
I erased the device and installed the Build: ESP_Easy_mega_20231013_normal_ESP8266_4M1M Oct 13 2023
the pressure measurement works fine but I have exactly the same problem only the indicator.reachable signal true arrives iobroker but no values ??? :?:

Re: ADC Problem, reading is ok but no value

Posted: 18 Nov 2023, 21:52
by TD-er
OK back to the "ADC" in the topic title....
Which ADC are you using?
ADC 2 is being used along with WiFi, so you can't use that ADC with WiFi active.

In the pin descriptions there is also a reference to which ADC is being used.

N.B. in IDF5.1 the people from Espressif claim you may use ADC2 when WiFi is active, but not all calls to read from it will return a value.

To test IDF5.1 builds, you can try the "LittleFS" builds here: https://td-er.nl/ESPEasy/latest/
Only the Little FS builds hosted there will be using IDF5.1 and it also means you may loose all settings/config etc if your setup was using the SPIFFS file system.

Re: ADC Problem, reading is ok but no value

Posted: 18 Nov 2023, 22:23
by Ath
obstbauer wrote: 18 Nov 2023, 21:39 I erased the device and installed the Build: ESP_Easy_mega_20231013_normal_ESP8266_4M1M Oct 13 2023
the pressure measurement works fine but I have exactly the same problem only the indicator.reachable signal true arrives iobroker but no values ??? :?:
This smells like a networking issue between the ESPEasy unit and iobroker, or a wrong Controller setup for ESPEasy, can't tell from here.

I assume you have enabled the Controller in the Task (Device) configuration?

Re: ADC Problem, reading is ok but no value

Posted: 18 Nov 2023, 22:25
by obstbauer
I use the A0 pin ?
I Think this board has only one ADC ?

Re: ADC Problem, reading is ok but no value

Posted: 18 Nov 2023, 22:30
by Ath
Yes, but did you also check the "Send to Controller" for the "Home Assistant..." controller checkbox in that task?

Re: ADC Problem, reading is ok but no value

Posted: 18 Nov 2023, 22:41
by TD-er
obstbauer wrote: 18 Nov 2023, 22:25 I use the A0 pin ?
I Think this board has only one ADC ?
Sorry, I thought you were running on an ESP32 variant.

Re: ADC Problem, reading is ok but no value

Posted: 19 Nov 2023, 00:02
by obstbauer
Yes send to Controller is enabled

Re: ADC Problem, reading is ok but no value

Posted: 20 Nov 2023, 13:48
by obstbauer
no other idea?
It is sad because I cannot use this bord for logging my pressures :cry:

Re: ADC Problem, reading is ok but no value

Posted: 20 Nov 2023, 14:57
by Ath
If you enter %sysname% in the Controller Client ID field of your MQTT Controller, is it then showing the values for the unit named "ESP_Easy_Drucksensor_5" ? Because that's the name that is used when sending the values...

Re: ADC Problem, reading is ok but no value

Posted: 20 Nov 2023, 19:30
by obstbauer
this is the entry:

Re: ADC Problem, reading is ok but no value

Posted: 21 Nov 2023, 22:27
by obstbauer
I made a test with a second Lolin NodeMCU V3 board and with the free RAM measurement and it is the same problem
the mqtt connection is ok with both boards but no values only indicator reachable true....

Re: ADC Problem, reading is ok but no value

Posted: 21 Nov 2023, 23:37
by Ath
Your values will be in the MQTT topic as specified in the Publish field of your controller, with %sysname% replaced by the name of your ESPEasy unit (ESP_Easy_Sensor_Druck_5), as specified on the Config tab, (and it includes the Unit number as that checkbox is enabled). You should find that MQTT topic in your MQTT Server to find the values. The Client ID is a separate topic, using a (somewhat) different name.
The topic to search for should be:

Code: Select all

ESP_Easy_Sensor_Druck_5/ADC/Analog
, assuming you didn't change the Value name for your ADC task.

Re: ADC Problem, reading is ok but no value

Posted: 22 Nov 2023, 09:05
by TD-er
Maybe you can install a diagnostics tool like MQTT Explorer (Windows, via Microsoft Store)
This way you can actually see what is being sent to the MQTT broker and also filter on data to not get overwhelmed with all the published messages if it is already a 'busy' network.

Re: ADC Problem, reading is ok but no value

Posted: 22 Nov 2023, 14:25
by obstbauer
@ Ath:

Sorry I don't understand what you mean?
I have some ESP_Easy devices running and the values are shown in my iobroker with mqtt like this:


on the pictures above you can see that with my adc problem device the values are not shown and there is no option to find or see the values?

Re: ADC Problem, reading is ok but no value

Posted: 23 Nov 2023, 16:02
by obstbauer
ok problem solved....

I had no real mqtt server installed for iobroker
I always used the sonoff adapter to get the values and it works with my other esp01 and esp32 devices
I don't know why but I get the values
I installed now the mqtt server adapter and now I get the adc values

Re: ADC Problem, reading is ok but no value

Posted: 23 Nov 2023, 22:34
by Ath
Great you got it working :D

Most of that last information sounds a bit strange to me, of having MQTT communication without a MQTT server installed, but as long as it (now) all works, that's fine 8-)

Re: ADC Problem, reading is ok but no value

Posted: 24 Nov 2023, 09:08
by obstbauer
the sonoff adapter is for tasmota
And I started with tasmota and then I made first tries with ESP Easy and the esp easy devices worked with this sonoff adapter so I did not expected that there is a problem

it seems to work with values from hardware (because I only worked with temperature and humidity sensors) but not with values from devices like my adc now