The wiring is ok, and will work with any resistor between 1k and 5k.
Just to be sure the gpio4 is not broken you could set up onewire bus on a diferent pin.
I have used gpio17 some times, just change /boot/config.txt to:
dtoverlay=w1-gpio,gpiopin=17
Do you have another micro, as an arduino or...