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

Unable to read AT command response on windows 10 machine using 8 Port USB Modem Pool #114

Open
mateors opened this issue Jul 26, 2020 · 2 comments

Comments

@mateors
Copy link

mateors commented Jul 26, 2020

I am using windows 10 operating system and send AT+COPS? command to my USB modem pool device connected to my machine. It seems AT command is sending and working properly but still response receive empty.

seemy code and command output

c := &serial.Config{Name: "COM7", Baud: 115200, Parity: 'N', StopBits: 1, ReadTimeout: time.Second * 3}

port, err := serial.OpenPort(c)
if err != nil {
	fmt.Println("OpenError: ", err)
}
defer port.Close()

n, err := port.Write([]byte("AT+COPS?\n"))
if err != nil {
	fmt.Println("ERROR: ", err)
}
time.Sleep(1 * time.Second)

buffer := make([]byte, 1024)
n, err = port.Read(buffer)
if err != nil {
	fmt.Println("ERROR: ", err)
}
fmt.Printf("DATA: %v %d", buffer[:n], n)

Output:
DATA: [] 0

same device working perfectly with my c# code.

is there anything missing from my side? or its a bug?

@LauJangit
Copy link

same problem in win 10 with single port modem

@peteArnt
Copy link

I may be a little late to the party, but here goes:
Instead of using "\n" as a terminator for your AT command, try using "\r". The newline may be ignored by the modem.

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

3 participants