Creating an I2C Kernel Module for Gadmei TV USB Communication for LoRaWAN Gateway Devices
The development of a low-cost LoRaWAN Gateway for Smart Farming needs continues to be the focus of collaboration between the Pokdartik community and Pezano Young Farmers. One of the technical stages that was successfully achieved in this project was the development of an I2C kernel module that is capable of communicating directly with the Gadmei USB TV Tuner device.
This success is the result of a reverse engineering process for used USB TV devices that were previously only used as analog television broadcast receivers. Through a Linux kernel level software approach, these devices can now be controlled to access the internal RF tuner which will later be used as part of the LoRa signal receiving system in the 900–910 MHz frequency range which is commonly used in IoT network implementations in Indonesia.
Development Background
Most USB TV Tuners based on the USBTV007 chipset or similar chipsets have an RF tuner that is controlled via an internal I2C communication line. Under normal conditions, this communication is only used by the television driver to set channels and broadcast frequencies.
The problem that arises is that the default Linux driver does not provide direct access to the tuner registers. As a result, developers cannot change the parameters of frequency, bandwidth, gain, or other radio configurations needed in LoRaWAN experiments.
To overcome these limitations, the Pokdartik team together with Pezano Young Farmers analyzed the structure of the USB TV driver available in the Linux kernel and studied the implementation of the I2C subsystem used by the kernel. Linux provides an I2C framework through objects such as i2c_adapter, i2c_client, and i2c_driver which allows devices to communicate via the I2C bus.
Reverse Engineering Stages
The reverse engineering process begins by identifying the chipset used on the Gadmei TV USB device. After the device is successfully recognized by the Linux system, an analysis of the USB communication is carried out using the kernel log (dmesg) and the device enumeration process.
The next step is to study how the original driver carries out the frequency tuning process. From the observations it was found that the RF tuner received configuration commands via I2C transactions sent by the kernel driver.

With this information, the team began building a separate kernel module that had the ability to:
Perform Gadmei TV USB device detection.
Initialize the adapter I2C.
Sends tuner register read commands.
Writes configuration values to tuner registers.
Provides a debugging interface for frequency testing.
Implementation is carried out using the Linux Kernel Module (LKM) so that modules can be loaded dynamically using the insmod command without the need to make direct modifications to the main kernel.
Implementation of the Kernel Module
The developed module architecture consists of several main components.
The first is the USB device probing process. When the device is connected to the system, the module identifies the Vendor ID and Product ID that correspond to the Gadmei TV device.
After the device is discovered, the module initializes the I2C client object and connects it to the adapter available on the device. At this stage the Linux kernel provides communication functions such as i2c_master_send() and i2c_master_recv() which are used to send and receive data via the I2C bus.
Next, we test the reading of the tuner registers. Testing shows that the device successfully responds to data requests and returns valid register values. This stage is an indicator that the I2C communication line is functioning properly.
After the reading was successful, the team continued with register writing testing. Various frequency configurations were successfully sent to the tuner without causing a kernel panic or conflict with the Video4Linux (V4L2) subsystem.
Testing Results
Until the current stage, the I2C kernel module has been successfully loaded into the Linux system and is able to communicate with the Gadmei TV USB stably.
Some of the achievements that have been achieved include:
The kernel module has been successfully compiled in a modern Linux environment.
The Gadmei TV USB device has been successfully compiled. detected by the module.
The I2C communication line was successfully initialized.
Reading the tuner register was successful.
Writing the tuner configuration was successful.
Communication was stable during testing.
No crashes or kernel conflicts were found during the debugging process.
This success became an important foundation for the next stage of development, namely controlling the RF tuner to be able to perform spectrum scanning on the frequencies used by the network LoRaWAN.
Support for Smart Farming
In implementing Smart Farming, the LoRaWAN Gateway functions as a link between field sensors and data monitoring servers. Sensors placed in agricultural areas can transmit data on soil moisture, air temperature, rainfall, water quality, and plant nutritional conditions.
By utilizing used USB TV Tuners as part of a gateway system, the cost of building IoT infrastructure can be reduced significantly. Apart from reducing hardware costs, this approach also supports the reuse of electronic waste which still has high technical potential.
The collaboration between Pokdartik and Pezano Young Farmers proves that digital agricultural innovation does not always require expensive equipment.Through a combination of reverse engineering, Linux kernel development, and the use of used equipment, an independent and affordable Smart Farming solution can be realized to support a more modern and sustainable Indonesian agriculture.
Literature
Linux Kernel Documentation. Implementing I2C Device Drivers. Kernel.org.
Linux Kernel Documentation. I2C and SMBus Subsystem. Kernel.org.
Linux Kernel Documentation. I2C/SMBus Subsystem Documentation. Kernel.org.
Jonathan Corbet, Alessandro Rubini, Greg Kroah-Hartman. Linux Device Drivers, Third Edition. O'Reilly Media, 2005.
LoRa Alliance. LoRaWAN Specification. LoRa Alliance Technical Committee.
Same Writing
Portable WiTiAI: Bringing Autonomous Artificial Intelligence to Linux Systems Without an Internet Connection
01 12 2026
Getting to Know the QNM1 Extension Model: A New Way to Add AI Knowledge Without Changing the Main Model
26 11 2026
Examining Threshold Effects on Q4M Gemma-3-270M-IT Quantization: A Compromise Between Compression and Fidelity
06 11 2026