It seems your mainboard is failing, Do a back up first, then factory reset.
If at the initial setting screen, the Wifi is not turning on, then you need to change the mainboard.
It's not expensive, an used one is only around $100 and it takes no more than 30 minutes to swap the new one if you know how, otherwise leave it for professionals to do the replacement.