-
Notifications
You must be signed in to change notification settings - Fork 31
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
ugreen-check-standby not working #45
Comments
Sorry for the late response. I am quite busy recently. The program now uses Alternatively, you can try to run the following command and check the return value of
If it works, I can try to figure out how |
Here is an example of the #include <iostream>
#include <string>
#include <optional>
#include <cstdint>
#include <fcntl.h>
#include <linux/hdreg.h>
#include <sys/ioctl.h>
#include <unistd.h>
std::optional<bool> is_standby_mode(const std::string &device) {
int fd = open(device.c_str(), O_RDONLY | O_NONBLOCK);
if (fd == -1) {
std::cerr << "Failed to open device: " << device << std::endl;
return std::nullopt;
}
unsigned char args[4] = { WIN_CHECKPOWERMODE1, 0, 0, 0 };
if (ioctl(fd, HDIO_DRIVE_CMD, args) == -1) {
std::cerr << "ioctl failed in checking power mode of " << device << std::endl;
close(fd);
return std::nullopt;
}
std::cout << "Returned: " << std::hex
<< (uint32_t)args[0] << " "
<< (uint32_t)args[1] << " "
<< (uint32_t)args[2] << " "
<< (uint32_t)args[3] << std::endl;
close(fd);
return args[2] == 0x00;
}
int main(int argc, char *argv[]) {
is_standby_mode(argv[1]);
return 0;
} You can compile it and run to see its outputs, and change g++ <the code>.cpp -o check -O2
./check /dev/sda |
Unfortunately smartctl does not give me any information about the standby state.
|
The outputs show that your disk is not in the standby mode, since the parameter |
Here is the result. # ./check1 /dev/sdb
Returned: e5 0 0 0
# ./check2 /dev/sdb
Returned: 98 0 0 0 What do the values mean? |
Yes, it is 0 |
The, "ugreen-check-standby" program is not working properly for my DXP8800 Plus.
The color of the LEDs always changes immediately even though the hard disks are active and definitely not in standby.
The HHD Model is WD120EDAZ. But i also had some WD Green 2TB and Seagate 2TB NAS Drive in there and it was the same for them.
How is it determined whether the HDDs are in standby mode? Is there any way I can see this on the shell itself?
Using hdparm? It shows me "unknown" as drive state.
Originally posted by @0x556c79 in #13 (comment)
The text was updated successfully, but these errors were encountered: