The Go Programming Language
› http://golang.org/
› Go Playground
Go Projects
› Revel Web Framework
cookgo

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

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

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