Problem opening gcode file

I’ve managed to get a decent calibration on my non standard frame, finally.
Just before I had to leave the workshop this morning, I thought I’d have a go at cutting a gcode file, so I used the ‘Open File’ button. GC crashed, and it wasn’t a one-off. The crash message is here:

[INFO ] Kivy v1.8.0[INFO ] [Logger ] Record log in /root/.kivy/logs/kivy_17-08-19_3.txt[INFO ] [Factory ] 157 symbols loaded[DEBUG ] [Cache ] register <kv.lang> with limit=None, timeout=Nones[DEBUG ] [Cache ] register <kv.image> with limit=None, timeout=60s[DEBUG ] [Cache ] register <kv.atlas> with limit=None, timeout=Nones[INFO ] [Image ] Providers: img_tex, img_dds, img_pygame, img_pil, img_gif [DEBUG ] [Cache ] register <kv.texture> with limit=1000, timeout=60s[DEBUG ] [Cache ] register <kv.shader> with limit=1000, timeout=3600s[DEBUG ] [Window ] Ignored <egl_rpi> (import error)[INFO ] [Window ] Provider: pygame([‘window_egl_rpi’] ignored)[DEBUG ] [Window ] Display driver x11[DEBUG ] [Window ] Actual window size: 800x600[DEBUG ] [Window ] Actual color bits r8 g8 b8 a0[DEBUG ] [Window ] Actual depth bits: 24[DEBUG ] [Window ] Actual stencil bits: 8[DEBUG ] [Window ] Actual multisampling samples: 2[INFO ] [GL ] OpenGL version <3.0 Mesa 10.3.2>[INFO ] [GL ] OpenGL vendor [INFO ] [GL ] OpenGL renderer <Gallium 0.4 on NVA8>[INFO ] [GL ] OpenGL parsed version: 3, 0[INFO ] [GL ] Shading version <1.30>[INFO ] [GL ] Texture max size <8192>[INFO ] [GL ] Texture max units <16>[DEBUG ] [Shader ] Fragment compiled successfully[DEBUG ] [Shader ] Vertex compiled successfully[DEBUG ] [ImagePygame ] Load </usr/lib/python2.7/dist-packages/kivy/data/glsl/default.png>[INFO ] [Window ] virtual keyboard not allowed, single mode, not docked[INFO ] [Text ] Provider: pygame[DEBUG ] [Cache ] register <kv.loader> with limit=500, timeout=60s[INFO ] [Loader ] using a thread pool of 2 workers[DEBUG ] [Cache ] register <textinput.label> with limit=None, timeout=60.0s[DEBUG ] [Cache ] register <textinput.width> with limit=None, timeout=60.0s[DEBUG ] [App ] Loading configuration </root/groundcontrol.ini>[DEBUG ] [App ] Loading kv <./groundcontrol.kv>[INFO ] [OSC ] using for socket[DEBUG ] [Base ] Create provider from mouse,disable_multitouch[DEBUG ] [Base ] Create provider from probesysfs[DEBUG ] [ProbeSysfs ] using probsysfs![INFO ] [Base ] Start application main loop[DEBUG ] [Atlas ] Load </usr/lib/python2.7/dist-packages/kivy/data/…/data/images/defaulttheme.atlas>[DEBUG ] [Atlas ] Need to load 1 images[DEBUG ] [Atlas ] Load </usr/lib/python2.7/dist-packages/kivy/data/…/data/images/defaulttheme-0.png>[DEBUG ] [ImagePygame ] Load </usr/lib/python2.7/dist-packages/kivy/data/…/data/images/defaulttheme-0.png>[INFO ] [GL ] NPOT texture support is available
Connected on port /dev/ttyACM1
Sending: B12 I0 J8148.0 K10 M6.35 N3.17 P7560.0 S400 T5 U10 V20 W1 X0 Sending: B03 A1200 C1219.2 Q2308.56 E516.47 F263.15 R139 H79 Y1 Z100 Machine Position Report Command Misread Happened OnceSending: ~ Sending: B12 I0 J8148.0 K10 M6.35 N3.17 P7560.0 S400 T5 U10 V20 W1 X0 Sending: B03 A1200 C1219.2 Q2308.56 E516.47 F263.15 R139 H79 Y1 Z100 Sending: B05 Sending: G21 Sending: ~ Sending: G91 G00 Y-10.0 G90 Sending: G91 G00 Y-10.0 G90 Sending: G91 G00 Y-10.0 G90 Sending: G91 G00 Y-10.0 G90 Sending: G91 G0 X-10.0 G90 Sending: G91 G0 X-10.0 G90 Sending: G91 G0 X-10.0 G90 [INFO ] [Base ] Leaving application in progress… Traceback (most recent call last): File “./main.py”, line 643, in GroundControlApp().run() File “/usr/lib/python2.7/dist-packages/kivy/app.py”, line 792, in run runTouchApp() File “/usr/lib/python2.7/dist-packages/kivy/base.py”, line 481, in runTouchApp EventLoop.window.mainloop() File “/usr/lib/python2.7/dist-packages/kivy/core/window/window_pygame.py”, line 381, in mainloop self._mainloop() File “/usr/lib/python2.7/dist-packages/kivy/core/window/window_pygame.py”, line 287, in _mainloop EventLoop.idle() File “/usr/lib/python2.7/dist-packages/kivy/base.py”, line 324, in idle self.dispatch_input() File “/usr/lib/python2.7/dist-packages/kivy/base.py”, line 309, in dispatch_input post_dispatch_input(*pop(0)) File “/usr/lib/python2.7/dist-packages/kivy/base.py”, line 220, in post_dispatch_input listener.dispatch(‘on_motion’, etype, me) File “kivy/_event.pyx”, line 316, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:4690) File “/usr/lib/python2.7/dist-packages/kivy/core/window/init.py”, line 645, in on_motion self.dispatch(‘on_touch_down’, me) File “kivy/_event.pyx”, line 316, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:4690) File “/usr/lib/python2.7/dist-packages/kivy/core/window/init.py”, line 657, in on_touch_down if w.dispatch(‘on_touch_down’, touch): File “kivy/_event.pyx”, line 316, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:4690) File “/usr/lib/python2.7/dist-packages/kivy/uix/popup.py”, line 185, in on_touch_down return super(Popup, self).on_touch_down(touch) File “/usr/lib/python2.7/dist-packages/kivy/uix/modalview.py”, line 243, in on_touch_down super(ModalView, self).on_touch_down(touch) File “/usr/lib/python2.7/dist-packages/kivy/uix/widget.py”, line 284, in on_touch_down if child.dispatch(‘on_touch_down’, touch): File “kivy/_event.pyx”, line 316, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:4690) File “/usr/lib/python2.7/dist-packages/kivy/uix/widget.py”, line 284, in on_touch_down if child.dispatch(‘on_touch_down’, touch): File “kivy/_event.pyx”, line 316, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:4690) File “/usr/lib/python2.7/dist-packages/kivy/uix/widget.py”, line 284, in on_touch_down if child.dispatch(‘on_touch_down’, touch): File “kivy/_event.pyx”, line 316, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:4690) File “/usr/lib/python2.7/dist-packages/kivy/uix/relativelayout.py”, line 203, in on_touch_down ret = super(RelativeLayout, self).on_touch_down(touch) File “/usr/lib/python2.7/dist-packages/kivy/uix/widget.py”, line 284, in on_touch_down if child.dispatch(‘on_touch_down’, touch): File “kivy/_event.pyx”, line 316, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:4690) File “/usr/lib/python2.7/dist-packages/kivy/uix/widget.py”, line 284, in on_touch_down if child.dispatch(‘on_touch_down’, touch): File “kivy/_event.pyx”, line 316, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:4690) File “/usr/lib/python2.7/dist-packages/kivy/uix/widget.py”, line 284, in on_touch_down if child.dispatch(‘on_touch_down’, touch): File “kivy/_event.pyx”, line 316, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:4690) File “/usr/lib/python2.7/dist-packages/kivy/uix/widget.py”, line 284, in on_touch_down if child.dispatch(‘on_touch_down’, touch): File “kivy/_event.pyx”, line 316, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:4690) File “/usr/lib/python2.7/dist-packages/kivy/uix/behaviors.py”, line 93, in on_touch_down self.dispatch(‘on_press’) File “kivy/_event.pyx”, line 312, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:4636) File “/usr/lib/python2.7/dist-packages/kivy/lang.py”, line 1299, in custom_callback exec(kvlang.co_value, idmap) File “./groundcontrol.kv”, line 212, in on_press: root.openFile() File “/tree/projects/maslow/groundcontrol/GroundControl-master/UIElements/viewMenu.py”, line 25, in openFile content = LoadDialog(load=self.load, cancel=self.dismiss_popup) File “/usr/lib/python2.7/dist-packages/kivy/uix/floatlayout.py”, line 66, in init super(FloatLayout, self).init(**kwargs) File “/usr/lib/python2.7/dist-packages/kivy/uix/layout.py”, line 63, in init super(Layout, self).init(**kwargs) File “/usr/lib/python2.7/dist-packages/kivy/uix/widget.py”, line 173, in init Builder.apply(self) File “/usr/lib/python2.7/dist-packages/kivy/lang.py”, line 1566, in apply self._apply_rule(widget, rule, rule) File “/usr/lib/python2.7/dist-packages/kivy/lang.py”, line 1673, in _apply_rule self._apply_rule(child, crule, rootrule) File “/usr/lib/python2.7/dist-packages/kivy/lang.py”, line 1633, in _apply_rule cls = Factory_get(cname) File “/usr/lib/python2.7/dist-packages/kivy/factory.py”, line 119, in getattr raise FactoryException(‘Unknown class <%s>’ % name) kivy.factory.FactoryException: Unknown class

