Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

软件长时间运行,读取不到信息 #21

Closed
xSmile-art opened this issue Feb 26, 2023 · 5 comments
Closed

软件长时间运行,读取不到信息 #21

xSmile-art opened this issue Feb 26, 2023 · 5 comments
Labels
question Further information is requested

Comments

@xSmile-art
Copy link

软件长时间运行,一连运行一个星期以上的时候,就读取不到信息,是发生串口宕机吗?

@xmaihh
Copy link
Owner

xmaihh commented Feb 27, 2023

如您提供的这些信息,无法回答,这需要您自己排查是软件的问题还是硬件问题

@xSmile-art
Copy link
Author

xSmile-art commented Feb 27, 2023 via email

@xmaihh
Copy link
Owner

xmaihh commented Feb 27, 2023

造成串口死机的原因:
1、代码问题
2、硬件问题

@Amyitis
Copy link

Amyitis commented May 9, 2023

确实存在这种长时间保持串口连接状态会出故障的BUG。
1.在线程中开启串口open
2.在同线程中保持一个死循环,每1500毫秒间隔 轮询一个 指令池队列,有指令就发送串口指令,没有就无动作继续轮询;
3.刚启动这个线程的时候,能稳定按队列的指令逐条执行,但是一但串口open时间过长,就只能执行一次指令,并且得不到正确的串口反馈信息(回调)。

@xmaihh
Copy link
Owner

xmaihh commented May 10, 2023

为避免消耗电池电量,处于空闲状态的 Android 设备会快速进入休眠模式。

需要长时间保持串口连接状态可以考虑:1.使屏幕保持开启状态 2.使 CPU 保持运行状态 。

@xmaihh xmaihh added the question Further information is requested label Sep 11, 2023
@xmaihh xmaihh closed this as completed Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants