ADC Problem, reading is ok but no value

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
obstbauer
Normal user
Posts: 41
Joined: 25 May 2023, 15:46

ADC Problem, reading is ok but no value

#1 Post by obstbauer » 12 Nov 2023, 22:18

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
Attachments
pressure_3.JPG
pressure_3.JPG (64.58 KiB) Viewed 55111 times
pressure_2.JPG
pressure_2.JPG (45.47 KiB) Viewed 55111 times
pressure_1.JPG
pressure_1.JPG (16.29 KiB) Viewed 55111 times

User avatar
Ath
Normal user
Posts: 3519
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ADC Problem, reading is ok but no value

#2 Post by Ath » 12 Nov 2023, 22:32

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.
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ADC Problem, reading is ok but no value

#3 Post by TD-er » 12 Nov 2023, 22:34

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?

obstbauer
Normal user
Posts: 41
Joined: 25 May 2023, 15:46

Re: ADC Problem, reading is ok but no value

#4 Post by obstbauer » 12 Nov 2023, 23:47

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 ?

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ADC Problem, reading is ok but no value

#5 Post by TD-er » 13 Nov 2023, 00:04

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.

obstbauer
Normal user
Posts: 41
Joined: 25 May 2023, 15:46

Re: ADC Problem, reading is ok but no value

#6 Post by obstbauer » 13 Nov 2023, 14:52

I added a task and I have the same problem
no values like free Ram etc. are shown

obstbauer
Normal user
Posts: 41
Joined: 25 May 2023, 15:46

Re: ADC Problem, reading is ok but no value

#7 Post by obstbauer » 13 Nov 2023, 14:52

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

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ADC Problem, reading is ok but no value

#8 Post by TD-er » 13 Nov 2023, 15:11

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.

obstbauer
Normal user
Posts: 41
Joined: 25 May 2023, 15:46

Re: ADC Problem, reading is ok but no value

#9 Post by obstbauer » 13 Nov 2023, 16:40

there are no issues in the console
I tested with chrome firefox and Edge

I checked the options, Javascript is enabled for websites

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ADC Problem, reading is ok but no value

#10 Post by TD-er » 13 Nov 2023, 22:10

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.

obstbauer
Normal user
Posts: 41
Joined: 25 May 2023, 15:46

Re: ADC Problem, reading is ok but no value

#11 Post by obstbauer » 13 Nov 2023, 23:38

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
Attachments
easy.JPG
easy.JPG (69.11 KiB) Viewed 55064 times

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ADC Problem, reading is ok but no value

#12 Post by TD-er » 13 Nov 2023, 23:41

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.

obstbauer
Normal user
Posts: 41
Joined: 25 May 2023, 15:46

Re: ADC Problem, reading is ok but no value

#13 Post by obstbauer » 14 Nov 2023, 09:38

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

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ADC Problem, reading is ok but no value

#14 Post by TD-er » 14 Nov 2023, 10:04

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.

obstbauer
Normal user
Posts: 41
Joined: 25 May 2023, 15:46

Re: ADC Problem, reading is ok but no value

#15 Post by obstbauer » 14 Nov 2023, 22:27

it works, thank you
now I can see the values

obstbauer
Normal user
Posts: 41
Joined: 25 May 2023, 15:46

Re: ADC Problem, reading is ok but no value

#16 Post by obstbauer » 14 Nov 2023, 22:31

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

obstbauer
Normal user
Posts: 41
Joined: 25 May 2023, 15:46

Re: ADC Problem, reading is ok but no value

#17 Post by obstbauer » 14 Nov 2023, 22:39

sensor appears but no values
Attachments
easy2.JPG
easy2.JPG (24.21 KiB) Viewed 54995 times

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ADC Problem, reading is ok but no value

#18 Post by TD-er » 14 Nov 2023, 22:44

The JavaScript files and CSS are only there for interacting with the ESP via your brower.
All other functionality does not need those files.

obstbauer
Normal user
Posts: 41
Joined: 25 May 2023, 15:46

Re: ADC Problem, reading is ok but no value

#19 Post by obstbauer » 14 Nov 2023, 23:28

mh, ok.. then there is still another problem why I don't see the value in iobroker

obstbauer
Normal user
Posts: 41
Joined: 25 May 2023, 15:46

Re: ADC Problem, reading is ok but no value

#20 Post by obstbauer » 15 Nov 2023, 21:55

no idea ?

User avatar
Ath
Normal user
Posts: 3519
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ADC Problem, reading is ok but no value

#21 Post by Ath » 15 Nov 2023, 22:19

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?
/Ton (PayPal.me)

obstbauer
Normal user
Posts: 41
Joined: 25 May 2023, 15:46

Re: ADC Problem, reading is ok but no value

#22 Post by obstbauer » 15 Nov 2023, 22:46

no
no values are shown
only indicator reachable on the picture I posted

User avatar
Ath
Normal user
Posts: 3519
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ADC Problem, reading is ok but no value

#23 Post by Ath » 15 Nov 2023, 23:09

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.
/Ton (PayPal.me)

obstbauer
Normal user
Posts: 41
Joined: 25 May 2023, 15:46

Re: ADC Problem, reading is ok but no value

#24 Post by obstbauer » 15 Nov 2023, 23:23

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?
Attachments
dontroler.JPG
dontroler.JPG (65.3 KiB) Viewed 54961 times

obstbauer
Normal user
Posts: 41
Joined: 25 May 2023, 15:46

