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

tripplitesu: Fix initialization after UART power cycle when tripplite firmware is buggy #220

Closed
wants to merge 1 commit into from
Closed
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
7 changes: 6 additions & 1 deletion drivers/tripplitesu.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
#include "serial.h"

#define DRIVER_NAME "Tripp Lite SmartOnline driver"
#define DRIVER_VERSION "0.03"
#define DRIVER_VERSION "0.04"

/* driver description structure */
upsdrv_info_t upsdrv_info = {
Expand Down Expand Up @@ -552,6 +552,11 @@ static int init_comm(void)
char response[MAX_RESPONSE_LENGTH];

ups.commands_available = 0;
//Repeat enumerate command 2x, firmware bug on some units garbles 1st response
if (do_command(POLL, AVAILABLE, "", response) <= 0){
upslogx(LOG_NOTICE, "init_comm: Initial response malformed, retrying in 300ms");
usleep(3E5);
}
if (do_command(POLL, AVAILABLE, "", response) <= 0)
return 0;
i = strlen(response);
Expand Down