The explosive growth of unmanned aerial vehicles (UAVs)-based networks has accelerated in recent years. One of the crucial tasks of a UAV-based network is managing and allocating resources, including time, power, fly trajectory, and energy resources. We investigate a UAV-based network that gathers information from smart devices, sensor devices, and IoT devices (IDs) with respect to energy efficiency (EE) maximization. The EE of users served by the UAV over the time slots of a cycle is maximized through three categories: UAV trajectory optimization, power allocation, and time slot assignment. However, these are non-convex problems that are very difficult to solve. To solve the problem efficiently, we divide it step by step and convert the non-convex optimization problem into an equivalent convex optimization problem, optimizing each equivalent problem over each variable while other variables are fixed. Firstly, we perform a UAV trajectory optimization with a different number of ground users. Secondly, the Dinkelbach method is used to construct a non-convex fractional power allocation problem. In addition, we develop an algorithm to distribute time slots to all users, which continually raises the EE value. Eventually, a scheme is provided to sequentially update the method to each equivalent problem. The numerical results provide evidence that by solving the proposed sum-rate maximization problem, the performance of ground users has significantly improved with the support of the UAV-based network.