DS18B20 on Annex32 WiFi 1.43.2 CAN BLE ?

Here we can discuss about the problem found
Post Reply
User avatar
Electroguard
Posts: 836
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 268 times
Been thanked: 317 times

DS18B20 on Annex32 WiFi 1.43.2 CAN BLE ?

Post by Electroguard »

I'm having problems using a Dallas DS18B20 Temperature Sensor with Annex32 WiFi 1.43.2 CAN BLE
The pin works ok for button input, and I've tried at least 3 different sensors, all of which work ok on a Sonoff.
So I'm suspecting there is a Tempr$() bug... perhaps someone else could check please ?
Does this snippet work for anyone ? Or perhaps another pin ?
temp$= tempr$(5)
wlog temp$
Zim
Posts: 280
Joined: Mon Feb 08, 2021 9:15 pm
Has thanked: 253 times
Been thanked: 128 times

Re: DS18B20 on Annex32 WiFi 1.43.2 CAN BLE ?

Post by Zim »

hi
Your code doesn't work for me, but the below does:

D4 = 2
curr$ = TEMPR$(D4,1)
wlog curr$
User avatar
Electroguard
Posts: 836
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 268 times
Been thanked: 317 times

Re: DS18B20 on Annex32 WiFi 1.43.2 CAN BLE ?

Post by Electroguard »

Thanks Zim,
Did you mean that yours doesn't work on pin5 of the esp32 either, or that it needs to include the optional [,1] device number ?
Anyway, if yours is working using pin 2 of an esp32 flashed with Annex32 WiFi 1.43.2 CAN BLE, then I guess I can use pin 2 also.
User avatar
Electroguard
Posts: 836
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 268 times
Been thanked: 317 times

Re: DS18B20 on Annex32 WiFi 1.43.2 CAN BLE ?

Post by Electroguard »

Nope, that doesn't work for me either, which leaves me stumped.
But I didn't know that "D2" etc was used on esp32's though, so can you just confirm that you were actually using an esp32 flashed with Annex32 WiFi 1.43.2 CAN BLE please ? (else I won't get any sleep)
Zim
Posts: 280
Joined: Mon Feb 08, 2021 9:15 pm
Has thanked: 253 times
Been thanked: 128 times

Re: DS18B20 on Annex32 WiFi 1.43.2 CAN BLE ?

Post by Zim »

this does not work.....
temp$= tempr$(5)
wlog temp$
Last edited by Zim on Sun Apr 18, 2021 2:44 am, edited 1 time in total.
Zim
Posts: 280
Joined: Mon Feb 08, 2021 9:15 pm
Has thanked: 253 times
Been thanked: 128 times

Re: DS18B20 on Annex32 WiFi 1.43.2 CAN BLE ?

Post by Zim »

this works on esp32

curr$ = TEMPR$(5, 1)
wlog curr$
Zim
Posts: 280
Joined: Mon Feb 08, 2021 9:15 pm
Has thanked: 253 times
Been thanked: 128 times

Re: DS18B20 on Annex32 WiFi 1.43.2 CAN BLE ?

Post by Zim »

don't forget the pull up resistor....:)
User avatar
Electroguard
Posts: 836
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 268 times
Been thanked: 317 times

Re: DS18B20 on Annex32 WiFi 1.43.2 CAN BLE ?

Post by Electroguard »

Ta Zim, was me being a dummy - I had deliberately not been adding a pullup cos I've not been needing one when plugging the Dallas into the Sonoffs... but (duh) I suppose I must have previously included a pullup when doing the Sonoff S20 TX/RX mod a few years ago.
Thanx for helping me past that bout of brain fade.
bugs
Posts: 142
Joined: Mon Feb 08, 2021 10:10 pm
Location: Scotland
Has thanked: 44 times
Been thanked: 50 times

Re: DS18B20 on Annex32 WiFi 1.43.2 CAN BLE ?

Post by bugs »

Annex seems to return a null string if nothing found:-

t$="anything"
t$= tempr$(12)
if t$="" then wlog "no device found"
User avatar
Electroguard
Posts: 836
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 268 times
Been thanked: 317 times

Re: DS18B20 on Annex32 WiFi 1.43.2 CAN BLE ?

Post by Electroguard »

When you 'cut out the middle man' Tempr$ returns -127 if no Dallas device found (I've seen it often!).
wlog tempr$(5,1)
Post Reply