letscontrolit / ESPEasy

Easy MultiSensor device based on ESP8266/ESP32
http://www.espeasy.com
Other
3.26k stars 2.21k forks source link

ADS1115 value are 0.00 #4768

Closed mpl1337 closed 1 year ago

mpl1337 commented 1 year ago

Hello,

im trying to read a pressure transducer on my ADS115 with ESP32. Iv got only 0.00 as Value. Whats wrong with my Setup?. Iv tryed allready a Sample Sketch on Arduino IDE and it works. The hardware is working.

Build: ESP_Easy_mega_20230623_normal_ESP32_4M316k Jun 23 2023 1 2 3 4

tonhuisman commented 1 year ago

Did you change the hardware to be at I2C addres 0x49? As 0x48 is the default 🤔

mpl1337 commented 1 year ago

Yes, ADDR is on +3.3. With 0x48 same.

tonhuisman commented 1 year ago

And if you leave ADDR disconnected? Don't know how that address has to be set exactly, would need to lookup in the datasheet.

mpl1337 commented 1 year ago

When i leave ADDR disconnected then is the address 0x48. Value is still 0.00

TD-er commented 1 year ago

What voltage do you apply to the input? The input voltage should not exceed the supply voltage of the ADS1115 as far as I can remember. The FS value (full scale) is maybe a bit confusing as it suggests you can put upto 6.14 Volt on the pin.

And are you sure you're using the correct analog input pin? Maybe you can test using a simple AA battery? Just to see if you can measure something and also to be sure there is no ground issue with what you try to measure.

Edit: Part from the datasheet: image

mpl1337 commented 1 year ago

i have a pressure transducer on 5V. SCL/SDA ADS1115 is connected to a levelshifter 5V<>3.3V

i have tryed all Analog Inputs, on every Input 0.00

Samplesketch:

AIN0: -1 -0.00V (A0 connected to GND) AIN1: 1671 5.01V (A1 connected to +5V) AIN2: 1105 3.32V (A2 connected to +3.3) AIN3: 82 0.25V (nc) sample

mpl1337 commented 1 year ago

an older version working.

Build: ESP_Easy_mega_20221224_normal_ESP32_4M316k Dec 24 2022

5

TD-er commented 1 year ago

OK, so the sensor is working and with the older build you proved it should work with ESPEasy...

Well that's clearly proven there's something wrong in ESPEasy then... Will have a look at it.

TD-er commented 1 year ago

I just looked at the history and some changed were merged on Mar 31. Could you test with a build prior to that date to make sure it may have been caused by this pr: https://github.com/letscontrolit/ESPEasy/commit/afd5299718ca79afc0b7d010571afa415ed2fb18 ?

mpl1337 commented 1 year ago

Build: ESP_Easy_mega_20230304_normal_ESP32_4M316k Mar 4 2023

still working

mpl1337 commented 1 year ago

Build: ESP_Easy_mega_20230306_normal_ESP32_4M316k Mar 6 2023

working

mpl1337 commented 1 year ago

Build: ESP_Easy_mega_20230409_normal_ESP32_4M316k Apr 9 2023

not working

TD-er commented 1 year ago

Thanks, so it is clear which commit was faulty. I will look into this.

mpl1337 commented 1 year ago

okay, im ready for the next test :D

TD-er commented 1 year ago

Could you test with any non working build to enable the calibration and just set the 2nd row of the calibration to something like this: 1 -> 1

This way there is a calibration mapping from 0 -> 0 and 1 -> 1 The second entry can also be 100 -> 100 but I guess you get the idea :)

Edit: And perhaps uncheck "convert to volt"

mpl1337 commented 1 year ago

ok?

6

mpl1337 commented 1 year ago

Still 0.00

TD-er commented 1 year ago

Did you try using the "convert to volt" checked? My theory is that the conversion to volt may have a multiplier set to 0... But I don't see it yet in the code how this can be.

TD-er commented 1 year ago

Also, can you check the debug log (if included in your build) to see if there is any report of the measured analog value

mpl1337 commented 1 year ago

Where can I find the debug log?

Did you try using the "convert to volt" checked? -> yes

TD-er commented 1 year ago

In tools->Advanced you can set the log level. If you can set it to Debug level, then you have "debug logs" included in your build.

Then you can simply open the log, either on the web log page or via the serial port.

N.B. you can set the log level per log output (e.g. serial log, web log, ...)

mpl1337 commented 1 year ago

have set to Debug Dev but nothing about the ADC in the log.

6194941 : Info : WD : Uptime 103 ConnectFailures 0 FreeMem 184320 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init 6194943 : Debug More : UDP : Send Sysinfo message 6194949 : Debug More : UDP : Send Sysinfo message 6195830 : Debug : LoopStats: shortestLoop: 42 longestLoop: 8297093 avgLoopDuration: 74.59 loopCounterMax: 714285 loopCounterLast: 397132 6195832 : Debug : Scheduler stats: (called/tasks/max_length/idle%) 397132/2112/9/88.20 6200011 : Info : ESPEasy console using ESPEasySerial 6200013 : Info : SaveToFile: free stack: 7212 6200129 : Info : FILE : Saved config.dat offset: 0 size: 3028 6200130 : Info : SaveToFile: free stack after: 7212 6200131 : Info : Skip saving SecuritySettings, not changed 6200444 : Info : static_file: /esp.css 6200467 : Debug : HTML : Request file /esp.css 6219071 : Info : ESPEasy console using ESPEasySerial 6219073 : Info : SaveToFile: free stack: 7212 6219145 : Info : FILE : Saved config.dat offset: 0 size: 3028 6219146 : Info : SaveToFile: free stack after: 7212 6219147 : Info : Skip saving SecuritySettings, not changed 6219156 : Debug dev : sendcontent free: 182856 chunk size:4096 6219188 : Debug dev : sendcontent free: 181024 chunk size:4096 6219214 : Debug dev : sendcontent free: 182700 chunk size:4096 6219239 : Debug dev : sendcontent free: 182740 chunk size:4096 6219266 : Debug dev : sendcontent free: 182676 chunk size:4096 6219314 : Debug dev : sendcontent free: 182800 chunk size:1393 6219320 : Debug dev : sendcontent free: 176040 chunk size:0 6219425 : Info : static_file: /esp.css 6219448 : Debug : HTML : Request file /esp.css 6219507 : Debug dev : sendcontent free: 184316 chunk size:2002 6219513 : Debug dev : sendcontent free: 175156 chunk size:0 6224941 : Info : WD : Uptime 104 ConnectFailures 0 FreeMem 186160 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init 6224943 : Debug More : UDP : Send Sysinfo message 6224949 : Debug More : UDP : Send Sysinfo message 6225830 : Debug : LoopStats: shortestLoop: 42 longestLoop: 8297093 avgLoopDuration: 75.85 loopCounterMax: 714285 loopCounterLast: 390655 6225832 : Debug : Scheduler stats: (called/tasks/max_length/idle%) 390655/2075/9/89.33 6254941 : Info : WD : Uptime 104 ConnectFailures 0 FreeMem 186156 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init 6254943 : Debug More : UDP : Send Sysinfo message 6254949 : Debug More : UDP : Send Sysinfo message 6255830 : Debug : LoopStats: shortestLoop: 42 longestLoop: 8297093 avgLoopDuration: 74.68 loopCounterMax: 714285 loopCounterLast: 396671 6255832 : Debug : Scheduler stats: (called/tasks/max_length/idle%) 396671/2138/9/89.31 6284941 : Info : WD : Uptime 105 ConnectFailures 0 FreeMem 186156 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init 6284943 : Debug More : UDP : Send Sysinfo message 6284949 : Debug More : UDP : Send Sysinfo message 6285830 : Debug : LoopStats: shortestLoop: 42 longestLoop: 8297093 avgLoopDuration: 73.37 loopCounterMax: 714285 loopCounterLast: 403647 6285832 : Debug : Scheduler stats: (called/tasks/max_length/idle%) 403647/2138/9/89.06 6290226 : Debug dev : sendcontent free: 184036 chunk size:4096 6290259 : Debug dev : sendcontent free: 180868 chunk size:1290 6290265 : Debug dev : sendcontent free: 177380 chunk size:0 6290450 : Info : static_file: /esp.css

