For a project I want to implement 1-Wire communication in a Raspberry Pi Zero W. The goal is to use a Maxim Integrated Max17313 Fuel Gauge for inspecting battery usage.
To make sure the implementation will work on firsthand, I started with emulating different 1-Wire devices with an ESP8266 and using this library: https://github.com/orgua/OneWireHub
For wiring and setting up the Pi, I followed this article: https://pinout.xyz/pinout/1_wire# Also tried the steps with a vanilla Raspbian install.
Sticking to the basics I started emulating a DS18B20. I can get readings via a connected ESP32 running micropython. Sadly, the device never shows up on the
/sys/bus/w1/devices/ folder on the Pi using the standard w1 driver.
I then tried "bitbanging" GPIO4 directly via this code: https://github.com/danjperron/BitBangingDS18B20 . When using this method, the sensor is detected and readings are possible. That means, the wiring must be correct at least and GPIO4 is working.
When I remove the 4.7k pullup resistor, random devices appear on the Pi, but with the pullup connected, nothing happens.
I tried a lot of different approaches like using OWFS, different GPIO Pins, and loading kernel modules like w1-gpio and w1-temp. The modules always load successfully. The device tree debug log also never shows any errors related to 1-wire.
As far as I understand the topic, the emulated sensor should be at least appear in the
/sys/bus/w1/devices/ folder. I also double-checked the behavior with a raspberry Pi 3: Same result. The only thing showing up is the w1_bus_master_1 .
Attached you will find a picture of my current breadboard wiring. The emulated data pin is pin 5 on the ESP.
I would really appreciate your help.