dht 22 stops working after a while

That's very long for I2C. May or may not work, depending on the cable mostly (low enough stray capacitance). You may also have to add extra pull-up resistors to strengthen the pull-up.