TD-er commented 1 year ago

Can you try on the Tools->Advanced page to uncheck "Check I2C devices when enabled:"

mpl1337 commented 1 year ago

same, nothing about i2c

1947996 : Debug dev : sendcontent free: 184776 chunk size:407<\r> <\n>1948005 : Debug dev : sendcontent free: 179896 chunk size:0<\r> <\n>ets Jun 8 2016 00:22:57<\r> <\n><\r> <\n>rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)<\r> <\n>configsip: 0, SPIWP:0xee<\r> <\n>clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00<\r> <\n>mode:DIO, clock div:2<\r> <\n>load:0x3fff0030,len:184<\r> <\n>load:0x40078000,len:12732<\r> <\n>ho 0 tail 12 room 4<\r> <\n>load:0x40080400,len:2908<\r> <\n>entry 0x400805c4<\r> <\n>ªU188 : Info : <\n><\n><\r> INIT : Booting version: ESP_Easy_mega_20230813_normal_ESP32_4M316k, (GitHub Actions) mega_c25341d (ESP32 SDK 4.4.5.230614)<\r> <\n>190 : Info : INIT : Free RAM:248724<\r> <\n>191 : Info : INIT : Cold Boot - Restart Reason: CPU0: Vbat power on reset CPU1: for APP CPU, reset by PRO CPU<\r> <\n>191 : Info : FS : Mounting...<\r> <\n>216 : Info : FS : Mount successful, used 141815 bytes of 290156<\r> <\n>231 : Info : CRC : Settings CRC ...OK<\r> <\n>266 : Info : ESPEasy console using ESPEasySerial<\r> <\n>282 : Info : CRC : SecuritySettings CRC ...OK <\r> <\n><\0>329 : Info : ESPEasy console using ESPEasySerial<\r> <\n>331 : Info : INIT : I2C<\r> <\n>332 : Info : INIT : SPI not enabled<\r> <\n>333 : Info : Set Network mode: WiFi<\r> <\n>436 : Info : WIFI : Set WiFi to STA<\r> <\n>543 : Info : WiFi : Event STA Started<\r> <\n>644 : Info : WiFi : Start network scan all channels<\r> <\n>6659 : Info : WiFi : Scan finished, found: 2<\r> <\n>6661 : Info : WiFi : Best AP candidate: TP-Link_2FC8 6C:5A:B0:70:2F:C8 Ch:2 (-69dBm) - bgn<\r> <\n>6662 : Info : WiFi : Added known candida<\0>te, try to connect<\r> <\n>6663 : Info : WiFi : Best AP candidate: TP-Link_2FC8 6C:5A:B0:70:2F:C8 Ch:2 (-69dBm) - bgn<\r> <\n>6697 : Info : ESPEasy console usi<\0>ng ESPEasySerial<\r> <\n>6699 : Info : INIT : Free RAM:199444<\r> <\n>6744 : Info : ESPEasy console using ESPEasySerial<\r> <\n>6746 : Info : INFO : Plugins: 48 [Normal] (ESP32 SDK 4.4.5.230614)<\r> <\n>6749 : Info : WiFi : Best AP candidate: TP-Link_2FC8 6C:5A:B0:70:2F:C8 Ch:2 (-69dBm) - bgn<\r> <\n>6750 : Info : WIFI : Connecting TP-Link_2FC8 6C:5A:B0:70:2F:C8 Ch:2 (-69dBm) - bgn attempt #0<\r> <\n>6762 : Info : WIFI : Arduino wifi status: WL_DISCONNECTED 6 ESPeasy internal wifi status: DISCONNECTED<\r> <\n>7586 : Info : Webserver: start<\r> <\n>7593 : Info : WiFi : Event STA Stopped<\r> <\n>7600 : Info : WIFI : Disconnected! Reason: '(202) Auth fail' Connected for 837 ms<\r> <\n>7702 : Info : WIFI : Connecting TP-Link_2FC8 6C:5A:B0:70:2F:C8 Ch:2 (-69dBm) - bgn attempt #1<\r> <\n>7714 : Info : WiFi : Event STA Started<\r> <\n>8721 : Debug : WIFI : Disconnected: WiFi.status() = DISCONNECTED RSSI: -66 status: WL_DISCONNECTED 6<\r> <\n>8943 : Info : WD : Uptime 0 ConnectFailures 0 FreeMem 190524 WiFiStatus WL_DISCONNECTED 6 ESPeasy internal wifi status: DISCONNECTED<\r> <\n>9835 : Debug : LoopStats: shortestLoop: 21947 longestLoop: 940489 avgLoopDuration: 40994.76 loopCounterMax: 1366 loopCounterLast: 53<\r> <\n>9837 : Debug : Scheduler stats: (called/tasks/max_length/idle%) 50/50/7/0.00<\r> <\n>27711 : Info : WIFI : Arduino wifi status: WL_DISCONNECTED 6 ESPeasy internal wifi status: DISCONNECTED<\r> <\n>27712 : Info : WiFi : WifiDisconnect()<\r> <\n>27816 : Info : WIFI : Disconnected! Reason: '(1) Unspecified'<\r> <\n>27917 : Info : Reset WiFi.<\r> <\n>27920 : Info : WiFi : Start network scan all channels<\r> <\n>33934 : Info : WiFi : Scan finished, found: 2<\r> <\n>33936 : Debug : WiFi : Scan result: FRITZ!Box 7590 CJ 2,4 2C:91:AB:0D:90:DE Ch:6 (-66dBm) - bgn<\r> <\n>33938 : Debug : WiFi : Scan result: TP-Link_2FC8 6C:5A:B0:70:2F:C8 Ch:2 (-67dBm) - bgn<\r> <\n>33939 : Info : WiFi : Best AP candidate: TP-Link_2FC8 6C:5A:B0:70:2F:C8 Ch:2 (-67dBm) - bgn<\r> <\n>33940 : Info : WiFi : Added known candidate, try to connect<\r> <\n>33940 : Info : WiFi : WifiDisconnect()<\r> <\n>34043 : Info : WIFI : Disconnected! Reason: '(1) Unspecified'<\r> <\n>34045 : Info : WIFI : Arduino wifi status: WL_DISCONNECTED 6 ESPeasy internal wifi status: DISCONNECTED<\r> <\n>34145 : Info : WIFI : Set WiFi to OFF<\r> <\n>34464 : Info : WIFI : Set WiFi to STA<\r> <\n>34477 : Info : WiFi : Event STA Started<\r> <\n>34479 : Debug : WiFi : Set TX power to 0dBm sensitivity: -67dBm<\r> <\n>34580 : Info : WIFI : Connecting TP-Link_2FC8 6C:5A:B0:70:2F:C8 Ch:2 (-67dBm) - bgn attempt #2<\r> <\n>34591 : Debug : WIFI : Disconnected: WiFi.status() = DISCONNECTED RSSI: 0 status: WL_DISCONNECTED 6<\r> <\n>36086 : Debug : WIFI : Disconnected: WiFi.status() = DISCONNECTED RSSI: -69 status: WL_IDLE_STATUS 0<\r> <\n>36101 : Debug : WIFI : Entering processConnect()<\r> <\n>36103 : Info : WIFI : Connected! AP: TP-Link_2FC8 (6C:5A:B0:70:2F:C8) Ch: 2 Duration: 1502 ms<\r> <\n>36104 : Info : WIFI : Arduino wifi status: WL_IDLE_STATUS 0 ESPeasy internal wifi status: Conn. <\r> <\n>36114 : Debug : WIFI : Entering processGotIP()<\r> <\n>36116 : Info : WIFI : DHCP IP: 192.168.178.125 (ESP-Easy) GW: 192.168.178.1 SN: 255.255.255.0 DNS: 192.168.178.62 / 0.0.0.0 duration: 29 ms<\r> <\n>36119 : Debug : WiFi : Set TX power to 13dBm sensitivity: -67dBm RSSI: -69dBm<\r> <\n>36136 : Debug : WiFi : WiFi services initialized<\r> <\n>36259 : Debug dev : Read settings: TaskSettings index: 0<\r> <\n>36279 : Debug dev : Read settings: TaskSettings index: 1<\r> <\n>36299 : Debug dev : sendcontent free: 188736 chunk size:407<\r> <\n>36310 : Debug dev : sendcontent free: 183852 chunk size:0<\r> <\n>36327 : Info : UDP : Start listening on port 8266<\r> <\n>36328 : Info : firstLoopConnectionsEstablished<\r> <\n>36329 : Debug More : UDP : Send Sysinfo message<\r> <\n>36341 : Debug More : NTP : NTP host ptbtime1.ptb.de (192.53.103.108) queried<\r> <\n>36375 : Info : NTP : NTP replied: delay 31 mSec Accuracy increased by 416 msec<\r> <\n>36377 : Info : Time set to 1692297263.417<\r> <\n>36379 : Info : Current Time Zone: STD time start: 2023-10-29 03:00:00 offset: 0 min<\r> <\n>36381 : Info : Local time: 2023-08-17 18:34:23<\r> <\n>38933 : Info : WD : Uptime 1 ConnectFailures 0 FreeMem 188148 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init<\r> <\n>38935 : Debug More : UDP : Send Sysinfo message<\r> <\n>38941 : Debug More : UDP : Send Sysinfo message<\r> <\n>39822 : Debug : LoopStats: shortestLoop: 51 longestLoop: 7712106 avgLoopDuration: 660.23 loopCounterMax: 588235 loopCounterLast: 45398<\r> <\n>39824 : Debug : Scheduler stats: (called/tasks/max_length/idle%) 45361/986/7/10.12<\r> <\n>42037 : Debug dev : sendcontent free: 186136 chunk size:407<\r> <\n>42046 : Debug dev : sendcontent free: 181232 chunk size:0<\r> <\n>47976 : Debug dev : sendcontent free: 185892 chunk size:407<\r> <\n>47985 : Debug dev : sendcontent free: 181008 chunk size:0<\r> <\n>54023 : Debug dev : sendcontent free: 185692 chunk size:407<\r> <\n>54031 : Debug dev : sendcontent free: 180728 chunk size:0<\r> <\n>60065 : Debug dev : sendcontent free: 185452 chunk size:407<\r> <\n>60074 : Debug dev : sendcontent free: 180572 chunk size:0<\r> <\n>66000 : Debug dev : sendcontent free: 185228 chunk size:407<\r> <\n>66009 : Debug dev : sendcontent free: 180348 chunk size:0<\r> <\n>68934 : Info : WD : Uptime 1 ConnectFailures 0 FreeMem 187028 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init<\r> <\n>68936 : Debug More : UDP : Send Sysinfo message<\r> <\n>68942 : Debug More : UDP : Send Sysinfo message<\r> <\n>69823 : Debug : LoopStats: shortestLoop: 51 longestLoop: 7712106 avgLoopDuration: 73.72 loopCounterMax: 588235 loopCounterLast: 402395<\r> <\n>69825 : Debug : Scheduler stats: (called/tasks/max_length/idle%) 402395/2120/7/87.86<\r> <\n>72052 : Debug dev : sendcontent free: 185020 chunk size:407<\r> <\n>72060 : Debug dev : sendcontent free: 180064 chunk size:0<\r> <\n>77989 : Debug dev : sendcontent free: 184800 chunk size:407<\r> <\n>77998 : Debug dev : sendcontent free: 179916 chunk size:0<\r> <\n>84040 : Debug dev : sendcontent free: 184580 chunk size:407<\r> <\n>84050 : Debug dev : sendcontent free: 179492 chunk size:0<\r> <\n>89968 : Debug dev : sendcontent free: 184332 chunk size:407<\r> <\n>89977 : Debug dev : sendcontent free: 179448 chunk size:0<\r> <\n>96011 : Debug dev : sendcontent free: 184128 chunk size:407<\r> <\n>96021 : Debug dev : sendcontent free: 178556 chunk size:0<\r> <\n>98933 : Info : WD : Uptime 2 ConnectFailures 0 FreeMem 185908 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init<\r> <\n>98935 : Debug More : UDP : Send Sysinfo message<\r> <\n>98941 : Debug More : UDP : Send Sysinfo message<\r> <\n>99822 : Debug : LoopStats: shortestLoop: 43 longestLoop: 7712106 avgLoopDuration: 76.45 loopCounterMax: 697674 loopCounterLast: 388164<\r> <\n>99824 : Debug : Scheduler stats: (called/tasks/max_length/idle%) 388164/2119/7/87.84<\r> <\n>102087 : Debug dev : sendcontent free: 183908 chunk size:407<\r> <\n>102097 : Debug dev : sendcontent free: 179024 chunk size:0<\r> <\n>106137 : Debug dev : Read settings: TaskSettings index: 2<\r> <\n>106156 : Debug dev : sendcontent free: 183416 chunk size:4096<\r> <\n>106208 : Debug dev : DEBUG: String size:4096<\r> <\n>106211 : Debug dev : sendcontent free: 181744 chunk size:3417<\r> <\n>106223 : Debug dev : sendcontent free: 181540 chunk size:0<\r> <\n>106303 : Info : static_file: /esp.css<\r> <\n>106304 : Debug : HTML : Request file /esp.css<\r> <\n>106409 : Debug dev : sendcontent free: 182880 chunk size:2002<\r> <\n>106419 : Debug dev : sendcontent free: 176200 chunk size:0<\r> <\n>108685 : Info : Skip saving task settings, not changed<\r> <\n><\0>108720 : Info : ESPEasy console using ESPEasySerial<\r> <\n>108722 : Info : SaveToFile: free stack: 7180<\r> <\n>108857 : Info : FILE : Saved config.dat offset: 0 size: 3028<\r> <\n>108858 : Info : SaveToFile: free stack after: 7180<\r> <\n>108859 : Info : Skip saving SecuritySettings, not changed<\r> <\n>108869 : Debug dev : Read settings: TaskSettings index: 2<\r> <\n>108888 : Debug dev : sendcontent free: 182488 chunk size:4096<\r> <\n>108937 : Debug dev : DEBUG: String size:4096<\r> <\n>108961 : Debug dev : sendcontent free: 182340 chunk size:3409<\r> <\n>108977 : Debug dev : sendcontent free: 180552 chunk size:0<\r> <\n>109047 : Info : static_file: /esp.css<\r> <\n>109070 : Debug : HTML : Request file /esp.css<\r> <\n>109124 : Debug dev : sendcontent free: 182848 chunk size:2002<\r> <\n>109133 : Debug dev : sendcontent free: 176164 chunk size:0<\r> <\n>117370 : Info : Skip saving task settings, not changed<\r> <\n><\0>117406 : Info : ESPEasy console using ESPEasySerial<\r> <\n>117407 : Info : SaveToFile: free stack: 7180<\r> <\n>117520 : Info : FILE : Saved config.dat offset: 0 size: 3028<\r> <\n>117521 : Info : SaveToFile: free stack after: 7180<\r> <\n>117522 : Info : Skip saving SecuritySettings, not changed<\r> <\n>117526 : Debug dev : Read settings: TaskSettings index: 2<\r> <\n>117564 : Debug dev : sendcontent free: 182396 chunk size:4096<\r> <\n>117612 : Debug dev : DEBUG: String size:4096<\r> <\n>117636 : Debug dev : sendcontent free: 180288 chunk size:3417<\r> <\n>117659 : Debug dev : sendcontent free: 180472 chunk size:0<\r> <\n>117719 : Info : static_file: /esp.css<\r> <\n>117742 : Debug : HTML : Request file /esp.css<\r> <\n>117848 : Debug dev : sendcontent free: 181232 chunk size:2002<\r> <\n>117858 : Debug dev : sendcontent free: 176348 chunk size:0<\r> <\n>128935 : Info : WD : Uptime 2 ConnectFailures 0 FreeMem 184660 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init<\r> <\n>128937 : Debug More : UDP : Send Sysinfo message<\r> <\n>128943 : Debug More : UDP : Send Sysinfo message<\r> <\n>129745 : Debug dev : sendcontent free: 182728 chunk size:4096<\r> <\n>129763 : Debug dev : sendcontent free: 181168 chunk size:1290<\r> <\n>129772 : Debug dev : sendcontent free: 179380 chunk size:0<\r> <\n>129824 : Debug : LoopStats: shortestLoop: 43 longestLoop: 7712106 avgLoopDuration: 78.32 loopCounterMax: 697674 loopCounterLast: 379129<\r> <\n>129825 : Debug : Scheduler stats: (called/tasks/max_length/idle%) 379129/2033/7/90.52<\r> <\n>129842 : Info : static_file: /esp.css<\r> <\n>129844 : Debug : HTML : Request file /esp.css<\r> <\n>129902 : Debug dev : sendcontent free: 182712 chunk size:2002<\r> <\n>129910 : Debug dev : sendcontent free: 176176 chunk size:0<\r> <\n>132497 : Debug dev : sendcontent free: 182756 chunk size:2504<\r> <\n>132511 : Debug dev : sendcontent free: 176068 chunk size:0<\r> <\n>132570 : Info : static_file: /esp.css<\r> <\n>132572 : Info : Serve 304: 1692297344 /esp.css<\r> <\n>132573 : Debug : HTML : Request file /esp.css<\r> <\n>141693 : Debug dev : Read settings: ControllerSettings index: 0<\r> <\n>141702 : Debug dev : Read settings: ControllerSettings index: 1<\r> <\n>141709 : Debug dev : Read settings: ControllerSettings index: 2<\r> <\n>141716 : Debug dev : sendcontent free: 180180 chunk size:2933<\r> <\n>141732 : Debug dev : sendcontent free: 178392 chunk size:0<\r> <\n>141790 : Info : static_file: /esp.css<\r> <\n>141792 : Info : Serve 304: 1692297344 /esp.css<\r> <\n>141792 : Debug : HTML : Request file /esp.css<\r> <\n>142849 : Debug dev : sendcontent free: 180072 chunk size:4096<\r> <\n>142872 : Debug dev : sendcontent free: 178140 chunk size:4096<\r> <\n>142898 : Debug dev : sendcontent free: 178488 chunk size:4096<\r> <\n>142919 : Debug dev : sendcontent free: 178588 chunk size:4096<\r> <\n>142941 : Debug dev : sendcontent free: 180172 chunk size:4096<\r> <\n>142958 : Debug dev : sendcontent free: 178588 chunk size:1613<\r> <\n>142969 : Debug dev : sendcontent free: 175068 chunk size:0<\r> <\n>143028 : Info : static_file: /esp.css<\r> <\n>143030 : Info : Serve 304: 1692297344 /esp.css<\r> <\n>143031 : Debug : HTML : Request file /esp.css<\r> <\n>149922 : Debug dev : sendcontent free: 180032 chunk size:4096<\r> <\n>149947 : Debug dev : DEBUG: String size:4096<\r> <\n>149949 : Debug dev : sendcontent free: 180084 chunk size:3589<\r> <\n>149961 : Debug dev : sendcontent free: 178292 chunk size:0<\r> <\n>150020 : Info : static_file: /esp.css<\r> <\n>150022 : Info : Serve 304: 1692297344 /esp.css<\r> <\n>150022 : Debug : HTML : Request file /esp.css<\r> <\n>151198 : Debug dev : sendcontent free: 180076 chunk size:407<\r> <\n>151206 : Debug dev : sendcontent free: 175120 chunk size:0<\r> <\n>157038 : Debug dev : sendcontent free: 180056 chunk size:407<\r> <\n>157047 : Debug dev : sendcontent free: 175172 chunk size:0<\r> <\n>158933 : Info : WD : Uptime 3 ConnectFailures 0 FreeMem 181860 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init<\r> <\n>158935 : Debug More : UDP : Send Sysinfo message<\r> <\n>158941 : Debug More : UDP : Send Sysinfo message<\r> <\n>159822 : Debug : LoopStats: shortestLoop: 43 longestLoop: 7712106 avgLoopDuration: 77.98 loopCounterMax: 697674 loopCounterLast: 380729<\r> <\n>159824 : Debug : Scheduler stats: (called/tasks/max_length/idle%) 380729/2084/7/88.66<\r> <\n>162989 : Debug dev : sendcontent free: 180056 chunk size:407<\r> <\n>163000 : Debug dev : sendcontent free: 174280 chunk size:0<\r> <\n>169015 : Debug dev : sendcontent free: 180068 chunk size:407<\r> <\n>169024 : Debug dev : sendcontent free: 175184 chunk size:0<\r> <\n>175064 : Debug dev : sendcontent free: 180044 chunk size:407<\r> <\n>175072 : Debug dev : sendcontent free: 174268 chunk size:0<\r> <\n>181038 : Debug dev : sendcontent free: 180048 chunk size:407<\r> <\n>181047 : Debug dev : sendcontent free: 175160 chunk size:0<\r> <\n>187080 : Debug dev : sendcontent free: 180044 chunk size:407<\r> <\n>187089 : Debug dev : sendcontent free: 175156 chunk size:0<\r> <\n>188933 : Info : WD : Uptime 3 ConnectFailures 0 FreeMem 181856 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init<\r> <\n>188935 : Debug More : UDP : Send Sysinfo message<\r> <\n>188941 : Debug More : UDP : Send Sysinfo message<\r> <\n>189822 : Debug : LoopStats: shortestLoop: 43 longestLoop: 7712106 avgLoopDuration: 76.24 loopCounterMax: 697674 loopCounterLast: 389251<\r> <\n>189824 : Debug : Scheduler stats: (called/tasks/max_length/idle%) 389251/2114/7/88.66<\r> <\n>193019 : Debug dev : sendcontent free: 180044 chunk size:407<\r> <\n>193028 : Debug dev : sendcontent free: 174480 chunk size:0<\r> <\n>199061 : Debug dev : sendcontent free: 180048 chunk size:407<\r> <\n>199070 : Debug dev : sendcontent free: 175160 chunk size:0<\r> <\n>204966 : Debug dev : sendcontent free: 180044 chunk size:407<\r> <\n>204975 : Debug dev : sendcontent free: 174952 chunk size:0<\r> <\n>211042 : Debug dev : sendcontent free: 180048 chunk size:407<\r> <\n>211051 : Debug dev : sendcontent free: 175160 chunk size:0<\r> <\n>217050 : Debug dev : sendcontent free: 180048 chunk size:407<\r> <\n>217059 : Debug dev : sendcontent free: 175116 chunk size:0<\r> <\n>218935 : Info : WD : Uptime 4 ConnectFailures 0 FreeMem 181856 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init<\r> <\n>218936 : Debug More : UDP : Send Sysinfo message<\r> <\n>218943 : Debug More : UDP : Send Sysinfo message<\r> <\n>219822 : Debug : LoopStats: shortestLoop: 43 longestLoop: 7712106 avgLoopDuration: 76.27 loopCounterMax: 697674 loopCounterLast: 389157<\r> <\n>219824 : Debug : Scheduler stats: (called/tasks/max_length/idle%) 389157/2113/7/88.44<\r> <\n>222983 : Debug dev : sendcontent free: 180048 chunk size:407<\r> <\n>222992 : Debug dev : sendcontent free: 175160 chunk size:0<\r> <\n>228217 : Debug dev : sendcontent free: 180048 chunk size:407<\r> <\n>228227 : Debug dev : sendcontent free: 175096 chunk size:0<\r> <\n>228932 : Debug dev : sendcontent free: 180080 chunk size:4096<\r> <\n>228951 : Debug dev : sendcontent free: 176580 chunk size:1290<\r> <\n>228962 : Debug dev : sendcontent free: 176708 chunk size:0<\r> <\n>229010 : Info : static_file: /esp.css<\r> <\n>229012 : Info : Serve 304: 1692297344 /esp.css<\r> <\n>229012 : Debug : HTML : Request file /esp.css<\r> <\n>230906 : Debug dev : sendcontent free: 180080 chunk size:2504<\r> <\n>230919 : Debug dev : sendcontent free: 173392 chunk size:0<\r> <\n>230970 : Info : static_file: /esp.css<\r> <\n>230972 : Info : Serve 304: 1692297344 /esp.css<\r> <\n>230972 : Debug : HTML : Request file /esp.css<\r> <\n>248933 : Info : WD : Uptime 4 ConnectFailures 0 FreeMem 181896 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init<\r> <\n>248935 : Debug More : UDP : Send Sysinfo message<\r> <\n>248942 : Debug More : UDP : Send Sysinfo message<\r> <\n>249823 : Debug : LoopStats: shortestLoop: 43 longestLoop: 7712106 avgLoopDuration: 76.74 loopCounterMax: 697674 loopCounterLast: 386830<\r> <\n>249825 : Debug : Scheduler stats: (called/tasks/max_length/idle%) 386830/2113/7/88.93<\r> <\n>278934 : Info : WD : Uptime 5 ConnectFailures 0 FreeMem 181896 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init<\r> <\n>278936 : Debug More : UDP : Send Sysinfo message<\r> <\n>278944 : Debug More : UDP : Send Sysinfo message<\r> <\n>279822 : Debug : LoopStats: shortestLoop: 43 longestLoop: 7712106 avgLoopDuration: 75.06 loopCounterMax: 697674 loopCounterLast: 395181<\r> <\n>279824 : Debug : Scheduler stats: (called/tasks/max_length/idle%) 395181/2138/7/88.18<\r> <\n>282702 : Debug dev : sendcontent free: 180108 chunk size:4096<\r> <\n>282724 : Debug dev : sendcontent free: 178524 chunk size:1290<\r> <\n>282733 : Debug dev : sendcontent free: 176940 chunk size:0<\r> <\n>282792 : Info : static_file: /esp.css<\r> <\n>282794 : Info : Serve 304: 1692297344 /esp.css<\r> <\n>282795 : Debug : HTML : Request file /esp.css<\r> <\n>284856 : Debug dev : sendcontent free: 180092 chunk size:4096<\r> <\n>284879 : Debug dev : sendcontent free: 178476 chunk size:4096<\r> <\n>284901 : Debug dev : sendcontent free: 179964 chunk size:4096<\r> <\n>284921 : Debug dev : sendcontent free: 178404 chunk size:4096<\r> <\n>284944 : Debug dev : sendcontent free: 178348 chunk size:4096<\r> <\n>284961 : Debug dev : sendcontent free: 180092 chunk size:1385<\r> <\n>284972 : Debug dev : sendcontent free: 178304 chunk size:0<\r> <\n>285021 : Info : static_file: /esp.css<\r> <\n>285022 : Info : Serve 304: 1692297344 /esp.css<\r> <\n>285023 : Debug : HTML : Request file /esp.css<\r> <\n>308934 : Info : WD : Uptime 5 ConnectFailures 0 FreeMem 181876 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init<\r> <\n>308936 : Debug More : UDP : Send Sysinfo message<\r> <\n>308943 : Debug More : UDP : Send Sysinfo message<\r> <\n>309822 : Debug : LoopStats: shortestLoop: 43 longestLoop: 7712106 avgLoopDuration: 75.90 loopCounterMax: 697674 loopCounterLast: 391385<\r> <\n>309824 : Debug : Scheduler stats: (called/tasks/max_length/idle%) 391385/2119/7/86.98<\r> <\n>338933 : Info : WD : Uptime 6 ConnectFailures 0 FreeMem 181352 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init<\r> <\n>338935 : Debug More : UDP : Send Sysinfo message<\r> <\n>338941 : Debug More : UDP : Send Sysinfo message<\r> <\n>339822 : Debug : LoopStats: shortestLoop: 43 longestLoop: 7712106 avgLoopDuration: 74.86 loopCounterMax: 697674 loopCounterLast: 396419<\r> <\n>339824 : Debug : Scheduler stats: (called/tasks/max_length/idle%) 396419/2138/7/88.01<\r> <\n>368934 : Info : WD : Uptime 6 ConnectFailures 0 FreeMem 184584 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init<\r> <\n>368936 : Debug More : UDP : Send Sysinfo message<\r> <\n>368942 : Debug More : UDP : Send Sysinfo message<\r> <\n>369822 : Debug : LoopStats: shortestLoop: 43 longestLoop: 7712106 avgLoopDuration: 73.42 loopCounterMax: 697674 loopCounterLast: 403295<\r> <\n>369824 : Debug : Scheduler stats: (called/tasks/max_length/idle%) 403295/2138/7/88.87<\r> <\n>398933 : Info : WD : Uptime 7 ConnectFailures 0 FreeMem 184584 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init<\r> <\n>398935 : Debug More : UDP : Send Sysinfo message<\r> <\n>398944 : Debug More : UDP : Send Sysinfo message<\r> <\n>399822 : Debug : LoopStats: shortestLoop: 43 longestLoop: 7712106 avgLoopDuration: 73.42 loopCounterMax: 697674 loopCounterLast: 403288<\r> <\n>399824 : Debug : Scheduler stats: (called/tasks/max_length/idle%) 403288/2138/7/88.80<\r> <\n>

