This paper deals with IoT devices deployed in remote areas without terrestrial Internet connectivity. We consider connecting IoT devices on the ground to the Internet through an aerial system based on an Unmanned Aerial Vehicle (UAV) for smart agriculture and environmental monitoring. The UAV flying over the remote area receives data from distributed IoT devices. The transmissions between the ground sensors and the UAV are carried out via LoRa. We have proposed a synchronization protocol for the opportunistic communication of LoRa IoT devices with a gateway onboard the UAV to save node battery life. Class A LoRa nodes on the ground transmit only when the UAV is expected to pass close to them; otherwise, they stay in the sleeping state most of the time. This paper provides a detailed description of the formulation of the synchronization protocol. The UAV’s flying dynamics have been considered for characterizing its speed and the time of visibility of each IoT sensor. Our model has allowed an analytical approach that can help to determine the best settings for LoRa transmissions. Finally, experiments have been carried out to assess the path loss attenuation, and a laboratory setup of the synchronization protocol has been implemented for the preliminary validation of our scheme.