-
Notifications
You must be signed in to change notification settings - Fork 9
PC can't properly enter the sleep mode when PinOne is connected #1
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
Comments
I would recommend just setting windows to power off the usb device when the computer shuts down or is sleeping. This will also ensure all the LEDs turn off. And another option -- I do not have this issue on my PC when it is sleeping, but I am wondering if the problem could be related to the accelerometer sending a signal. Can you try setting the "dead zone" a bit higher to see if that resolves the issue? |
If you mean the USB selective suspend power option, then it's not a good workaround. I want my other devices to remain working so that I can wake the PC with keyboard, for example. Many keyboards and other devices support this option. For example, it's available in QMK keyboard firmware, and the keyboards turn off the backlight when the device is in sleep mode and turn it on automatically when the device wakes up. I still believe there needs to be a proper suspend option in firmware that will turn off the LEDs and disable the accelerometer to prevent accidental wakeup. I think my dead zone was already set pretty high for the accelerometer and it was not causing the stick movements in Steam controller test UI. I'll double-check again later. |
I double checked that dead zone is not the case, the device still wakes the PC instantly with the following:
The option to wake the computer from sleep is disabled and unchecked: My PinOne is plugged in into the powered USB hub, maybe that prevents it from turning off? I hope the proper suspend is implemented in the firmware, otherwise I have to unplug the device every time I suspend the PC. |
Sounds like it could be the USB hub because I don't have any issues on any of the computers I have tested it on and even the wake event is tied to the USB hub and not the PinOne board. In either case I will at least look into implementing some kind of sleep procedure but it is not a high priority at this time and I will need to ensure that it doesn't affect the performance of the device too. |
This may be the issue caused by the Joystick library you are using. A similar issue was mentioned here: MHeironimus/ArduinoJoystickLibrary#197. |
It looks like you can fix it by applying this logic: MHeironimus/ArduinoJoystickLibrary#242 (comment). I didn't check your code yet, but maybe you are sending some updates even if the values did not change? EDIT: From first look, it might very well be the case:
This example doesn't send the value if it's the same, but your code doesn't have this check: |
Yes I have thought of this, I can do some checking to determine if the value has changed before sending out to the computer. The problem is the analog outputs for the accelerometer and plunger as you typically want those values sent regardless of position. I will have to have some kind of timer to turn off the sending of events after a period of time of no activity and then be able to quickly start sending events again once activity is seen. |
From what I can see, the values for accelerometer and plunger that are sent via The raw values you send via serial should not be a problem (AFAIK, it's not causing the wake). |
I'll try it that way. the serial commands are only sent when connected to the config tool so those should be fine. I was thinking that the plunger will end up sending something occasionally since it's an analog read and even a difference in one digit will cause it to send a new value, but I'll start by adjusting that value and see if it fixes the issue for you. |
Here is a more easy and straightforward fix: #2. I verified that it works and fixes the issue for me. |
Very nice, I didn't realize that check was available with no additional imports or coding. |
PC immediately wakes up until I disconnect the USB. This happens with Virtual Pinball PinOne Mini Machine.
The firmware needs to handle suspend mode.
Related:
The text was updated successfully, but these errors were encountered: