One of my goals when playing with these chips is to enhance elements of smart home. One of features is measurement of home parameters including temperature. Earlier I have integrated it with Fibaro sensor, now I’ll check it with ESP32 and DS18B20.
First step is to get empty project as described here and rename it to temperature for example. Update Makefile, set serial port and remove main.c file.
Now we need to add support for DS18B20. On GitHub there is already component which handles it but it will require minor update to compile seamlessly. Each project may contain several components organized in components subdirectory. Components are simply pieces of code which are compiled into static library and then linked into our application. Some of them are available in ESP-IDF but we can create also ours. For purpose of handling DS18B20 I used component from FeelFreeLinux, there are 2 small changes which must be applied.
git clone --recursive https://github.com/feelfreelinux/ds18b20.git
mv ds18b20.h include
When doing my own Z-Wave installation I have decided to make it without rush with simple steps. As such I have started with measuring temperature. When I moved in I have prepared for this 6-wired cable going along the garage wall and outside to the garden. My RazBerry controller is waiting at home and I gather equipment. I plan to limit soldering and use more connectors – some may be too big but I do not make precise probes (yet).