A method of achieving wireless sensor network (WSN) communication in a mesh and star topology network (MSTN), including: a) connecting a plurality of nodes in a WSN to form a mesh and star hybrid topology structure; b) based on the topology structure, defining a superframe structure based on IEEE 802.15.4-2006; c) based on the topology structure and superframe structure, defining methods for long period data processing, connectivity assessment, medium access control, channel measurement, frequency hopping, beacon frame formation, and two-stage resource allocation; d) based on the topology structure, superframe structure, and methods, defining a method for network establishment; and e) based on the network establishment method, defining a method for MSTN communications. The method features real-time communication, high reliability, and low energy consumption.