In some parts of the world, climate change has led to periods of drought that require managing efficiently the scarce water and energy resources. This paper proposes an IoT smart irrigation system specifically designed for urban areas where remote IoT devices have no direct access to the Internet or to the electrical grid, and where wireless communications are difficult due to the existence of long distances and multiple obstacles. To tackle such issues, this paper proposes a LoRaWAN-based architecture that provides long distance and communications with reduced power consumption. Specifically, the proposed system consists of IoT nodes that collect sensor data and send them to local fog computing nodes or to a remote cloud, which determine an irrigation schedule that considers factors such as the weather forecast or the moist detected by nearby nodes. It is essential to deploy the IoT nodes in locations within the provided coverage range and that guarantee good speed rates and reduced energy consumption. Due to this reason, this paper describes the use of an in-house 3D-ray launching radio-planning tool to determine the best locations for IoT nodes on a real medium-scale scenario (a university campus) that was modeled with precision, including obstacles such as buildings, vegetation, or vehicles. The obtained simulation results were compared with empirical measurements to assess the operating conditions and the radio planning tool accuracy. Thus, it is possible to optimize the wireless network topology and the overall performance of the network in terms of coverage, cost, and energy consumption.