Did your emonPi2 “work” before you tried to do this - and why are you re-flashing it? Have you tried using one of the pre-compiled options via emonCMS and Setup → Admin → Update → Update Firmware Only? Or are you customising the front end software?
If none of those options will load, and you selected the correct port and hardware, and there’s nothing else connected to your emonPi2 so you had a choice of one for the port - then I think it must probably be a hardware problem. It might just be worth taking one of the end plates off to take a look inside, but I can’t see how the connector could have become dislodged.
Unfortunately, all those error messages mean only that it can’t communicate. This can be for any one of a multitude of faults.
@Vaughn_Fisher - could you post a picture of your setup, including the connection to the Pi? Might help. Which version did you have assembled by JLCPCB? Have you tried manually uploading with avrdude?
You don’t have an emonPi2, you have a clone, one not manufactured and tested by The Shop. It makes a big difference, and it would have saved time if you’d made this clear at the start. I did write “Remember what it says in the FAQ - all we know about what you have is what you write down here.” We can help only as much as the information you give us allows.
I have yet to see a report of a Megni-manufactured emonPi (either version) having a fault like you describe.
I’m not totally sure of your specific hardware, but in general terms, to flash an AVR chip using the serial UART requires that the AVR already has a bootloader installed.
You’ll need to install avrdude on the Pi (sudo apt install avrdude) and connect some kind of programmer (ISP) between the Pi and the target boards ICSP header. The exact bootloader file and the command to install it will vary depending on the hardware but you should be able to search the web for that.
It seems that the emonPi2 uses the AVR-DB variant, which has replaced ICSP with UPDI, but I’ve no experience of that so unfortunately can’t really advise further.
Note, I have not done this - but it should all be relatively straightforward. The bootloader for the AVR-DB is here. You can upload with avrdude with something like: