vitotai / BrewPiLess

Use an ESP8266 to replace RPI and Arduino. Running BrewPi without Pi, therefore, BrewPi-Less
358 stars 135 forks source link

Sonoff TH 16 Elite cannot detect temp sensor #437

Closed zandegran closed 1 month ago

zandegran commented 1 month ago

The temp probe data should be at GPIO25. I changed the config to reflect this. Changed oneWirePin from 23 to 25 in Config.h. GPIO27 gives power to the sensor so added the following to void brewpi_setup() in BrewPiLess.cpp

void brewpi_setup()
{
  pinMode(27, OUTPUT); 
  digitalWrite(27, LOW);
  pinMode(13, OUTPUT); 
  digitalWrite(13, LOW); // Green status Led
  ....
}

The LED is turning on but the temperature sensor is not detected. My changes: https://github.com/vitotai/BrewPiLess/compare/master...zandegran:BrewPiLess:wip-sonoff-th-16-elite

vitotai commented 1 month ago

I don't think GPIO would give enough power to OneWire Device. According to my limited experience, even 3.3V from ESP32 didn't work well. I am NO hardware expert, though.

lalo-uy commented 1 month ago

18B20 works well from 3 to 5v. It depends on the wire length. No problem with 2m and a 3k3 pullup. They stuck from time to time, so is a good option power from gpio and be aple to remote reset the sensor.

El El lun, 21 oct. 2024 a la(s) 02:45, vitotai @.***> escribió:

I don't think GPIO would give enough power to OneWire Device. According to my limited experience, even 3.3V from ESP32 didn't work well. I am NO hardware expert, though.

— Reply to this email directly, view it on GitHub https://github.com/vitotai/BrewPiLess/issues/437#issuecomment-2425642143, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACXBW4JAAGQVGACOR3FSCTLZ4SIHFAVCNFSM6AAAAABQHXRQNCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMRVGY2DEMJUGM . You are receiving this because you are subscribed to this thread.Message ID: @.***>

zandegran commented 1 month ago

This is standard 1.5m cable that came with the sonoff th16 elite device. i didn't check if it worked with the original firmware.. @lalo-uy the sonoff sensor has pullup built in.

I updated the one-wire lib to 2.3.8 and added the line #define ARDUINO_ARCH_ESP32 true to config.h I guess this should fix some timing issue with some of the sensors. Still no improvement. https://github.com/PaulStoffregen/OneWire/blob/master/OneWire.cpp#L151

I don't think GPIO would give enough power to OneWire Device. According to my limited experience, even 3.3V from ESP32 didn't work well. I am NO hardware expert, though.

jonathanschneider commented 1 month ago

I have a Sonoff TH Origin that I'm trying to get to work at the moment. The sensor I received isn't just a DS18B20. There is another microcontroller installed in the cable and I believe from there on it's not OneWire anymore. Does your temp sensor cable also have a little box in it?

zandegran commented 1 month ago

Ohh I didn't know that.. Yes it does... I was already thinking of buying a RJ11 to TRS adapter that Sonoff sells so that I can test with sensor that I know works. I was using Sonoff TH16 before. I have sensors from that.

zandegran commented 1 month ago

Bingo! I spliced the old device and everything is working... Big thanks @jonathanschneider I have a version where Red led indicates power Blue led indicates wifi connection Green led indicates cooler/heater(relay) on

I will receive oled-lcd tomorrow... I will create a PR once I get that working

zandegran commented 1 month ago

So, technically the Sonoff AL010 2.5mm Audio Jack to RJ9 Adapter could work with old sensor which are still easy to find. Or remove the in-line micro controller in newer sensor which involves splicing wires.

zandegran commented 1 month ago

IMG_4633 Large

jonathanschneider commented 1 month ago

Nice job! I'm looking forward to that PR!

zandegran commented 1 month ago

@jonathanschneider Here is the PR https://github.com/vitotai/BrewPiLess/pull/438 it would be nice if you can confirm if it works in origin as well

jonathanschneider commented 4 weeks ago

@zandegran I realized that the pinout between the TH Elite 16/TH Origin 16 and TH Elite 20/TH Origin 20 is different. Looking at your PR I believe you have a TH Elite 16 whereas I have a TH Origin 20. I will create a PR to make the distinction.

zandegran commented 4 weeks ago

@jonathanschneider I should have checked.. Only the Relays are different not the leds, data, soderpads for 20A elite and sensorpower though.. It takes some minutes before the cooling begins so the LED might be working already..

jonathanschneider commented 4 weeks ago

I had checked for differences between Elite and Origin but not between 16 and 20. The LED does work!

zandegran commented 4 weeks ago

@jonathanschneider This PR should fix your problem https://github.com/vitotai/BrewPiLess/pull/440