image

mpl1337 commented 1 year ago

maybe you want try it with teamviewer?

TD-er commented 1 year ago

Looks like the task isn't being run.

Can you explicitly 'run' that task via the command line field on the tools page

taskrun,<tasknr>

With the tasknr being the task index as shown on the Devices page.

For example for task nr 2:

taskrun,2

And keep a tab open with the web log view.

mpl1337 commented 1 year ago

743694: sendcontent free: 185792 chunk size:283 743702: sendcontent free: 180828 chunk size:0 744127: sendcontent free: 185664 chunk size:4096 744144: sendcontent free: 180840 chunk size:1290 744153: sendcontent free: 182156 chunk size:0 744234: static_file: /esp.css 744236: Serve 304: 1692346990 /esp.css 744236: HTML : Request file /esp.css 745600: sendcontent free: 185220 chunk size:4096 745615: sendcontent free: 183572 chunk size:1504 745621: sendcontent free: 174836 chunk size:0 745729: static_file: /esp.css 745730: Serve 304: 1692346990 /esp.css 745731: HTML : Request file /esp.css 746903: sendcontent free: 185704 chunk size:1218 746911: sendcontent free: 180732 chunk size:0 748091: sendcontent free: 185696 chunk size:283 748099: sendcontent free: 180732 chunk size:0 748204: sendcontent free: 185544 chunk size:405 748212: sendcontent free: 180580 chunk size:0 750246: sendcontent free: 185696 chunk size:450 750254: sendcontent free: 180732 chunk size:0 750570: HTTP: taskrun,1 750572: HTTP after parseTemplate: taskrun,1 750575: Command: taskrun 750575: taskrun,1 750576: Par1: 1 Par2: 0 Par3: 0 Par4: 0 Par5: 0 750596: sendcontent free: 185316 chunk size:4096 750612: sendcontent free: 183668 chunk size:1389 750619: sendcontent free: 178512 chunk size:0 750914: static_file: /esp.css 750915: Serve 304: 1692346990 /esp.css 750916: HTML : Request file /esp.css 752095: sendcontent free: 185688 chunk size:1090 752103: sendcontent free: 180736 chunk size:0

