D3 and D4 are not working in my project

You should also read this about the pins used by Edgent…

You really need to be using an ESP32 if you want that many pins.

Pete.