Apologies for the formatting, but the last line is probably the important one. I haven’t had time to look at the code, but I can’t see anything like this on the forum. Any ideas?

Is this the first time you’ve used the file load function, or is this behavior new to v0.85? It looks like you’re on a Linux system, yes?
I wonder whether it is a file permission problem. Looking in GroundControl.ini, look for a line like:
openfile = /full/path/to/a/file.nc
What is the path and file GC is trying to open? Can you open that with a text editor?
Try putting an .nc file in the root of your home directory and editing that line to point to it. Did that make a difference?

1 Like

Yes, this is the first time I tried to open a file. Yes, I’m on a Linux system. I’m running with root privileges so I can access the USB port without mucking about, so I doubt it’s a permission problem.
I did try changing the path in a menu somewhere to one that exists, but not in the ini file.
I’ll also put a .nc file in that directory, I suspect that’s the problem, but I didn’t know the file extensions GC was looking for…
I’ll try this out tomorrow morning. Thanks for your help.

1 Like

Adding my user to the ‘dialout’ group worked on 3 different distros with me.
>> sudo usermod -a -G dialout username <<

https://www.arduino.cc/en/Guide/Linux (bottom of page)

1 Like

Bad idea. Change the port permissions instead.

@Gero , @mooselake, looking in main.py, it wants a key ‘openFile’. Looking in groundcontrol.ini on my system in OS X, the key is ‘openfile’. What do you see for this key? Could this be a case-sensitivity issue?

