This paper presents the design and implementation of a multi-protocol gateway that relies on a multi-hop wireless network for smart home and building automation applications. This paper describes how to construct such a multi-hop tree-based wireless network to coexist with ZigBee mesh networks, using low-cost commodity 2.4GHz WiFi/BLE SoC modules. The gateway supports both wired and wireless connectivities to other sensor nodes, including the RS485/Modbus fieldbus and wireless networks based on two different protocols, namely the ESP-Now peer-to-peer wireless protocol developed by Espressif Systems and the ZigBee protocol. In this work, the ESP-NOW protocol was utilized to construct the core low-power multi-hop wireless network, whereas the ZigBee standard was used to build subnetworks of sensor nodes. A single-board computer (SBC), running an embedded Linux operating system, was chosen as a platform for implementing the proposed IoT gateway which utilized the MQTT protocol for message delivery. Field experiments were conducted to evaluate the performance of the ESP-Now multi-hop wireless network, comprised of up to 5 hops. To illustrate the functionality of the proposed gateway, a use case was presented, in which a building automation system prototype was developed for control and management of air-conditioners and AC power meter units.