Re: ADC Problem, reading is ok but no value

#25 Post by obstbauer » 15 Nov 2023, 23:25

with 1000 ms same problem

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ADC Problem, reading is ok but no value

#26 Post by TD-er » 15 Nov 2023, 23:33

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?

obstbauer
Normal user
Posts: 41
Joined: 25 May 2023, 15:46

Re: ADC Problem, reading is ok but no value

#27 Post by obstbauer » 15 Nov 2023, 23:41

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

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ADC Problem, reading is ok but no value

#28 Post by TD-er » 15 Nov 2023, 23:57

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?

obstbauer
Normal user
Posts: 41
Joined: 25 May 2023, 15:46

Re: ADC Problem, reading is ok but no value

#29 Post by obstbauer » 16 Nov 2023, 20:01

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

obstbauer
Normal user
Posts: 41
Joined: 25 May 2023, 15:46

Re: ADC Problem, reading is ok but no value

#30 Post by obstbauer » 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

User avatar
Ath
Normal user
Posts: 3519
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ADC Problem, reading is ok but no value

#31 Post by Ath » 16 Nov 2023, 20:48

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!)
/Ton (PayPal.me)

obstbauer
Normal user
Posts: 41
Joined: 25 May 2023, 15:46

Re: ADC Problem, reading is ok but no value

#32 Post by obstbauer » 16 Nov 2023, 20:52

ok, I will try it
there is no blank 4_M filge available?

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

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ADC Problem, reading is ok but no value

#33 Post by TD-er » 16 Nov 2023, 21:06

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.

obstbauer
Normal user
Posts: 41
Joined: 25 May 2023, 15:46

Re: ADC Problem, reading is ok but no value

#34 Post by obstbauer » 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 ??? :?:

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ADC Problem, reading is ok but no value

#35 Post by TD-er » 18 Nov 2023, 21:52

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.

User avatar
Ath
Normal user
Posts: 3519
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ADC Problem, reading is ok but no value

#36 Post by Ath » 18 Nov 2023, 22:23

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?
/Ton (PayPal.me)

obstbauer
Normal user
Posts: 41
Joined: 25 May 2023, 15:46

Re: ADC Problem, reading is ok but no value

#37 Post by obstbauer » 18 Nov 2023, 22:25

I use the A0 pin ?
I Think this board has only one ADC ?
Attachments
3.JPG
3.JPG (12.37 KiB) Viewed 54840 times

User avatar
Ath
Normal user
Posts: 3519
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ADC Problem, reading is ok but no value

#38 Post by Ath » 18 Nov 2023, 22:30

Yes, but did you also check the "Send to Controller" for the "Home Assistant..." controller checkbox in that task?
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ADC Problem, reading is ok but no value

#39 Post by TD-er » 18 Nov 2023, 22:41

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.

obstbauer
Normal user
Posts: 41
Joined: 25 May 2023, 15:46

Re: ADC Problem, reading is ok but no value

#40 Post by obstbauer » 19 Nov 2023, 00:02

Yes send to Controller is enabled

obstbauer
Normal user
Posts: 41
Joined: 25 May 2023, 15:46

Re: ADC Problem, reading is ok but no value

#41 Post by obstbauer » 20 Nov 2023, 13:48

no other idea?
It is sad because I cannot use this bord for logging my pressures :cry:

User avatar
Ath
Normal user
Posts: 3519
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ADC Problem, reading is ok but no value

#42 Post by Ath » 20 Nov 2023, 14:57

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...
/Ton (PayPal.me)

obstbauer
Normal user
Posts: 41
Joined: 25 May 2023, 15:46

Re: ADC Problem, reading is ok but no value

#43 Post by obstbauer » 20 Nov 2023, 19:30

this is the entry:
Attachments
4.JPG
4.JPG (50.79 KiB) Viewed 54673 times

obstbauer
Normal user
Posts: 41
Joined: 25 May 2023, 15:46

Re: ADC Problem, reading is ok but no value

#44 Post by obstbauer » 21 Nov 2023, 22:27

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....
Attachments
5.JPG
5.JPG (9.9 KiB) Viewed 54623 times

User avatar
Ath
Normal user
Posts: 3519
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ADC Problem, reading is ok but no value

#45 Post by Ath » 21 Nov 2023, 23:37

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.
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ADC Problem, reading is ok but no value

#46 Post by TD-er » 22 Nov 2023, 09:05

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.

obstbauer
Normal user
Posts: 41
Joined: 25 May 2023, 15:46

Re: ADC Problem, reading is ok but no value

#47 Post by obstbauer » 22 Nov 2023, 14:25

@ 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?
Attachments
1.JPG
1.JPG (35.78 KiB) Viewed 54599 times

obstbauer
Normal user
Posts: 41
Joined: 25 May 2023, 15:46

Re: ADC Problem, reading is ok but no value

#48 Post by obstbauer » 23 Nov 2023, 16:02

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

User avatar
Ath
Normal user
Posts: 3519
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ADC Problem, reading is ok but no value

#49 Post by Ath » 23 Nov 2023, 22:34

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-)
/Ton (PayPal.me)

obstbauer
Normal user
Posts: 41
Joined: 25 May 2023, 15:46

Re: ADC Problem, reading is ok but no value

#50 Post by obstbauer » 24 Nov 2023, 09:08

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

Post Reply

Who is online

Users browsing this forum: No registered users and 31 guests