arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
22.04k stars 4.78k forks source link

Multiple TempSensors (DHT22 or DS18b20) on MULTIPLE GPIO's do not work #1109

Closed maxtox closed 6 years ago

maxtox commented 6 years ago

Hi,

just finished investigation about NOT working DS18b20.

I noticed, that if i select f.e. FPIO14=DS18b20 AND GPIO3=ds18b20 then i CAN NOT see any Values.

If i select only ONE GPIO as DS18B20 it works as it shoud!

Could you please advice? I can help with needed LOG etc..

Thank you !

arendst commented 6 years ago

As designed. Only one GPIO may be configured as DS18B20 as the code just doesn't support more GPIO's.

Also read https://github.com/arendst/Sonoff-Tasmota/wiki/Sensor-Configuration about support of sensors per group.

maxtox commented 6 years ago

maybe we can change the option for choosing GPIO's to exclude the same Type of sensor if already choosen?

arendst commented 6 years ago

Thought about it but that means that on the client side a lot of checks need to be programmed which take up code space to be used for more important features.

maxtox commented 6 years ago

ok...i see...

just one question...could you point to the line, which says that "Only one GPIO may be configured as DS18B20"...did not find it..

maxtox commented 6 years ago

i am asking, just to make sure, that another NOOB does not ask the same again to save you time for "coding etc..."

Sorry!

arendst commented 6 years ago

Line 9.

maxtox commented 6 years ago

Only one sensor per group is allowed.

says to me: I can attach ONE sensor for EACH Group. F.e. One ds18b20, onde FHT22, etc... But as i understood, it is not correct. It should say:

EACH sensor TYPE can be configured ONLY ON ONE GPIO per Device. NO GPIO's can be configured to the ALREADY EXISTING SENSOR TYPE, o rit should be deleted (set to "NONE") before the Sensor type can be configured to the other GPIO.

What do u think?

maxtox commented 6 years ago

I can attache multiple DS18b20 to ONE GPIO? or not?

arendst commented 6 years ago

Yes.

That info is different from the wiki that needs an update on this information.

maxtox commented 6 years ago

Cool...

thank you ...just found it:

define USE_DS18x20 // Optional using OneWire library for multiple DS18B20 and/or DS18S20 (+2k code)

maxtox commented 6 years ago

ok...you can close it then!

YOU ARE THE VERY BEST!!! If you need any support, please contact me! Just trying to implement K-Type Temp sensor!

userweb2018 commented 5 years ago

Hi, I have a wemos d1 mini with Tasmota firmware and 11 ds18b20 sensors connected to 1-wire bus with 4.7 resistor. The problem is that I can read only 8 sensors maximum. This is the limit?

ascillato commented 5 years ago

Yes

reneb24 commented 5 years ago

I have to connect 28 x ds18b20 sensors at one esp8266. With 8 sensors all is working fine, attaching 8 more sensors I get values from only 8 sensors the additional values are dropped in the Web-Gui and in the MQTT SENSOR payload.

Is there a way to extend the maximum amount of theses temperature sensors? i.e. to loop over all connected sensors and print them out in the Web GUI and assemble the MQTT payload accordingly.

arendst commented 5 years ago

@reneb24 It supports up to 8 sensors. If you want more you'll have to rewrite the driver xsns_05_ds18x20.ino

userweb2018 commented 5 years ago

I have the same problem and I wold like to connect more ds18b20 sensors to the wemos d1 mini with Tasmota firmware... I am not able to rewrite the driver, there is some one that allready done it? If yes can I have the modified driver? Thank you for all the good work that you do. Best regards Userweb

korneliuszm commented 5 years ago

How I can read more then 4 Ds18b20 on one gpio? I enabled multiple sensor option, but still it's working only if I connect not more then 4 sensor, when I need to connect 7 of them... Best regards

Ok, I figured it out, I have to week pull up for eight sensors.

reneb24 commented 5 years ago

Hi @arendst, I tried to follow your advise and figured out that xsns_05_ds18x20.ino is defines a parameter DS18X20_MAX_SENSORS 8 .

