## 1 Introduction  
Despite the impact of COVID-19, the number of Internet of Things (IoT) devices grew by 9% as observed in a 2021 report [1]. It is estimated that the number of IoT devices will surpass 27 billion by 2025 [1]. The reason behind this boom can be attributed to the easy availability of internet connectivity and low-cost sensors. While these devices have made our lives easier, they have also created a window of opportunity for hackers to exploit privacy. Some hacked systems, such as medical devices, can even be life-threatening. Smart home devices, when hacked, can also compromise the privacy of users. Every layer of the IoT, including the application, network, middleware, and sensing layer, is susceptible to attacks [2]. Intrusion detection systems (IDSs) designed for IoT systems aim to detect and respond to these threats in real time, ensuring the security and integrity of the IoT ecosystem. Nowadays, the use of IoT devices in our homes is increasingly geared towards creating a more comfortable living environment. These smart home devices communicate with one another using Zigbee, Bluetooth, and WiFi, and connect to the cloud via internet access (typically through a WiFi router) [3]. They are usually controlled remotely through cloud services and mobile apps. However, this remote accessibility of IoT devices in smart homes presents numerous opportunities for attackers, especially considering that most occupants have limited knowledge of security measures [4]. Securing such devices proves challenging and complex due to their limited storage and computational power. Several machine learning and deep learning algorithms have been studied for intrusion detection [5; 6; 7; 8; 9]. All the aforementioned papers discuss a centralized approach. A few researchers also presented distributed approaches for intrusion detection in IoT applications [10; 11; 12; 13]. Researchers utilized fog computing in [13; 14; 15; 16] for implementing IDSs in fog but employed desktop PCs for the implementation. Similarly, in [17], the authors employed Raspberry Pi for binary class IDS implementation on a fog node. Raspberry Pi-based edge devices were also used for IDS implementation in [18; 19]. In [20], the authors utilized Google Edge TPU and Raspberry Pi for IDS implementation on the edge, while in [21], the authors developed an IDS for mobile edge computing (MEC), but the proposed technique was tested on a desktop computer. Due to limited resources, the authors implemented a binary class IDS on an edge device [20; 21]. The researchers used edge devices (Raspberry Pi/Desktop PCs/gateways), fog, and the cloud for implementing the IDS due to the availability of network traffic analyzers, such as Wireshark ([[https://www.wireshark.org](https://www.wireshark.org)]([https://www.wireshark.org](https://www.wireshark.org)) (accessed on 26 April 2024)) and tcpdump ([[https://www.tcpdump.org/](https://www.tcpdump.org/)]([https://www.tcpdump.org/](https://www.tcpdump.org/))(accessed on 26 April 2024)) but an ML-based IDS is not embedded in IoT devices. Due to limited processing power, the lightweight IP (lwIP) ([[https://github.com/espressif/esp-lwip](https://github.com/espressif/esp-lwip)]([https://github.com/espressif/esp-lwip](https://github.com/espressif/esp-lwip))(accessed on 26 April 2024)) library for ESP32 ([[https://www.espressif.com/en/products/socs/esp32](https://www.espressif.com/en/products/socs/esp32)]([https://www.espressif.com/en/products/socs/esp32](https://www.espressif.com/en/products/socs/esp32))(accessed on 26 April 2024)) has restricted access to network features. Consequently, implementing an IDS on a microcontroller-based device without using network traffic analyzer software is an exceedingly challenging task.