Quick Debugging Method for Internet of Things Communication Module

When developing the application system of the Internet of Things communication module, the short-range wireless communication module must be ensured to work normally in the first. In order to quickly debug short-range wireless communication modules, this paper proposes a module debugging method using USB to TTL serial port. The method uses a USB to TTL serial port module to connect the wireless communication module with the personal computer, and directly debugs in the Serial Port Tester, thereby avoiding the delay of writing the program and playing the role of quick debugging. The effectiveness of the debugging method is verified by experiments.


Driver software
Since the additional USB to TTL serial port module is connected to the USB port of the PC via USB, it is necessary to download and install the USB driver. The USB driver should be searched and downloaded according to the chip model on the module, and the corresponding version should be downloaded according to the operating system of the PC. For example, if the USB chip uses the PL2303 chip, it is necessary to search for and download the driver for installing PL2303.

Debugging software
The debugging software uses the serial port debugging software running on the PC. For quick debugging, you can directly use the Serial Port Tester. The web server accesses the router, and the web server is provided by a virtual server configured by the router. The terminal device such as the user's mobile phone can access the web server content by wirelessly accessing the WIFI and connecting to the router by the router SSID and password.

Experiment of the method
Here, the short-range wireless communication Lora module is debugged as an example to achieve quick debugging.

Lora module.
The LORA module of the Orthogonal Atom Corporation [4] ATK-LORA-01 was used in the experimental, see Figure 2.
The performance of the Lora module is in reference 4, and the communication chip uses the SX1278, with a small pepper antenna (3dB gain).

USB to TTL serial port module
Here, the USB to TTL serial port module consisting of PL2303HX chip is used [5], as shown in Figure  3. The module operates at +5V and has a 3.3V regulator output inside the chip, which is convenient for short-range wireless communication modules with different voltage requirements of 3.3V and 5V. A 12MHz crystal oscillator is used.

Experiment
The experiment requires two sets of devices, one for sending and the other for receiving. The PL2303 driver and serial port tester must be installed on both PCs. The two sets of hardware connections are shown in Figure 4(a) and Figure 4(b). The USB to TTL serial port module is respectively inserted into the USB port of the PC, and the USB to TTL serial port module and the LORA module are connected through four wires: GND and GND are connected; VCC is connected with VCC; USB to TTL TXD is connected with RXD of LORA. Connection: USB to TTL RXD is connected to the LORA TXD.
Then install the USB driver of PL2303 on the PC, so that the serial port (COM) obtained by USB conversion can be recognized on the two PCs. Start the serial port tester on two PCs, select the serial port (COM) obtained by USB conversion, set the baud rate, parity bit, digital bit, stop bit and other parameters. The serial port tester parameters on the two PCs should be set the same. Finally, click on the connection. After you have successfully connected the serial port on both PCs, you can test the wireless data communication.    Figure 5(b) are experimental screenshots of the serial port tester on the two PCs. The parameters of the two PCs are set to: baud rate 9600 bps, parity bit NONE, data bit 8 bits, stop bit 1 bit.
When the USB to TTL serial port of two computers is connected normally, if the serial port tester of any PC sends data, and the serial port tester of another PC can receive the same data normally, it indicates that the wireless communication works normally. As can be seen from Fig. 5, "hello!" is transmitted in the serial port Tester of the PC of Fig. 4(a), and "hello!" is received in the serial port tester of another PC of Fig. 4(b). Send "welcome!" in the s serial port Tester of the PC in Figure 4(b) and receive "welcome!" in the serial port tester of another PC in Figure 4(a), indicating two-way wireless communication normally.

Conclusion
The USB to TTL serial port module can quickly debug the short-range wireless communication module of the Internet of Things without connecting the embedded system such as single-chip microcomputer or ARM, which avoids the time required for writing and debugging the program, thereby saving time and improving efficiency for development. It is the purpose of quickly debugging short-range wireless communication modules.