Sorry for posting after several years but I had a similar problem.
However pin D5 is also used by the USB port and so cannot be used if using USB; search for D5 here as it mentions this “feature”:
https://wiki.dfrobot.com/FireBeetle_Board_ESP32_E_SKU_DFR0654