0.00

tonhuisman commented 1 year ago

I've put an ADS1115 board on my breadboard for testing, this is what I get: image

Settings: image

Code is current mega branch for P025 Analog input - ADS1115. So IMHO, most likely not a software issue.

Also switched to use I2C address 0x49, and all is still working peachy fine 😃 Edit: Tried with 2/3x gain (FS=6.144V) setting on AIN0 and AIN3, and got similar values (as is to be expected).

mpl1337 commented 1 year ago

Build: ESP_Easy_mega_20230817_normal_ESP32_4M316k Aug 17 2023

8 9 10

not working.

When i go back to Build: [ESP_Easy_mega_20230306_normal_ESP32_4M316k Mar 6 2023] it works. Hardware is untouched

tonhuisman commented 1 year ago

Can you download the most recent merge build for mega from this Actions run, to see if that makes a difference? As that's what I'm effectively using (I always make my own builds, based on latest mega branch, as I'm developing plugins and other features for EPEasy)

TD-er commented 1 year ago

I have made a very 'professional looking' setup to test it... image

image

The pins have 3 resistors from 3V3 ... GND. When I switch GND and 3V3 to these resistors, I get this: image

image

So it is working here...

TD-er commented 1 year ago

The only thing I can think of is that the I2C address handling may be wrong???

tonhuisman commented 1 year ago

Well, I tried on both 0x48 and 0x49 (just connect ADDR to VCC, like in the OP), and both worked fine. Address 0x4A is the one to avoid, as that requires the SDA signal to stay low for some minimal amount of time to be properly recognized, from the datasheet: If SDA is used as the device address, hold the SDA line low for at least 100 ns after the SCL line goes low to make sure the device decodes the address correctly during I2C communication.

TD-er commented 1 year ago

Hmm I noticed the original issue is on ESP32, so I will rewire my setup for ESP32 to make sure there isn't something fishy in the latest ESP32 SDK...

"One moment please" as some Youtuber may say :)

