Text this: Energy-efficient device selection and resource allocation for edge-driven hierarchical federated learning