I updated DS18X20_MAX_SENSORS to the value 16 and built a new firmware.bin. After flashing it to an esp8266 I attached 16 sensors. The Tasmota Web-GUI showed all 16 sensors, but the MQTT payload was cut in the middle of the 16th sensor:

...
"DS18B20-15":{"Id":"0316B1C379FF","Temperature":25.7},"DS18B20-16":{"Id":"0316B1C443FF","Temperat

When I increase the DS18X20_MAX_SENSORS to 28 and attached 18 sensors, the sensor value list of the Tasmota main page will also be cut, here it breaks in the middle of the 19th sensor.

I guess that the MQTT payload string is limited to any value as well as the sensor value-list on the Tasmota main page. As I do not have any C++ experience I can't figure out where else I have to update the code and if there might be any sideeffects.

Could anybody do the investigation?

austrisv commented 4 years ago

I updated DS18X20_MAX_SENSORS to the value 16 and built a new firmware.bin. After flashing it to an esp8266 I attached 16 sensors. The Tasmota Web-GUI showed all 16 sensors, but the MQTT payload was cut in the middle of the 16th sensor

I have a similar experience. I changed MAX to 16. Although have physically attached 11. Seeing all 11 on webgui, but mqtt cut at middle of 11th: {"Time":"2020-01-14T21:10:07","ENERGY":{"TotalStartTime":"2020-01-14T20:12:36","Total":0.000,"Yesterday":0.000,"Today":0.000,"Period":0,"Power":[1,1],"ApparentPower":[18,18],"ReactivePower":[18,18],"Factor":[0.05,0.04],"Frequency":[50,50],"Voltage":[239,239],"Current":[0.077,0.076]},"DS18B20-1":{"Id":"00000A10AB9B","Temperature":22.7},"DS18B20-2":{"Id":"00000B98588B","Temperature":21.3},"DS18B20-3":{"Id":"00000B985D48","Temperature":21.2},"DS18B20-4":{"Id":"00000B988548","Temperature":21.3},"DS18B20-5":{"Id":"00000B98D64C","Temperature":21.3},"DS18B20-6":{"Id":"00000B990C38","Temperature":21.3},"DS18B20-7":{"Id":"00000B994547","Temperature":21.4},"DS18B20-8":{"Id":"00000B9962FD","Temperature":21.2},"DS18B20-9":{"Id":"00000B9A3196","Temperature":21.4},"DS18B20-10":{"Id":"00000B9A31F7","Temperature":21.3},"DS18B20-11":{"Id":"00000B If it changes anything, I also have two PZEM-004t attached/configured to the same esp, reporting the power consumption. Tasmota 8.1.0. Sonoff Basic R3 (esp8285)

EDIT: with TempRes 2 it cuts 11 symbols earlier: .."DS18B20-11":{"I

P.S. the story is interesting, how I accidentally got to the scenario ... beeing so happy using Tasmota fw for my smart home and eventually started suggesting it to others ... so here came the need for dozen temp point monitoring. Came over the limit of 8 sensors ... and was happy seeing smbdy else having similar interest :D

gampam2000 commented 4 years ago

If I compile it new I get no temperature reading at all. It shows all my 11 sensors and the IDs but no temperature. I even tried it with 8 Sensors, same issue. Did someone had similar problems?

8:58:09 RSL: tele/tasmota_DA5C0C/SENSOR = {"Time":"2020-02-12T18:58:09","DS18B20-1":{"Id":"0114328A45AE","Temperature":},"DS18B20-2":{"Id":"0114328C2E71","Temperature":},"DS18B20-3":{"Id":"011432920752","Temperature":},"DS18B20-4":{"Id":"01143292F278","Temperature":},"DS18B20-5":{"Id":"01143296BB99","Temperature":},"DS18B20-6":{"Id":"011432970323","Temperature":},"DS18B20-7":{"Id":"011432A399D8","Temperature":},"DS18B20-8":{"Id":"011432A3CD81","Temperature":},"TempUnit":"C"}