@blurfl ->openfile = /home/whoareyou/Maslow/test bar/Sled.nc
Linux is at all cost case sensitive
Sort the permission issue with the user and report back, would be my approach.

Edit One: In a teminal, >pip list< will spit the version of python modules installed.
If you don’t mind for comparing?

1 Like

:slight_smile: Yes, that was the mucking about I mentioned. I’m allergic to these little bits of stuff. I may sort it sometime in the future. Running with root privs (sudo) isn’t much of a problem with this machine as it’s not really attached to the internet and the machines in the workshop seem to die every year or so, so everything is backed up., It’s a burner machine.

I checked the .ini file and it was pointing no-where, so I made it point to my work directory and created a file there called abc.nc. GC still crashed on open. I changed the .ini file to point to abs.nc and tried again and it crashed again.

Looking at the last line :slight_smile:

File “/usr/lib/python2.7/dist-packages/kivy/factory.py”, line 119, in getattr raise FactoryException(‘Unknown class <%s>’ % name) kivy.factory.FactoryException: Unknown class

This looks to me like a class is mising in the version of something (kivy?) that I am running.

Could you post the output this provides?

I’ve been running Ground Control in Linux for a while now, and after doing the following commands to the user I run with it worked fine.

Like Gero said I had to add to the “dialout” and “input” groups:

sudo usermod -a -G input username

If this does not work, then my suggestion would be to do what the other folks suggested and create a user that is not root, and run as that user (adding them to the above groups).

I was going to point you to the Wiki for the Linux page, but it looks like the usermod commands in the wiki were removed, a pity.

Here you go:

cffi (0.8.6)
chardet (2.3.0)
colorama (0.3.2)
cryptography (0.6.1)
defusedxml (0.4.1)
docutils (0.12)
html5lib (0.999)
Kivy (1.8.0)
lxml (3.4.0)
mercurial (3.1.2)
ndg-httpsclient (0.3.2)
numpy (1.8.2)
pexpect (3.2)
Pillow (2.6.1)
pip (9.0.1)
ply (3.4)
pyasn1 (0.1.7)
pycparser (2.10)
pycups (1.9.63)
pycurl (7.19.5)
pygame (1.9.1release)
Pygments (2.0.1)
pygobject (3.14.0)
pyOpenSSL (0.14)
pyserial (3.4)
pysmbc (1.0.15.3)
python-apt (0.9.3.12)
python-debian (0.1.27)
python-debianbts (1.11)
pyxdg (0.25)
reportbug (6.6.3)
reportlab (3.1.8)
requests (2.4.3)
roman (2.0.0)
setuptools (36.2.7)
six (1.8.0)
SOAPpy (0.12.22)
urllib3 (1.9.1)
virtualenv (15.1.0)
wheel (0.29.0)
wstools (0.4.3)

I’ve got some other things to do at the moment, so haven’t manged to look at this.

I’m hoping one of the folks that run under Linux regularly will spot something in that pip list. All I see is kivy v1.80, where the current version is v1.10.0. I don’t know if that’s related, though.
Another thing to try would be to open the Settings and edit the ‘Open file’ setting with the full path to an .nc file. Or edit the groundcontrol.ini file in the same way, before running GC. That would bypass the kivy code for the file selection routines, might provide a data point about the issue.

I use Python for other things so I have a bunch of different packages than the above list, but I trimmed down the list to what had different versions from mine:

$ pip list --format=columns
Package            Version       
------------------ --------------
colorama           0.3.7         
docutils           0.13.1        
html5lib           0.999999999   
Kivy               1.10.0        
lxml               3.7.3         
numpy              1.12.1        
Pillow             4.0.0         
pyasn1             0.1.9         
pyserial           3.2.1   *mine is older         
setuptools         33.1.1    *mine is older 
1 Like

The Kivy(1.8.0) was released in 2014. I think I’d try upgrading that first.

Another thing that I do in Linux (because I have Python 2 and 3 installed) is start the app like this:

$ python2.7 main.py

Which forces it to use Python 2 vs 3.

2 Likes

Package Version


alabaster 0.7.8
appdirs 1.4.3
Babel 2.3.4
beautifulsoup4 4.5.3
boto 2.40.0
chardet 2.3.0
configobj 5.0.6
cryptography 1.7.1
cycler 0.10.0
deja-dup-caja 0.0.4
dnspython 1.15.0
docutils 0.13.1
duplicity 0.7.6
enum34 1.1.6
folder-color-caja 0.0.79
folder-color-common 0.0.79
functools32 3.2.3.post2
html5lib 0.999999999
idna 2.2
imagesize 0.7.1
ipaddress 1.0.17
Jinja2 2.9.5
keyring 10.3.1
keyrings.alt 2.2
Kivy 1.10.0
Kivy-Garden 0.1.4
kiwi 1.9.22
lockfile 0.12.2
lxml 3.7.3
MarkupSafe 0.23
mate-menu 17.4.3
matplotlib 2.0.0
mercurial 3.9.1
ndg-httpsclient 0.4.2
numpy 1.12.1
packaging 16.8
Pillow 4.0.0
pip 9.0.1
Pivy 0.5.0
pyasn1 0.1.9
pycrypto 2.6.1
pygame 1.9.3
Pygments 2.2.0
pygobject 3.22.0
PyODE 1.2.0
PyOpenGL 3.1.0
pyOpenSSL 16.2.0
pyparsing 2.2.0
pyserial 3.3
python-cloudfiles 1.7.10
python-dateutil 2.5.3
python-xlib 0.14
pytz 2014.10
pyxdg 0.25
requests 2.10.0
roman 2.0.0
SecretStorage 2.3.1
setproctitle 1.1.10
setuptools 35.0.2
six 1.10.0
Sphinx 1.5.3
sphinx-rtd-theme 0.1.9
subprocess32 3.2.7
urllib3 1.15.1
virtualenv 15.1.0
webencodings 0.5
wheel 0.29.0

Can’t look deeper now. (would have expected >beautifulsoup< on my keyboard, but not on the harddrive :slight_smile: ) Bed time. On the Manjaro I start with >python2 main.py< as mentioned above, because 3 is present as well. Will check the modules on that one tomorrow.

1 Like

I’ve fixed this problem by installing Kivy 1.10 from source.
Thanks for all the help.

3 Likes

Thanks for logging your solution in the thread for posterity :slight_smile:

1 Like