A machine-learning algorithm can help select the best channel for communication over a wireless network of resource-constrained devices