We consider a novel ultra-narrowband (UNB) low-power wide-area network (LPWAN) architecture design for uplink transmission of a massive number of Internet of Things (IoT) devices over multiple multiplexing bands. An IoT device can randomly choose any of the multiplexing bands to transmit its packet. Due to hardware constraints, a base station (BS) is able to listen to only one multiplexing band. Our main objective is to maximize the packet decoding probability (PDP) by optimizing the placement of the BSs and frequency assignment of BSs to multiplexing bands. We develop two online approaches that adapt to the environment based on the statistics of (un)successful packets at the BSs. The first approach is based on a predefined model of the environment, while the second approach is measurement-based model-free approach, which is applicable to any environment. The benefit of the model-based approach is a lower training complexity, at the risk of a poor fit in a model-incompatible environment. The simulation results show that our proposed approaches to band assignment and BS placement offer significant improvement in PDP over baseline random approaches and perform closely to the theoretical upper bound.