OK, UART problem solved. We actually replaced the atmega328p, but turns out the rx/tx lines were connected the wrong way (I connected my serial dongle’s rx to the tx and vice versa) and it has been working all time long. Well, PEBKAC
But will want to debug the stability problem if persists. I will put the emontx together and connect the charger to the UPS just in case.