当前位置:网站首页>1315_Use the LOOPBACK simulation mode to test whether the pyserial installation is successful
1315_Use the LOOPBACK simulation mode to test whether the pyserial installation is successful
2022-07-30 04:47:00 【grey_csdn】
All learning summary: GreyZhang/g_serial: Some serial learning notes which may be usefull in embedded system debugging. (github.com)
I tried the installation of pyserial and the generation of documents before. This time I found a way to test whether the package was successfully installed.
The working way of pyserial I found two kinds from the document, one is to use the physical real serial port to communicate directly, and the other is the simulation mode.

There is such a chapter in the documentation, in fact, there are some corresponding instructions here.

I mainly read the loop:// URL here, and after reading it, I found that this is actually a simulated behavior.For this, in fact, you can do a functional test of a basic software package, without the need for an actual serial port physical device.At first, I may have misunderstood and thought that LOOP may be related to loops. In fact, this is the abbreviation of LOOPBACK.

In another place in the document, there is an example of reading by line, which uses the above URL.In fact, this example can be used directly as a test example for a simple module test.Next, transcribe the code to do a test.

An error occurred in my test environment, I tried to make some changes to the code.

Remove this part directly.After that, the effect of the test:

The test passed, but this actually means that there is no interactive information of the serial port.In fact, I can try to modify the above content again to see how the serial port information can be obtained.


This is the modified code and the effect of running. The interactive information of the serial port can be seen initially.However, this test feels that the execution speed is not very fast in my test environment, and the reason for this has not been found for the time being.
边栏推荐
- webService接口
- KubeMeet 报名 | 「边缘原生」线上技术沙龙完整议程公布!
- [Android development] Splash interface / user agreement and privacy policy pop-up window / interface development
- A must see for software testers!Database knowledge MySQL query statement Daquan
- Chapter8 Support Vector Machines
- 【线性表】- LeetCode力扣三道练习题详解
- [Linear table] - Detailed explanation of three practice questions of LeetCode
- The 2nd Shanxi Province Network Security Skills Competition (Enterprise Group) Partial WP (10)
- 模拟问题(下)
- Solve the go environment can not compile exe
猜你喜欢

复现XXL-JOB 任务调度中心后台任意命令执行漏洞

【Redis高手修炼之路】Jedis——Jedis的基本使用

Six, read application configuration + log configuration

MYSQL unique constraint

Code open source design and implementation ideas

3. Dependency configuration management

VisualStudio2022本地调试进入特别慢问题解决

The Complete Go Books - Beginner to Advanced and Web Development

Introduction to database - MySQL simple introduction

Solve the error SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xb7 in position 0: invalid start b
随机推荐
5. View parsing and template engine
成为一个合格的网安,你知道这些吗?
【周周有奖】云原生编程挑战赛“边缘容器”赛道邀你来战!
(RCE) Remote Code/Command Execution Vulnerability Vulnerability Exercise
Web page element parsing a tag
LeetCode Algorithm 328. Parity linked list
3. Dependency configuration management
小程序npm包--API Promise化
BGP的简单实验
The 2nd Shanxi Province Network Security Skills Competition (Enterprise Group) Partial WP (10)
复现XXL-JOB 任务调度中心后台任意命令执行漏洞
js operation to add or subtract from the current date (day, week, month, year)
Discourse 自定义头部链接(Custom Header Links)
Solve the error SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xb7 in position 0: invalid start b
C# One Week Introductory "C# - Classes and Objects" Day Six
POJ1321 棋盘问题(详解)
Verify that the addShutdownHook hook takes effect
解决报错SyntaxError: (unicode error) ‘utf-8‘ codec can‘t decode byte 0xb7 in position 0: invalid start b
1. Get data - requests.get()
Catch That Cow (detailed)