Physical Buttons in MDI Mode for Macros

More
02 Dec 2020 08:47 - 02 Dec 2020 08:51 #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.

File Attachment:

File Name: switchpanel.py
File Size:2 KB

File Attachment:

File Name: custom_postgui.hal
File Size:1 KB

File Attachment:

File Name: UlisCNC.ini
File Size:3 KB
Attachments:
Last edit: 02 Dec 2020 08:51 by ulistermclane.

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

More
02 Dec 2020 09:04 #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 or Create an account to join the conversation.

More
02 Dec 2020 09:28 - 02 Dec 2020 10:08 #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.
Last edit: 02 Dec 2020 10:08 by ulistermclane.

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

More
02 Dec 2020 21:48 #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 or Create an account to join the conversation.

More
03 Dec 2020 07:49 #190941 by ulistermclane
During startup, both macros are detected:
**** 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:
3 2
RUN
IDLE
and the macro is executed. When I push the physical button, the output is:
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!

File Attachment:

File Name: cam_offset.ngc
File Size:0 KB
Attachments:

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

More
31 Dec 2020 14:40 #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 or Create an account to join the conversation.

Moderators: newbynobiHansU
Time to create page: 0.084 seconds
Powered by Kunena Forum