According to your description, this issue seems to be related to the power supply of the RS232 device. If your RS232 device previously worked properly by being powered through the interface of the Milesight UC501, please try using an external power supply with the same voltage and current settings as configured in the ToolBox App(as shown below) to power your RS232 device when the UC502 is powered only by solar or battery, and then observe whether this resolves the issue.
Tim