Energy aware routing for Internet of things with heterogeneous devices