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

Connecting to existing port crashes PC #119

Open
manojbshekaris opened this issue May 14, 2021 · 0 comments
Open

Connecting to existing port crashes PC #119

manojbshekaris opened this issue May 14, 2021 · 0 comments

Comments

@manojbshekaris
Copy link

manojbshekaris commented May 14, 2021

Hey I tried to open bluetooth module HC-05(com7), that has been already connected to PC.
from the code, I cannot open an already opened port. If I try to explicitly specify this COM7 (for me, at the time of development) and write to bluetooth, the bluetooth crashes. I did not dig deep in, but also the PC crashed. I am using Windows 10.

  func main() {
      c := &serial.Config{Name: "COM7", Baud: 9600, ReadTimeout: time.Millisecond * 500}
      s, err := serial.OpenPort(c)
      if err != nil {
	      log.Fatal(err)
      }
      fmt.Println("writing")
  
      n, err := s.Write([]byte("F"))
      if err != nil {
	      log.Fatal(err)
      }
      fmt.Println(n)
  }
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

1 participant