kusti8 / hue-plus

A Windows and Linux driver in Python for the NZXT Hue+
GNU General Public License v3.0
229 stars 18 forks source link

hue_plus crashes #21

Open CartoonKnite opened 6 years ago

CartoonKnite commented 6 years ago

Whenever I try to change any lighting settings, the program crashes and a dialogue box tells me python has stopped working. I've reinstalled hue_plus and python to no avail

CartoonKnite commented 6 years ago

1 2

akej74 commented 6 years ago

Not sure it this is relevant, but I had to rewrite the "excepthook" as follows to manage unhandled exceptions in QT in a nice way (from my Grid Control project):

In my "helper.py":

def excepthook(excType, excValue, tracebackobj):
    """Rewritten "excepthook" function, to display a message box with details about the exception.
    @param excType exception type
    @param excValue exception value
    @param tracebackobj traceback object
    """
    separator = '-' * 40
    notice = "An unhandled exception has occurred\n"

    tbinfofile = io.StringIO()
    traceback.print_tb(tracebackobj, None, tbinfofile)
    tbinfofile.seek(0)
    tbinfo = tbinfofile.read()
    errmsg = '%s: \n%s' % (str(excType), str(excValue))
    sections = [separator, errmsg, separator, tbinfo]
    msg = '\n'.join(sections)

    # Create a QMessagebox
    error_box = QtWidgets.QMessageBox()

    error_box.setText(str(notice)+str(msg))
    error_box.setWindowTitle("Grid Control - unhandled exception")
    error_box.setIcon(QtWidgets.QMessageBox.Critical)
    error_box.setStandardButtons(QtWidgets.QMessageBox.Ok)
    error_box.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse)

    # Show the window
    error_box.exec_()
    sys.exit(1)

And then the following in main:

if __name__ == "__main__":
    # Use a rewritten excepthook for displaying unhandled exceptions as a QMessageBox
    sys.excepthook = helper.excepthook
kusti8 commented 6 years ago

I'll add it and release a new version soon. I was planning on doing it but got caught up in things

On Fri, Oct 20, 2017, 5:10 AM Åke Johansson notifications@github.com wrote:

Not sure it this is relevant, but I hade to rewrite the "excepthook" as follows to manage unhandled exceptions in QT in a nice way:

In my "helper.py":

def excepthook(excType, excValue, tracebackobj): """Rewritten "excepthook" function, to display a message box with details about the exception. @param excType exception type @param excValue exception value @param tracebackobj traceback object """ separator = '-' * 40 notice = "An unhandled exception has occurred\n"

tbinfofile = io.StringIO()
traceback.print_tb(tracebackobj, None, tbinfofile)
tbinfofile.seek(0)
tbinfo = tbinfofile.read()
errmsg = '%s: \n%s' % (str(excType), str(excValue))
sections = [separator, errmsg, separator, tbinfo]
msg = '\n'.join(sections)

# Create a QMessagebox
error_box = QtWidgets.QMessageBox()

error_box.setText(str(notice)+str(msg))
error_box.setWindowTitle("Grid Control - unhandled exception")
error_box.setIcon(QtWidgets.QMessageBox.Critical)
error_box.setStandardButtons(QtWidgets.QMessageBox.Ok)
error_box.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse)

# Show the window
error_box.exec_()
sys.exit(1)

And then the following in main:

if name == "main":

Use a rewritten excepthook for displaying unhandled exceptions as a QMessageBox

sys.excepthook = helper.excepthook

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kusti8/hue-plus/issues/21#issuecomment-338151385, or mute the thread https://github.com/notifications/unsubscribe-auth/AJW73BxAsg4Qpu4QOjT5jh1ys9xQdVZoks5suGObgaJpZM4Pxmq0 .

kusti8 commented 6 years ago

New version released. Can you run it and show what the error is?

CartoonKnite commented 6 years ago

Hi,

Now it gives me this error (after updating) error_hue_plus

kusti8 commented 6 years ago

How many strips do you have ? Is your device firmware up to date ?

On Sat, Oct 28, 2017, 12:04 AM CartoonKnite notifications@github.com wrote:

Hi,

Now it gives me this error (after updating) [image: error_hue_plus] https://user-images.githubusercontent.com/7981135/32131086-84d4bd8a-bb73-11e7-8180-911f1e9fb3e8.png

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/kusti8/hue-plus/issues/21#issuecomment-340137446, or mute the thread https://github.com/notifications/unsubscribe-auth/AJW73J16DjqHRCXTGI_BLOp5enJGGI3Sks5swqe8gaJpZM4Pxmq0 .

CartoonKnite commented 6 years ago

I have 6 strips. Just checked, and my firmware is up to date.

kusti8 commented 6 years ago

How are the strips connected ? How many on each channel?

CartoonKnite commented 6 years ago

3 on each channel

CartoonKnite commented 6 years ago

Still hoping this can be fixed sometime :(

CartoonKnite commented 6 years ago

So, I had to make an upgrade. New processor, motherboard, and install of windows. I'm getting the same error still. So, I imagine that probably means my issue has something to do with the unit itself rather than something on my computer. Hope this is helpful

CartoonKnite commented 6 years ago

Ok, update. So I have no idea why this worked, but it seems like my second port on the hue+ device can only handle two LED strips. The other one can handle three. So I just unplugged one, and everything works now.

jonkiersey commented 5 years ago

I started running into the same problem as CartoonKnite after adding another fan. Doing some troubleshooting by isolating the new fan, it seems that an Aer RGB 2 is not compatible with the Hue+. I don't expect a fix from this project, just posting because I can't find anywhere else that lists that incompatibility and I would bet that was also what was causing CartoonKnite's issue.