V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
cookgo

请问一下 golang 下有什么成熟稳定的串口通讯包?

  •  
  •   cookgo · Oct 22, 2025 · 2142 views
    This topic created in 189 days ago, the information mentioned may be changed or developed.
    9 replies    2025-10-27 16:59:22 +08:00
    elechi
        1
    elechi  
       Oct 22, 2025
    https://github.com/bugst/go-serial
    没有完美的,这个相对还行,有啥问题自己 fork 后修改下
    elechi
        2
    elechi  
       Oct 22, 2025   ❤️ 1
    https://github.com/bugst/go-serial/issues/148
    我使用中觉得不方便的就是这个问题,自己 fork 后修改下就行
    edieruby4
        3
    edieruby4  
       Oct 22, 2025
    ca2oh4
        4
    ca2oh4  
       Oct 23, 2025
    go 写嵌入式不觉得有点蹩脚吗,不如直接一步到位 用 rust
    flyqie
        5
    flyqie  
       Oct 23, 2025 via Android
    @ca2oh4 #4

    看描述有可能只是需要操作某个设备,用 rust 重写成本太高了吧?
    cookgo
        6
    cookgo  
    OP
       Oct 23, 2025
    @elechi 确实,我也是遇到了这个问题
    cookgo
        7
    cookgo  
    OP
       Oct 23, 2025
    hmuhao
        8
    hmuhao  
       Oct 23, 2025
    https://github.com/bugst/go-serial 这个包的话读串口可以考虑一个字节一个字节的读,直到 timeout 或者读到的数据长度为 0 ,就算读取完毕了,再校验数据包
    edieruby4
        9
    edieruby4  
       Oct 27, 2025   ❤️ 1
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5569 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 02:50 · PVG 10:50 · LAX 19:50 · JFK 22:50
    ♥ Do have faith in what you're doing.