A middleware solution for wireless iot applications in sparse smart cities