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

Switch to github.com/jacobsa/go-serial #24

Open
blockmurder opened this issue Oct 3, 2019 · 8 comments
Open

Switch to github.com/jacobsa/go-serial #24

blockmurder opened this issue Oct 3, 2019 · 8 comments
Milestone

Comments

@blockmurder
Copy link
Collaborator

In order to support custom baud rates (e.g. for P4 Dragon, see #3) we should switch from https://github.com/tarm/serial to https://github.com/jacobsa/go-serial/

I initially proposed https://github.com/mikepb/go-serial but as @martinhpedersen stated correctly in #3:

I think the best solution would be to find a pure Go package, because that would allow us to cross compile more easily. I belive the current serial package used also uses cgo, so it's not a very high priority. But it would certainly be nice to get rid of all C dependencies eventually.

Seems like jacobsa/go can do without cgo: https://github.com/jacobsa/go-serial/blob/15cf729a72d49e837fa047a4142fa6e4d5ab45a1/serial/open_linux.go#L14

@blockmurder
Copy link
Collaborator Author

@martinhpedersen Currently, ptc-go uses tarm/serial, located in pat/vendor/github.com/tarm/serial
Would you prefere if ptc-go would use its own include directory like
ax25 wl2k-go/transport/ax25/vendor/github.com/tarm ?

@martinhpedersen
Copy link
Collaborator

@blockmurder - Regarding /vendor/. We will need to migrate to using Go Modules soon, so I don't think we should do any changes to the vendor structure right now.

I will have a look at github.com/jacobsa/go-serial. Thanks :)

blockmurder added a commit that referenced this issue Oct 6, 2019
In order to support P4 Dragon (DR-7x00) modem, this driver must support custom baud rates (see #3). Furthermore it should be independant of C (cgo).
Therefore github.com/tarm/serial has been replaced with github.com/jacobsa/go-serial.

Closing #24
blockmurder added a commit to blockmurder/pat that referenced this issue Oct 7, 2019
The new serial driver (jacobsa/go-serial) requests bauderate in unsigned integer.
Update harenber/ptc-go to newest develop. Will be updated to new version as soon
as possible.

Closing harenber/ptc-go#24
@harenber
Copy link
Owner

I think we can close this issue now, after a lot of checking libraries, I ended up using https://github.com/albenik/go-serial which turned out to be stable, supported the baudrate and seems to be pure Go.

@xylo04
Copy link
Contributor

xylo04 commented Oct 28, 2020

https://github.com/albenik/go-serial currently doesn't compile on Darwin/OS X. I have a PR in to fix that, but @albenik hasn't responded to the other PR in that repo for several months and may be inactive.

@harenber
Copy link
Owner

@xylo04 Indeed the project doesn't show much activity anymore. Would you have the time to take up the reponsibility and fork the code and take care of that?

@xylo04
Copy link
Contributor

xylo04 commented Oct 28, 2020

I hesitate to commit to maintaining a fork. Let me give it some thought.

I was able to make that PR through whack-a-mole hacking, but I don't really deeply understand what this code does. If you believe golang/go#42241 (comment), albenik's approach of recreating the syscall bindings is unsupported, and it should be using the syscall package directly.

@xylo04
Copy link
Contributor

xylo04 commented Oct 28, 2020

https://github.com/albenik/go-serial was forked from https://github.com/bugst/go-serial which is still active, so we could consider looking at that.

@harenber
Copy link
Owner

I think I tried this one (bugst) and there was a show-stopper somewhere. I do not really remember, I tried a couple of serial libraries and nearly all had the problem that they did not support this non-standard baud rate we need for the P4 modems. But anyway, it's definitely worth a (2nd) look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants