Skip to content

Wait a while before using serial port #34

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

Merged
merged 4 commits into from
Nov 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion command/device/provision.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ func (p provision) run() error {
return err
}
defer p.ser.Close()
logrus.Infof("%s\n\n", "Connected to board")

// Wait some time before using the serial port
time.Sleep(2000 * time.Millisecond)
logrus.Infof("%s\n\n", "Connected to the board")

// Send configuration commands to the board
err = p.configBoard()
Expand Down
2 changes: 1 addition & 1 deletion internal/serial/serial.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (s *Serial) Connect(address string) error {
}
s.port = port

s.port.SetReadTimeout(time.Millisecond * 2000)
s.port.SetReadTimeout(time.Millisecond * 2500)
return nil
}

Expand Down