tonhuisman commented 1 year ago

I've done my testing on an ESP32-C3.

TD-er commented 1 year ago

Fresh install on ESP32 (including flash erase, just to be sure) Installes from here: https://td-er.nl/ESPEasy/latest/

image

mpl1337 commented 1 year ago

ok, i need to order some new ADS1115.

i have connected a second ADS1115 and add an BH1750 to the i2c Bus.

The BH1750 works fine. Both ADS 0.00 11 12 IMG_20230818_124253

TD-er commented 1 year ago

Not sure if a new one will help here, as you've shown it was working with the older build and the Arduino test code.

Maybe you should try it with only 1 board? I don't know what may happen if you have 2 boards with different I2C addresses set, but perhaps the set I2C address isn't that clearly set. So maybe you're simply getting replies from both modules and thus it is considered to be a non-valid reply and thus no update. On the older builds, there was an issue where we didn't check whether the received value was unambiguously valid, which resulted in a 'shift' of readings. So the measurement from one pin was assigned to the other task.

mpl1337 commented 1 year ago

2 ADS was my last test.

Is there a way to insert a debug line in the code to get the raw value from the ADS on the serial?

Which environment i need to compile the binary by myself?

TD-er commented 1 year ago

I have the IDE open here, so what build do you need? I can add some debug code (INFO log level, so you're not flooded with logs)

TD-er commented 1 year ago
bool P025_data_struct::read(float& value) const {
  if (!waitReady025(5)) { 
    addLog(LOG_LEVEL_INFO, F("ADS1115: Not Ready at start read"));
    return false; 
  }

  if (!I2C_write16_reg(_i2cAddress, P025_CONFIG_REGISTER, _configRegisterValue)) {
    addLog(LOG_LEVEL_INFO, F("ADS1115: Start measurement failed"));
    return false;
  }

  // See https://github.com/letscontrolit/ESPEasy/issues/3159#issuecomment-660546091
  if (!waitReady025(10)) { 
    addLog(LOG_LEVEL_INFO, F("ADS1115: Not Ready after start measurement"));

    return false; 
  }

  int16_t raw = 0;
  if (!readConversionRegister025(raw)) {
    addLog(LOG_LEVEL_INFO, F("ADS1115: Cannot read from conversion register"));
    return false;
  }

  value = _fullScaleFactor * raw;
  addLog(LOG_LEVEL_INFO, strformat(F("ADS1115: RAW value: %d, output value: %f"), raw, value));
  return true;
}

Testbuild including these changes

mpl1337 commented 1 year ago

INIT : Booting version: ESP_Easy_mega_20230818_energy_ESP32_4M316k, (Self built) bugfix/DefaultTaskVarNames_57975f0 (ESP32 SDK 4.4.5.230614)<\r> <\n>193 : Info : INIT : Free RAM:244192<\r> <\n>194 : Info : INIT : Cold Boot - Restart Reason: CPU0: Vbat power on reset CPU1: for APP CPU, reset by PRO CPU<\r> <\n>195 : Info : FS : Mounting...<\r> <\n>219 : Info : FS : Mount successful, used 141815 bytes of 290156<\r> <\n>235 : Info : CRC : Settings CRC ...OK<\r> <\n>270 : Info : ESPEasy console using ESPEasySerial<\r> <\n>285 : Info : CRC : SecuritySettings CRC ...OK <\r> <\n><\0>332 : Info : ESPEasy console using ESPEasySerial<\r> <\n>334 : Info : INIT : I2C<\r> <\n>336 : Info : INIT : Check for Priority tasks<\r> <\n>338 : Info : INIT : SPI not enabled<\r> <\n>339 : Info : Set Network mode: WiFi<\r> <\n>442 : Info : WIFI : Set WiFi to STA<\r> <\n>549 : Info : WiFi : Event STA Started<\r> <\n>651 : Info : WiFi : Start network scan all channels<\r> <\n>6867 : Info : WiFi : Scan finished, found: 5<\r> <\n>6869 : Info : WiFi : Best AP candidate: TP-Link_2FC8 6C:5A:B0:70:2F:C8 Ch:2 (-70dBm) - bgn<\r> <\n>6871 : Info : WiFi : Added known candidate, try t<\0>o connect<\r> <\n>6872 : Info : WiFi : Best AP candidate: TP-Link_2FC8 6C:5A:B0:70:2F:C8 Ch:2 (-70dBm) - bgn<\r> <\n>6907 : Info : ESPEasy console using ESPEasySe<\0>rial<\r> <\n>6908 : Info : INIT : Free RAM:194536<\r> <\n>6963 : Info : ESPEasy console using ESPEasySerial<\r> <\n>6965 : Info : INFO : Plugins: 60 [Normal][Energy] (ESP32 SDK 4.4.5.230614)<\r> <\n>6968 : Info : WiFi : Best AP candidate: TP-Link_2FC8 6C:5A:B0:70:2F:C8 Ch:2 (-70dBm) - bgn<\r> <\n>6969 : Info : WIFI : Connecting TP-Link_2FC8 6C:5A:B0:70:2F:C8 Ch:2 (-70dBm) - bgn attempt #0<\r> <\n>6979 : Info : WIFI : Arduino wifi status: WL_DISCONNECTED 6 ESPeasy internal wifi status: DISCONNECTED<\r> <\n>7807 : Info : Webserver: start<\r> <\n>7896 : Info : ADS1115: Not Ready after start measurement<\r> <\n>8461 : Info : ADS1115: Not Ready after start measurement<\r> <\n>8491 : Info : WIFI : Connected! AP: TP-Link_2FC8 (6C:5A:B0:70:2F:C8) Ch: 2 Duration: 1503 ms<\r> <\n>8493 : Info : WIFI : Arduino wifi status: WL_IDLE_STATUS 0 ESPeasy internal wifi status: Conn. <\r> <\n>8501 : Info : WIFI : DHCP IP: 192.168.178.125 (Energy) GW: 192.168.178.1 SN: 255.255.255.0 DNS: 192.168.178.62 / 0.0.0.0 duration: 26 ms<\r> <\n>8529 : Info : mDNS : Starting mDNS...<\r> <\n>8534 : Info : mDNS : Started, with name: Energy.local<\r> <\n>8659 : Info : NTP : NTP replied: delay 31 mSec Accuracy increased by 374 msec<\r> <\n>8675 : Info : mDNS : Starting mDNS...<\r> <\n>8679 : Info : mDNS : Started, with name: Energy.local<\r> <\n>8691 : Info : Time set to 1692358168.374<\r> <\n>8692 : Info : Current Time Zone: STD time start: 2023-10-29 03:00:00 offset: 0 min<\r> <\n>8694 : Info : Local time: 2023-08-18 11:29:28<\r> <\n>8703 : Info : UDP : Start listening on port 8266<\r> <\n>8704 : Info : firstLoopConnectionsEstablished<\r> <\n>9042 : Info : ADS1115: Not Ready after start measurement<\r> <\n>9154 : Info : WD : Uptime 0 ConnectFailures 0 FreeMem 178176 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init<\r> <\n>10042 : Info : ADS1115: Not Ready after start measurement<\r> <\n>11042 : Info : ADS1115: Not Ready after start measurement<\r> <\n>12042 : Info : ADS1115: Not Ready after start measurement<\r> <\n>13042 : Info : ADS1115: Not Ready after start measurement<\r> <\n>14042 : Info : ADS1115: Not Ready after start measurement<\r> <\n>15042 : Info : ADS1115: Not Ready after start measurement<\r> <\n>16042 : Info : ADS1115: Not Ready after start measurement<\r> <\n>17042 : Info : ADS1115: Not Ready after start measurement<\r> <\n>18042 : Info : ADS1115: Not Ready after start measurement<\r> <\n>19042 : Info : ADS1115: Not Ready after start measurement<\r> <\n>20042 : Info : ADS1115: Not Ready after start measurement<\r> <\n>21042 : Info : ADS1115: Not Ready after start measurement<\r> <\n>22042 : Info : ADS1115: Not Ready after start measurement<\r> <\n>23042 : Info : ADS1115: Not Ready after start measurement<\r> <\n>24042 : Info : ADS1115: Not Ready after start measurement<\r> <\n>25042 : Info : ADS1115: Not Ready after start measurement<\r>

TD-er commented 1 year ago

OK, so that 10 msec may be too low here? Which is surprising, but possible.

I'll make a build with it set to 20 msec, which should be more then enough.

TD-er commented 1 year ago

New test build

mpl1337 commented 1 year ago

INIT : Booting version: ESP_Easy_mega_20230818_energy_ESP32_4M316k, (Self built) bugfix/DefaultTaskVarNames_57975f0 (ESP32 SDK 4.4.5.230614)<\r> <\n>194 : Info : INIT : Free RAM:244192<\r> <\n>195 : Info : INIT : Cold Boot - Restart Reason: CPU0: Vbat power on reset CPU1: for APP CPU, reset by PRO CPU<\r> <\n>196 : Info : FS : Mounting...<\r> <\n>220 : Info : FS : Mount successful, used 141815 bytes of 290156<\r> <\n>236 : Info : CRC : Settings CRC ...OK<\r> <\n>272 : Info : ESPEasy console using ESPEasySerial<\r> <\n>287 : Info : CRC : SecuritySettings CRC ...OK <\r> <\n><\0>334 : Info : ESPEasy console using ESPEasySerial<\r> <\n>336 : Info : INIT : I2C<\r> <\n>338 : Info : INIT : Check for Priority tasks<\r> <\n>340 : Info : INIT : SPI not enabled<\r> <\n>341 : Info : Set Network mode: WiFi<\r> <\n>444 : Info : WIFI : Set WiFi to STA<\r> <\n>551 : Info : WiFi : Event STA Started<\r> <\n>653 : Info : WiFi : Start network scan all channels<\r> <\n>7069 : Info : WiFi : Scan finished, found: 5<\r> <\n>7071 : Info : WiFi : Best AP candidate: TP-Link_2FC8 6C:5A:B0:70:2F:C8 Ch:2 (-68dBm) - bgn<\r> <\n>7073 : Info : WiFi : Added known candidate, try t<\0>o connect<\r> <\n>7074 : Info : WiFi : Best AP candidate: TP-Link_2FC8 6C:5A:B0:70:2F:C8 Ch:2 (-68dBm) - bgn<\r> <\n>7109 : Info : ESPEasy console using ESPEasySe<\0>rial<\r> <\n>7110 : Info : INIT : Free RAM:194584<\r> <\n>7165 : Info : ESPEasy console using ESPEasySerial<\r> <\n>7167 : Info : INFO : Plugins: 60 [Normal][Energy] (ESP32 SDK 4.4.5.230614)<\r> <\n>7170 : Info : WiFi : Best AP candidate: TP-Link_2FC8 6C:5A:B0:70:2F:C8 Ch:2 (-68dBm) - bgn<\r> <\n>7171 : Info : WIFI : Connecting TP-Link_2FC8 6C:5A:B0:70:2F:C8 Ch:2 (-68dBm) - bgn attempt #0<\r> <\n>7184 : Info : WIFI : Arduino wifi status: WL_DISCONNECTED 6 ESPeasy internal wifi status: DISCONNECTED<\r> <\n>8006 : Info : Webserver: start<\r> <\n>8021 : Info : WIFI : Disconnected! Reason: '(202) Auth fail' Connected for 846 ms<\r> <\n>8035 : Info : WiFi : Event STA Stopped<\r> <\n>8124 : Info : WIFI : Connecting TP-Link_2FC8 6C:5A:B0:70:2F:C8 Ch:2 (-68dBm) - bgn attempt #1<\r> <\n>8136 : Info : WiFi : Event STA Started<\r> <\n>9030 : Info : ADS1115: Not Ready after start measurement<\r> <\n>9287 : Info : ADS1115: Not Ready after start measurement<\r> <\n>9383 : Info : WD : Uptime 0 ConnectFailures 0 FreeMem 185584 WiFiStatus WL_DISCONNECTED 6 ESPeasy internal wifi status: DISCONNECTED<\r> <\n>11281 : Info : ADS1115: Not Ready after start measurement<\r> <\n>13277 : Info : ADS1115: Not Ready after start measurement<\r> <\n>15283 : Info : ADS1115: Not Ready after start measurement<\r> <\n>17302 : Info : ADS1115: Not Ready after start measurement<\r> <\n>19276 : Info : ADS1115: Not Ready after start measurement<\r> <\n>21294 : Info : ADS1115: Not Ready after start measurement<\r> <\n>23290 : Info : ADS1115: Not Ready after start measurement<\r> <\n>25273 : Info : ADS1115: Not Ready after start measurement<\r> <\n>27292 : Info : ADS1115: Not Ready after start measurement<\r> <\n>28144 : Info : WIFI : Arduino wifi status: WL_DISCONNECTED 6 ESPeasy internal wifi status: DISCONNECTED<\r> <\n>28145 : Info : WiFi : WifiDisconnect()<\r> <\n>28249 : Info : WIFI : Disconnected! Reason: '(1) Unspecified'<\r> <\n>28350 : Info : Reset WiFi.<\r> <\n>28353 : Info : WiFi : Start network scan all channels<\r> <\n>34368 : Info : WiFi : Scan finished, found: 3<\r> <\n>34371 : Info : WiFi : Best AP candidate: TP-Link_2FC8 6C:5A:B0:70:2F:C8 Ch:2 (-67dBm) - bgn<\r> <\n>34372 : Info : WiFi : Added known candidate, try to connect<\r> <\n>34373 : Info : WiFi : WifiDisconnect()<\r> <\n>34477 : Info : WIFI : Disconnected! Reason: '(1) Unspecified'<\r> <\n>34479 : Info : WIFI : Arduino wifi status: WL_DISCONNECTED 6 ESPeasy internal wifi status: DISCONNECTED<\r> <\n>34580 : Info : WIFI : Set WiFi to OFF<\r> <\n>34899 : Info : WIFI : Set WiFi to STA<\r> <\n>34911 : Info : WiFi : Event STA Started<\r> <\n>35013 : Info : WIFI : Connecting TP-Link_2FC8 6C:5A:B0:70:2F:C8 Ch:2 (-67dBm) - bgn attempt #2<\r> <\n>35978 : Info : ADS1115: Not Ready after start measurement<\r> <\n>36457 : Info : ADS1115: Not Ready after start measurement<\r> <\n>36505 : Info : ADS1115: Not Ready after start measurement<\r> <\n>36553 : Info : ADS1115: Not Ready after start measurement<\r> <\n>36560 : Info : WIFI : Connected! AP: TP-Link_2FC8 (6C:5A:B0:70:2F:C8) Ch: 2 Duration: 1497 ms<\r> <\n>36561 : Info : WIFI : Arduino wifi status: WL_CONNECTED 3 ESPeasy internal wifi status: Conn. <\r> <\n>36563 : Info : WIFI : DHCP IP: 192.168.178.125 (Energy) GW: 192.168.178.1 SN: 255.255.255.0 DNS: 192.168.178.62 / 0.0.0.0 duration: 28 ms<\r> <\n>36592 : Info : mDNS : Starting mDNS...<\r> <\n>36598 : Info : mDNS : Started, with name: Energy.local<\r> <\n>36679 : Info : UDP : Start listening on port 8266<\r> <\n>36680 : Info : firstLoopConnectionsEstablished<\r> <\n>36729 : Info : NTP : NTP replied: delay 31 mSec Accuracy increased by 409 msec<\r> <\n>36745 : Info : mDNS : Starting mDNS...<\r> <\n>36748 : Info : mDNS : Started, with name: Energy.local<\r> <\n>36760 : Info : Time set to 1692359144.410<\r> <\n>36761 : Info : Current Time Zone: STD time start: 2023-10-29 03:00:00 offset: 0 min<\r> <\n>36763 : Info : Local time: 2023-08-18 11:45:44<\r> <\n>37255 : Info : ADS1115: Not Ready after start measurement<\r> <\n>39254 : Info : ADS1115: Not Ready after start measurement<\r> <\n>39353 : Info : WD : Uptime 1 ConnectFailures 0 FreeMem 177596 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init<\r> <\n>41254 : Info : ADS1115: Not Ready after start measurement<\r> <\n>43255 : Info : ADS1115: Not Ready after start measurement<\r> <\n>45254 : Info : ADS1115: Not Ready after start measurement<\r>

TD-er commented 1 year ago

OK, so it isn't about the timeout, but rather receiving either an error from sending the read command to check if it is ready, or the nr of bytes received is wrong.

How is this chip connected to the I2C bus? If you're using a level converter here, maybe this adds some delay?

Can you try to set this task to use "slow I2C clock"? On the Hardware tab you can define what should be the slow clock (default 100 kHz)

mpl1337 commented 1 year ago

IMG_20230818_135317

No lvl shifter. Minimal jumper wires

Slow i2c clock with 50,100,200 same

mpl1337 commented 1 year ago

i have tested it on a NODEMCU esp8266 Board. Same Problem. i Thing these ADS1115 are some Bad fakes.

TD-er commented 1 year ago

Another testbuild

Main change is that I now allow for !is_ok as long as the timeout has not been reached.

bool P025_data_struct::waitReady025(unsigned long timeout_ms) const {
  const unsigned long timeout = millis() + timeout_ms;
  while (!timeOutReached(timeout)) {
    // bit15=0 performing a conversion   =1 not performing a conversion
    bool is_ok = false;
    const bool ready = (I2C_read16_reg(_i2cAddress, P025_CONFIG_REGISTER, &is_ok) & 0x8000) != 0;

    if (ready && is_ok) { return true; }
    delay(1);
  }
  return false;
}
mpl1337 commented 1 year ago

Not working.

Im sure that's my Ads1115 is a fake. It is a ADS1015. They changed only the name and selled the cheaper 1015 as 1115. The label on my 1115 is not readable. I think they scretched it down because a fake.