chilipeppr / serial-port-json-server

Serial Port JSON Server is a websocket server for your serial devices. It compiles to a binary for Windows, Mac, Linux, Raspberry Pi, or BeagleBone Black that lets you communicate with your serial port from a web application. This enables web apps to be written that can communicate with your local serial device such as an Arduino, CNC controller, or any device that communicates over the serial port.
http://chilipeppr.com
GNU General Public License v2.0
321 stars 101 forks source link

Different serial libraries used in multiple places in the code #37

Open DanielJoyce opened 7 years ago

DanielJoyce commented 7 years ago

Which should be used?

For example, seriallist.go has the following

import (
    //"fmt"
    //"github.com/lxn/win"
    //"github.com/mattn/go-ole"
    //"github.com/mattn/go-ole/oleutil"
    "github.com/go-ole/go-ole"
    "github.com/go-ole/go-ole/oleutil"
    //"github.com/tarm/goserial"
    //"github.com/johnlauer/goserial"
    "log"
    "os"
    "strings"

    "github.com/facchinm/go-serial"
    //"encoding/binary"
    "strconv"
    "sync"
    //"syscall"
    "regexp"
)

while serialport.go has

import (
    "bytes"
    "encoding/json"
    "encoding/base64"
    "sync"

    "github.com/johnlauer/goserial"
    //"github.com/facchinm/go-serial"
    "io"
    "log"
    "strconv"
    "strings"
    "time"
)

Which is it, "github.com/johnlauer/goserial" or "github.com/facchinm/go-serial" ?

A couple other files have this problem too.

chilipeppr commented 7 years ago

Probably John Lauer one

On Apr 27, 2017 12:51 PM, "Daniel" notifications@github.com wrote:

Which should be userd?

For example, seriallist.go has the following

import ( //"fmt" //"github.com/lxn/win" //"github.com/mattn/go-ole" //"github.com/mattn/go-ole/oleutil" "github.com/go-ole/go-ole" "github.com/go-ole/go-ole/oleutil" //"github.com/tarm/goserial" //"github.com/johnlauer/goserial" "log" "os" "strings"

"github.com/facchinm/go-serial" //"encoding/binary" "strconv" "sync" //"syscall" "regexp" )

while serialport.go has

import ( "bytes" "encoding/json" "encoding/base64" "sync"

"github.com/johnlauer/goserial" //"github.com/facchinm/go-serial" "io" "log" "strconv" "strings" "time" )

Which is it, "github.com/johnlauer/goserial" or " github.com/facchinm/go-serial" ?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/chilipeppr/serial-port-json-server/issues/37, or mute the thread https://github.com/notifications/unsubscribe-auth/AHidbUEIKJVLxdIhY0-AaIaIsErbeyWoks5r0PG8gaJpZM4NKsGS .

DanielJoyce commented 7 years ago

Neither apply cleanly in all cases. :P It seems feature sets have diverged and it also seems unwise to be using two serial port libraries.

DanielJoyce commented 7 years ago

When I try and replace all occurences of "github.com/facchinm/go-serial" with johnlauer/goserial I get the following build error

./programmer.go:373: undefined: serial.Mode
./programmer.go:378: too many arguments in call to serial.OpenPort
        have (string, <T>)
        want (*serial.Config)
./programmer.go:400: undefined: serial.GetPortsList
./programmer.go:404: undefined: serial.GetPortsList
./programmer.go:438: undefined: serial.Mode
./programmer.go:443: too many arguments in call to serial.OpenPort
        have (string, <T>)
        want (*serial.Config)
./seriallist.go:32: undefined: serial.GetPortsList
chilipeppr commented 7 years ago

i'd leave it alone then. serial libraries serve different purposes. one purpose is a library that has better serial port listing capabilities. another purpose is the raw opening of the port.

On Thu, Apr 27, 2017 at 3:10 PM, Daniel notifications@github.com wrote:

When I try and replace all occurences of serial lib with johnlauer/goserial I get the following build error

./programmer.go:373: undefined: serial.Mode ./programmer.go:378: too many arguments in call to serial.OpenPort have (string, ) want (serial.Config) ./programmer.go:400: undefined: serial.GetPortsList ./programmer.go:404: undefined: serial.GetPortsList ./programmer.go:438: undefined: serial.Mode ./programmer.go:443: too many arguments in call to serial.OpenPort have (string, ) want (serial.Config) ./seriallist.go:32: undefined: serial.GetPortsList

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/chilipeppr/serial-port-json-server/issues/37#issuecomment-297853278, or mute the thread https://github.com/notifications/unsubscribe-auth/AHidbYgzVxsEYwiyToU2MmHWQKzHYV-Yks5r0RJZgaJpZM4NKsGS .