ds18b20 on serial pins TxD=GPIO01 or RxD=GPIO03

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
m.Bob
New user
Posts: 6
Joined: 10 Mar 2023, 10:44

ds18b20 on serial pins TxD=GPIO01 or RxD=GPIO03

#1 Post by m.Bob » 10 Mar 2023, 11:39

Good afternoon.

I have an ESP-01 with mega-20230306 firmware.

The DS18B20 works when connected to the GPIO00 port.

I wanted to connect the DS18B20 to either of the TxD - GPIO01 or RxD - GPIO03 ports by disabling the ESPEASY serial port in the configuration and releasing the GPIO00 port for oter use (I2C bus on port GPIO00 and GPIO02).
I use it with a PCF8574 port extension on the I2C bus on the GPIO00 and GPIO02 ports. It works.

But this does not work on GPOI01 or GPIO03 (there is a pull-up resistor and a 3.3 power supply).
The contacts (GPIO01 and GPIO03) are free in the configuration (the "Equipment" tab).

What to do? Or is it impossible to work with GPIO01 and GPIO03 pins for DS18B20 in ESPEASY?

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

Re: ds18b20 on serial pins TxD=GPIO01 or RxD=GPIO03

#2 Post by TD-er » 10 Mar 2023, 15:17

Sounds like you don't have a pull-up resistor mounted for the 1-Wire data line.
GPIO-0 and -2 both have a pull-up resistor on the ESP board, since those pins need to be pulled-up at boot.
The others don't have such a pull-up resistor present.

See the documentation page: https://espeasy.readthedocs.io/en/lates ... #p004-page

m.Bob
New user
Posts: 6
Joined: 10 Mar 2023, 10:44

Re: ds18b20 on serial pins TxD=GPIO01 or RxD=GPIO03

#3 Post by m.Bob » 10 Mar 2023, 16:19

I wrote - But this does not work on GPOI01 or GPIO03 (there is a pull-up resistor and a 3.3 power supply).
and this is external resistor is - 4.7k.

The main question - Is it impossible to work with GPIO01 and GPIO03 pins for DS18B20 in software ESP EASY?

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

Re: ds18b20 on serial pins TxD=GPIO01 or RxD=GPIO03

#4 Post by TD-er » 10 Mar 2023, 20:25

As long as the Serial0 is not used, I don't see any reason why it should not work.

Especially if you're using the ESP's RX pin, you can even be sure there is no boot logs etc. being sent to the pin which might put any sensor into some undefined state.

What you might want to try, is define just some bogus task which needs serial and put that one to use "Serial-0 swapped" and enable it.
This way you can be sure Serial 0 is no longer tied to use GPIO-1 & 3.

If this task may end up taking quite a lot of CPU time as it may be waiting for any response from the sensor, you could then later (via rules) disable the task. Just as long as it is enabled once, it will have swapped the pins for Serial0.

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

Re: ds18b20 on serial pins TxD=GPIO01 or RxD=GPIO03

#5 Post by Ath » 10 Mar 2023, 21:29

Have you disconnected any (external) serial connection from the RX/TX pins?, as that might interfere with the communication with the sensor.
/Ton (PayPal.me)

kimot
Normal user
Posts: 190
Joined: 12 Oct 2017, 20:46

Re: ds18b20 on serial pins TxD=GPIO01 or RxD=GPIO03

#6 Post by kimot » 10 Mar 2023, 22:21

I am using GPIO3 ( RX pin ) on Sonoff Basic for connecting two DS18B20.
No problem...

2023-03-10-222011_1920x1080_scrot.png
2023-03-10-222011_1920x1080_scrot.png (130.05 KiB) Viewed 2377 times

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

Re: ds18b20 on serial pins TxD=GPIO01 or RxD=GPIO03

#7 Post by Ath » 10 Mar 2023, 23:24

Recent versions show the exact build filename and date in the right bottom corner of any page, but yours doesn't show that. What version are yiu running? Details are available in the Tools/Info page.
/Ton (PayPal.me)

m.Bob
New user
Posts: 6
Joined: 10 Mar 2023, 10:44

Re: ds18b20 on serial pins TxD=GPIO01 or RxD=GPIO03

#8 Post by m.Bob » 11 Mar 2023, 14:33

