A wireless sensor actuator network (WSAN) is an essential part of the industrial Internet of things (IIoT) with a cyber-physical system (CPS). However, the lack of time synchronization support for WSANs to date means that losses in synchronization accuracy have not been overcome. In this manuscript, we design a real-time kernel to resolve the precision time synchronization (PTS) problem and achieve dynamic automatic synthesis and rapid deployment in a complex WSAN system. Furthermore, tight coupling between wireless control and time synchronization motivates a Modbus-based precision time protocol (PTP) codesign that integrates industrial fieldbus networks and a PTS design. The experimental results indicate that our proposed PTP performance can far exceed the time synchronization requirement of an industrial real-time system. Finally, the proposed solution is successfully applied to an IoT-based smart lighting system.