Here is someone information on troubleshooting to help solve the issue.
P2 error code indicates you that your system has a high temperature protection of the compressor. This can relate to a faulty outdoor mother board, your system being low on refrigerant or restriction in the pressure and a defective sensor.
To test your indoor and outdoor circuit board,
you will simply have to verify the voltage frequency using a digital multi-meter. You will have to set your device on DC (direct current) and verify the voltage fluctuation between terminals L2-S or for some models it would be between 2 and 3 on the outdoor terminal block. The result should be fluctuating between -50 and +50 VDC alternatively. If the the voltage fluctuates with only positive or only negative numbers, this indicates that outdoor mother board will have to be replaced. If the result remains constant and there is no fluctuation at all, the indoor board will have to be replaced.
If it is refrigerant or pressure related you will need to have an HVAC technician check the readings on the unit.