We study internet of things (IoT) systems supported by cell-free (CF) massive MIMO (mMIMO) with optimal linear channel estimation. For the uplink, we consider optimal linear MIMO receiver and obtain an uplink SINR approximation involving only large-scale fading coefficients using random matrix (RM) theory. Using this approximation we design several max-min power control algorithms that incorporate power and rate weighting coefficients to achieve a target rate with high energy efficiency. For the downlink, we consider maximum ratio (MR) beamforming. Instead of solving a complex quasi-concave problem for downlink power control, we employ a neural network (NN) technique to obtain comparable power control with around 30 times reduction in computation time. For large networks we proposed a different NN based power control algorithm. This algorithm is sub-optimal, but its big advantage is that it is scalable.