An active jammer could severely degrade the communication quality for wireless networks. Since all wireless nodes openly access the shared media, the harsh effects are exaggerated by retransmission attempts of affected devices. Fast and precise detection of the jammer is of vital importance for heterogeneous wireless environments such as the Internet of things (IoT). It could activate a series of corrective countermeasures to ensure the robust operation of the network. In this paper, we propose a local, straightforward, and numerical metric called the number of jammed slots (NJS), by which we can quickly detect the presence of a jammer and identify the jammed nodes at the software level in broadcast networks. NJS calculation is carried out by a central node which collects the MAC-layer statuses of all wireless nodes in a periodical fashion. Our simulation results indicate that NJS outperforms current detection …