Physical Buttons in MDI Mode for Macros

More
5 years 10 months ago #190854 by ulistermclane
I have build an operator panel with physical buttons equivalent to gmoccapy's v-buttons and h-buttons. Button states are collected by an ESP8266 (which is overkill, but that's what I had) and a I2C multiplexer. Button states are transmitted via USB (realtime performance is not needed) using a simple serial protocol. A little python routine(switchpanel.py) takes care to transfer this to the HAL (custom_postgui.hal) .

Everything works nice in all modes except in MDI mode. I have defined two macros (including icons, see UlisCNC.ini) which I can only trigger using the screen buttons but not with the associated physical buttons. How do I need to configure my setup so that the buttons also work for macros? Thanks for a short hint.

Attachment not found


Attachment not found


Attachment not found

Please Log in to join the conversation.

More
5 years 10 months ago #190857 by Aciera
Can you see the pins "switch-h%02d" and "switch-v%02d" change state in "Hal show" when you press the button on the panel?

Please Log in to join the conversation.

More
5 years 10 months ago #190862 by ulistermclane
Yes, I can see them switching for 100 ms to true and then back to false. As mentioned, all switches work, except for macros in MDI mode. Maybe 100 ms is too short in this case? - just tried 500 ms with no effect so this is not the root cause.

Please Log in to join the conversation.

More
5 years 10 months ago #190911 by newbynobi
Please start your config from a terminal and watch for outputs related to Macros during startup. Then press the physical button and check output.

Do the Macros work if you press the screen button?

Could you post the Macros?

Norbert

Please Log in to join the conversation.

More
5 years 10 months ago #190941 by ulistermclane
During startup, both macros are detected:
Code:
**** GMOCCAPY INFO **** **** Entering make macro button found 2 Macros Macro cam_offset has image link Image = /home/uli/linuxcnc/configs/UlisCNC/macros/images/cam_offset.png Macro las_offset has image link Image = /home/uli/linuxcnc/configs/UlisCNC/macros/images/las_offset.png **** GMOCCAPY INFO ****
Both macros work in MDI mode. When I push the screen button the output is:
Code:
3 2 RUN IDLE
and the macro is executed. When I push the physical button, the output is:
Code:
Button macro_0 has been clicked
and nothing more happens. You can find one of the macros in the attachment. It is used to reposition x0/y0 after positioning the mill with a camera which has a certain offset compared to the spindle. The second macro only differs in the offset values .
Thanks for your support!

Attachment not found

Please Log in to join the conversation.

More
5 years 9 months ago #193655 by newbynobi
@ulistermclane

sorry for the delay. I found the bug and was able to fix it. The macro button did expect a pressed signal, but my code sent a clicked signal. I changed that and now it is working as expected. I pushed a fix some minutes ago. After an update to gmoccapy 3.1.2 all should work as expected.

If you use buildbot or the deb packet it could need some time to the fixes to be included.

Norbert

Please Log in to join the conversation.

Time to create page: 0.093 seconds
Powered by Kunena Forum