Energy group-based dynamic framed ALOHA for wireless networks with energy harvesting