Sebastian, This is great. I had seen some comments that one should not use linuxcncrsh as it was being phased out.
The nice thing about using ssh is that all the authentication and protection is done for me. I think I can knock something out in python. If it's interesting, I am happy to contribute it to the cause. It will probably be pretty simple to start with and can get better as time goes on. I will certainly look at the test code. Your simple example is quite a help in itself. I would love to bounce around ideas as to what it needs to do and how best to lay it out. Is this list the best place to do that? thanks, jerry ----- Original Message ----- | From: "Sebastian Kuzminsky" <s...@highlab.com> | To: "Enhanced Machine Controller (EMC)" <emc-users@lists.sourceforge.net> | Sent: Saturday, July 11, 2015 8:40:14 AM | Subject: Re: [Emc-users] execution of gcode commands from a net connection with no gui action | | On 07/10/2015 08:04 PM, Jerry Scharf wrote: [...] | | I like your idea of sshing in to the linuxcnc computer and running | the | gcode "on demand" from the top level controller on the main computer. | | Assuming linuxcnc is running, you could run the python interpreter, | import the "linuxcnc" module, and provide input on its standard in: | | Python 2.7.3 (default, Mar 13 2014, 11:03:55) | [GCC 4.7.2] on linux2 | Type "help", "copyright", "credits" or "license" for more | information. | >>> import linuxcnc | >>> c = linuxcnc.command() | >>> c.state(linuxcnc.STATE_ESTOP_RESET) | >>> c.state(linuxcnc.STATE_ON) | >>> c.home(-1) | >>> c.wait_complete() | 1 | >>> c.mode(linuxcnc.MODE_MDI) | >>> c.mdi('g0 x5 z1') | | The linuxcnc python module lets you do everything any other LinuxCNC | user interface can do, but unfortunately it does not have great | documentation. (If you wanted to contribute documentation for the | module it would be very welcome!) It is used in several places in | our | test suite, that may be a good place to see it in action (grep for | "import linuxcnc" in tests/). | | | Another alternative would be to use the user interface program called | "linuxcncrsh", the linuxcnc remote shell. It accepts network | connections and receives commands over TCP. It's probably a worse | solution than "ssh python", but it has better docs... It's also used | in | our test suite so you can see examples there. | | | -- | Sebastian Kuzminsky | | ------------------------------------------------------------------------------ | Don't Limit Your Business. Reach for the Cloud. | GigeNET's Cloud Solutions provide you with the tools and support that | you need to offload your IT needs and focus on growing your business. | Configured For All Businesses. Start Your Cloud Today. | https://www.gigenetcloud.com/ | _______________________________________________ | Emc-users mailing list | Emc-users@lists.sourceforge.net | https://lists.sourceforge.net/lists/listinfo/emc-users | ------------------------------------------------------------------------------ Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users