I have to design a board that fits inside a 4x2 inches wall box and is powered directly from mains (110-220) and has wifi capabilities
As for power supply, I'm concerned for space as I probably can't fit a transformer there. Is there other mains->5v design I could look for? (I'm not THAT skilled on electronics). I know cell phone chargers do that on a pretty compact way.
I've seen this guy here that seems to do what I need, but is on end of life https://www.digikey.com/product-detail/en/BP5063-5/BP5063-5-ND/658569
As for wifi I would probably go with ESP8266, my concern is: Would wifi work well being so close to the AC circuitry?