I don't know what to think. My screens for this case.
Contacts GPIO00 and GPIO03 are free and not connected to others circuits. In both cases, an external lift (pull-up) 4.7 is used.
Attachments
GPIO00
GPIO00
7.jpg (42.55 KiB) Viewed 2343 times
GPIO00
GPIO00
6.jpg (66.54 KiB) Viewed 2343 times
GPIO03
GPIO03
5.jpg (36.58 KiB) Viewed 2343 times
GPIO03
GPIO03
4.jpg (64.83 KiB) Viewed 2343 times
CONFIG hardware
CONFIG hardware
2.jpg (59.27 KiB) Viewed 2343 times
CONFIG advanced
CONFIG advanced
1.jpg (32.5 KiB) Viewed 2343 times

m.Bob
New user
Posts: 6
Joined: 10 Mar 2023, 10:44

Re: ds18b20 on serial pins TxD=GPIO01 or RxD=GPIO03

#9 Post by m.Bob » 11 Mar 2023, 14:38

What you might want to try, is define just some bogus task which needs serial and put that one to use "Serial-0 swapped" and enable it.
This way you can be sure Serial 0 is no longer tied to use GPIO-1 & 3.
How to do it? Step by step, please.

P.S. It starts to seem to me that this is a problem with this version of the software, sorry.
Last edited by m.Bob on 11 Mar 2023, 14:44, edited 1 time in total.

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

Re: ds18b20 on serial pins TxD=GPIO01 or RxD=GPIO03

#10 Post by TD-er » 11 Mar 2023, 14:44

Just add some task with a plugin that needs serial.
For example GPS, or whatever is present in the build you're using.
Then configure this task to use "Serial0 Swapped" and enable it.
This way GPIO 1 & 3 are not connected to Serial0 anymore.

m.Bob
New user
Posts: 6
Joined: 10 Mar 2023, 10:44

Re: ds18b20 on serial pins TxD=GPIO01 or RxD=GPIO03

#11 Post by m.Bob » 11 Mar 2023, 14:46

Просто добавьте какую-нибудь задачу с помощью плагина, для которого требуется serial.
.....
Таким образом, GPIO 1 и 3 больше не подключаются к Serial0.
I see, thank you.

m.Bob
New user
Posts: 6
Joined: 10 Mar 2023, 10:44

Re: ds18b20 on serial pins TxD=GPIO01 or RxD=GPIO03

#12 Post by m.Bob » 11 Mar 2023, 15:16

Thanks for this hint.

You can make it work without such a tricky hack? :D
Attachments
8.jpg
8.jpg (54.68 KiB) Viewed 2332 times

kimot
Normal user
Posts: 190
Joined: 12 Oct 2017, 20:46

Re: ds18b20 on serial pins TxD=GPIO01 or RxD=GPIO03

#13 Post by kimot » 11 Mar 2023, 20:49

Ath wrote: 10 Mar 2023, 23:24 Recent versions show the exact build filename and date in the right bottom corner of any page, but yours doesn't show that. What version are yiu running? Details are available in the Tools/Info page.
I am using version v2.0-20180322

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

Re: ds18b20 on serial pins TxD=GPIO01 or RxD=GPIO03

#14 Post by Ath » 11 Mar 2023, 21:21

m.Bob wrote: 11 Mar 2023, 14:38 P.S. It starts to seem to me that this is a problem with this version of the software, sorry.
Latest Release is 20230306, and you are running 20221224, so you could try to update to this release, to see if it solves your issue. Lots and lots of fixes have been made since the December release, though that's not a guarantee your issue is resolved...
/Ton (PayPal.me)

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

Re: ds18b20 on serial pins TxD=GPIO01 or RxD=GPIO03

#15 Post by Ath » 11 Mar 2023, 21:23

kimot wrote: 11 Mar 2023, 20:49 I am using version v2.0-20180322
That old version, while it may work perfectly, is not really supported any more, too many moons have past since (5 years...).
/Ton (PayPal.me)

kimot
Normal user
Posts: 190
Joined: 12 Oct 2017, 20:46

Re: ds18b20 on serial pins TxD=GPIO01 or RxD=GPIO03

#16 Post by kimot » 12 Mar 2023, 22:53

Ath wrote: 11 Mar 2023, 21:23
kimot wrote: 11 Mar 2023, 20:49 I am using version v2.0-20180322
That old version, while it may work perfectly, is not really supported any more, too many moons have past since (5 years...).
Yes, I know.
But it controls my floor heating for years...
And my motto:
"If it works, don't touch it"
:o)

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 14 guests