[SOLVED] QtDragon - Spindle at speed LED not working

More
30 Nov 2023 16:19 - 30 Nov 2023 16:24 #286882 by bobyjx
Replied by bobyjx on topic QtDragon - Spindle at speed LED not working
I got the same issue.
I have followed this method for operation, but I have received an error:

“2023-12-01 00:15:17,932 - QTvcp.QTVCP.CORE - ERROR - Qhal: Error making new HAL pin:Invalid parameter
/usr/lib/python3/dist-packages/qtvcp/widgets/state_led.pyLine 86Function: _hal_init2023-12-01 00:15:17,933 - QTvcp.QTVCP.CORE - ERROR - Qhal: Traceback (most recent call last):File "/usr/lib/python3/dist-packages/qtvcp/core.py", line 154, in newpinp = QPin(_hal.component.newpin(self.comp, *a, **kw))^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^hal.error:Invalid parameter2023-12-01 00:15:17,932 - QTvcp.QTVCP.CORE - ERROR - Qhal: Error making new HAL pin: Invalid parameter /usr/lib/python3/dist-packages/qtvcp/widgets/state_led.pyLine 86Function: _hal_init2023-12-01 00:15:17,933 - QTvcp.QTVCP.CORE - ERROR - Qhal: Traceback (most recent call last):File "/usr/lib/python3/dist-packages/qtvcp/core.py", line 154, in newpinp = QPin(_hal.component.newpin(self.comp, *a, **kw))^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^hal.error: Invalid parameter ”

Here is my py file:
“print('\nUser command file for following spindle.0.at_speed\n')

# needed to instance patch
# reference: ruivieira.dev/python-monkey-patching-for-readability.html
import types

# import the handlerfile to get reference to it's libraries.
# use <screenname>_handler
import qtdragon_hd_handler as SELF

###############################################
# add hook to add a status request
###############################################
def before_loop__(self):
    try:

        self.w.hal_led_atspeed.setProperty('follow_halpin_state',True)
        self.w.hal_led_atspeed.setProperty('halpin_name','spindle.0.at-speed')
        self.w.hal_led_atspeed. _hal_init()
    except Exception as e:
        pass

# Here we are instance patching the original handler file to add a new
# function that calls our new function (of the same name)
# defined in this file
self.before_loop__ = types.MethodType(before_loop__, self)


Last edit: 30 Nov 2023 16:24 by bobyjx.

Please Log in or Create an account to join the conversation.

More
08 Dec 2023 18:17 #287567 by cmorley
Replied by cmorley on topic QtDragon - Spindle at speed LED not working
Sorry I missed this - did you get it working?

Please Log in or Create an account to join the conversation.

More
22 Dec 2023 17:43 #288828 by bobyjx
Replied by bobyjx on topic QtDragon - Spindle at speed LED not working
It's working fine, but I'm still getting this error

Please Log in or Create an account to join the conversation.

More
22 Dec 2023 21:36 #288849 by cmorley
Replied by cmorley on topic QtDragon - Spindle at speed LED not working
This added line should fix the error:
    try:
        self.w.led_at_speed.setProperty('halpin_option',False)   # add this line
        self.w.led_at_speed.setProperty('follow_halpin_state',True)
        self.w.led_at_speed.setProperty('halpin_name','spindle.0.at-speed')
        self.w.led_at_speed. _hal_init()
    except Exception as e:
        pass


Sorry that took so long.

Please Log in or Create an account to join the conversation.

Moderators: cmorley
Time to create page: 0.058 seconds
Powered by Kunena Forum