-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Gmoccapy MSG: Must be in MDI mode..... #2453
Comments
As there are three modes, Manual and MDI and AUTO the behavior of gmoccapy is exactly as it should! No MDI commands in MANUAL mode. Doing this, may result in a short flicker of the screen, as gmoccapy will change the screen design due to the mode switch. Norbert |
Hello Norbert,
Zdeněk |
I see fight between Gmoccapy and Halui. Gmoccapy wants "No MDI commands in MANUAL mode." But Halui sets MDI mode for MDI_COMMAND event. linuxcnc/src/emc/usr_intf/halui.cc Line 1079 in 46557dc
(I hope, that I understood halui code correct) First we should define the correct LCNC behavior when changing the halui.mdi-command-XX pin |
[Norbert]
It seems that halui is doing that already. [Zdeněk] |
[HansU]
Now I tried the test without the G4 on a third PC and the problem did not appear like you. With the G4, it will show, but only for the twentieth time. |
I still don't get that message. Does is appear when you set the execute command pin or on startup? |
I will make a video of the screen tonight, how to simulate the error. |
Here is video: The bug behaves very randomly. On this video, the message occurs more often than in other cases. Maybe the video recorder supports this bug. Even so, you can see the randomness in the video. I usually have to click through Set and Clr far more often to get it to appear at least once. Furthermore, I found that increasing the probability of a bug occurring can be ensured by increasing the number of G and M codes in MDI_COMMAND. |
The video file seems to be damaged. Please upload again. |
The video is OK. It works in some player and in some player not. Can I ask you for VLC player use? I test it in 2 PC and it works. In my mobile it works not. |
Ok it works if I download it. Just didn't work in the browser. Furthermore Github is now capable of embedding videos. |
Hi Hans, did you manage to simulate this bug? |
No I still couldn't reproduce it. But maybe that's because I am running it on a VM. I'll have another try on a real machine... |
That's weird. I am able to simulate it on 2 PCs and 1 VM. Try reducing the CPU on the VM. I have a feeling that the error is more frequent when the CPU is more heavily loaded. Would it help if I gave you access to my PC? |
the three modes, Manual, MDI and AUTO are not a feature of gmocappy, but of linuxcnc task. I believe you do not see the behavior in axis, as it does not switch the ui when task changes modes. |
Try reducing the cycle time (INI setting), I could reproduce the error, but only on one PC (poor CPU Power) setting the cycle time to 150 solved the problem on my PC. Norbert |
[rene-dev]
You're right. #2453 (comment) [Norbert]
I tried 300ms and it did not help. :-( I would like to show you one more thing about this bug. Sometimes Gmoccapy gets stuck in MDI mode. Watch this video. At time 00:00 Gmoccapy is in MANUAL mode and then after executing MDI_COMMAND it remains in MDI mode. MDI_screen_stuck.mp4In this video CYCLE_TIME = 300 |
Gmoccapy do change the screen Design according to the MODE selection button or due to signals from LinuxCNC and so far it works as it should. The problem seems to be related to the MDI commands. If you try with an MDI command with any movement i.e. G91 G0 Z0.001 you will not be able to reproduce the error, as LinuxCNC will emit the signal of the actual Mode but if you use a command without a Gcode Brake the signal will not be emmited. I do not know a solution at this moment. Norbert |
I tried:
It did not help. I don't need this bug fixed immediately, but I could ask you to label this bug 2.9-must-fix, or add it to some list of things that must be fixed. |
I tried to do the same with TAG 2.8.4
In the LCNC 2.8 version, the SET and CLR buttons are not in the halshow, so I used the MIST and FLOOD buttons.
The video shows that the error also appears in version 2.8.4. |
I did the test from the previous post on other versions: Finding this error is challenging. Appears randomly. Here is the terminal listing when I press the button and execute MDI_COMMAND. LCNC 2.7.15:
LCNC 2.8.0:
LCNC 2.8.0 bug:
[HansU] |
I asked Fupe to try to look into this problem of mine. At first I was disappointed because his feedback was that he was unable to simulate the problem on either a physical PC or a Virtual Machine. Finally we found out that he is not using Oracle VM, but using another VM. So based on his help, we know that we need to use Oracle VM to simulate this bug. Next, I verified that it is really necessary to reduce the CPU performance. At 100% CPU the error did not appear, at 30% the error appears stably. |
No, I still don't get that message even when limiting the CPU to 30 % :/ |
Thank you for info. |
Hello, I am very unhappy that you are not able to simulate my bug. I made another attempt today. I made a new Virtual Box in Oracle VM. I installed it with linuxcnc-2.8.2-buster.iso file. In order to install this iso file, it is necessary to set at least 2 processor cores, otherwise the installation will fail. After installing I updated:
I started linuxcnc and opened the Gmoccapy sim. I closed linuxcnc edit /home/zdenek/linuxcnc/configs/sim.gmoccapy/gmoccapy.ini
edit /home/zdenek/linuxcnc/configs/sim.gmoccapy/gmoccapy_postgui.hal
Now when I tried to simulate the bug, the bug did not appear. Then I reduced the CPU performance and the bug appeared. [hansu] Here you can download the VM file for Oracle VM VirtualBox: I did the installation twice. Once in Czech and once in English. There was no difference. |
Yeah I can try a bit more around. But this also might depend on the power of teh host machine. What does your VM host have for a CPU? |
No nothing :( |
Can I ask you if you could try changing the INI like this:
? Stay in VM with low CPU. I found that the more commands in MDI_COMMANDS, the more occurrences of that message. Here it is even interesting that sometimes it ignores the G4 command and does not give any message. |
I can reproduce this on a 2.10pre build from march. This is a simulation machine without RT-kernel. |
Hello everybody, I spent this evening again looking for the source of this bug. I am convinced that the source of this bug is the bad functionality of EMC_TASK_INTERP. I spent tonight to prove that EMC_TASK_INTERP works badly. I would like to ask you to confirm or refute my theory. Since I don't want to waste your precious time, I have prepared an attempt that has no dependence on previous posts. If you are willing to help me, just read only this post. In this part of the Gmoocapy code linuxcnc/src/emc/usr_intf/gmoccapy/gmoccapy.py Lines 2572 to 2622 in 67b8140
I would assume that the commands will be executed when the LCNC is only in IDLE. QUESTION 1: Is my assumption correct? To verify that LCNC is in IDLE, I added the following lines to Gmoccapy's source code:
I would expect self.stat.interp_state to be equal to linuxcnc.INTERP_IDLE. When we look at the video, we find out that mostly LCNC is READING (2) and at the end of the video, LCNC is IDLE (1). This video shows mostly state 2 and once 1. During longer testing, states 1 and 2 appear more randomly. Please do not take this post of mine as offensive or sarcastic. I really just need help. I am very unhappy with this bug. I asked the questions in such a way that they could be answered simply yes/no and did not delay you. |
Do you need to poll the status channel to ensure that it is up to date before reading it? |
Oh yeah, you're right. I'm an idiot :-(.
|
AXIS gui does not seem to have this bug, would that not indicate that the problem is with gmoccpy rather than with python stat or halui? |
This bug is really insidious, the fact that it did not show up in AXIS does not mean that it is not there. Assuming this bug is not in AXIS, we can rule out halui. I think AXIS doesn't use python stat. It is so? |
AXIS does use linuxcnc.stat |
Thank you. I did not know it. |
I have not been able to reproduce this bug in AXIS despite changing mdi-command-xx for about a hundred times in jog mode, zero issue while in GMOCCAPY it pops up pretty much right away on my machine. |
Sigma1912 |
I'm running a RIP install and I presumed that I could just alter python files and restart the config to test, yet it seems that somehow it is not using the updated code? Surely I don't need to recompile for python code. |
When I make a change in the python file, I have to be in the terminal in the linuxcnc/src folder and I have to run make. |
I see, I'll have to switch to another machine since this one has issues that give me errors while running make. |
Just made a new rip install on a different computer but on that machine I cannot reproduce the issue at all unfortunately. |
Try again after some time, after restarting the PC. I've cheered many times that some modification of mine fixed the bug, but it always appeared. |
Hello everybody, I feel like I've solved it again. However, I don't want to write here that I have a solution. Therefore, I will write that I have another theory of the cause of this bug. It will be theory number 156: Here si defined finish of MDI_command: linuxcnc/src/emc/task/emctaskmain.cc Lines 683 to 699 in 56883b9
I believe that one condition is missing to determine the end of MDI_command. The halui_sent_mdi parameter is defined here: linuxcnc/src/emc/usr_intf/halui.cc Line 253 in beacb3c
A situation may arise: linuxcnc/src/emc/usr_intf/halui.cc Lines 2131 to 2141 in beacb3c
4) If old_mode was manual, we have the mode manual NOT MDI !!! 5) Gmoccapy execute G43 command in manual 6) linuxcnc/src/emc/task/emctaskmain.cc Lines 2016 to 2019 in eea3b99
I would like to ask for help in verifying this theory. The problem is that the halui_sent_mdi parameter is in halui.cc and the finish MDI_command is in emctaskmain.cc. |
Sorry, I spend a whole day, trying to reproduce the error, but was not able on my Laptop (i7 with Linux Mint and actual kernel 6.2.0-43). I also use MDI commands for a 24 positions rack tool change on a real machine about 3 years and had never this problem. It is very complicated to find a supposed misbehavior which only occur randomly and only on very few computers. By the way, are you using io or iov2? do not use iov2! Closing this until getting a situation where reproducing is possible. |
Hello Norbert, It's a shame you can't simulate it.
Does this change apply to version 2.9.0 which is coming out soon? Will the Rene-dev remake cover this issue as well? Please Re-open this Issue. I would like to ask you to believe me that this problem is in these lines: linuxcnc/src/emc/usr_intf/gmoccapy/gmoccapy.py Lines 3540 to 3544 in 56883b9
These lines cause race conditions. I realize that these lines have been in Gmoccapy since the beginning and no one has complained. Trust me, I'm a bug magnet. Once I removed these lines from gmoccapy.py, my problems with the M61 and M6 disappeared, not only this problem. I have several Issues open here on github regarding the M6 and M61. It makes a bit of a mess because I didn't know all these Issues had this cause. In some other Issue, you wrote that it is LCNC's fault.
I think that the conclusion of the Meetup in Stuttgart may not be a solution to this problem, but an opinion should be agreed whether it is a bug of LCNC or a bug of Gmoccapy (Python Interface) Way1 or way2 can be correct. It is necessary to agree. I'm sorry I couldn't make it to the Meetup in Stuttgart. My English is bad. I would like to know you, but I would not understand you. |
Rene's part will be in 2.10 not in 2.9! I know it is a shame not to be able to solve every problem, but that is unfortunately the fact. If disabling lines in gmoccapy code, that might be the way for you to go. I am sure that the lines do not cause the problem you discribed, as also with lower cycle time you reported the beehavior. |
Would it help if I somehow made my computer available to you, where the error can be simulated? I don't know how to do it right now, but I can keep my computer on all the time. |
I use RIP LCNC Branche 2.9
Simulate the problem:
add:
Run LCNC

This error is random, so it may not appear the first time.
Constantly switch to MDI mode and enable/disable HAL pins halui.mdi-command-00 and halui.mdi-command-01
MDI commands run fine, but sometimes this message pops up.
I have more sophisticated commands on the real machine. I was in MDI-mode the whole time when I tuned them and never had this problem. However, for normal use of my commands, I want to be in JOG mode and that's where the message appears.
The text was updated successfully, but these errors were encountered: