Jump to content
3DPLAB

Troubleshooting in Developer mode

Recommended Posts

Posted · Troubleshooting in Developer mode

Hi,

I am exploring the developer mode of UM3. I am able to log into the printer via SSH and run the command_util.ph. It succesfully execute 'help' command. But when I try to run gcode, it produces following error and exits the cmd shell.  Need help to resolve it please. 

 

(Cmd) sendgcode G0 F15000 X99.757 Y110.646
Traceback (most recent call last):
  File "command_util.py", line 140, in <module>
    GriffinCmd().cmdloop()
  File "/usr/lib/python3.4/cmd.py", line 138, in cmdloop
    stop = self.onecmd(line)
  File "/usr/lib/python3.4/cmd.py", line 217, in onecmd
    return func(arg)
  File "command_util.py", line 118, in do_sendgcode
    print(dbusif.RemoteObject("printer").debugSendGCode(args, timeout=120))
  File "/usr/share/griffin/griffin/dbusif.py", line 214, in __call__
    return self.__obj_method(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 70, in __call__
    return self._proxy_method(*args, **keywords)
  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 145, in __call__
    **keywords)
  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 4 matched rules; type="method_call", sender=":1.34" (uid=0 pid=2141 comm="python3 command_util.py ") interface="(unset)" member="debugSendGCode" error name="(unset)" requested_reply="0" destination=":1.18" (uid=1000 pid=987 comm="/usr/bin/python3 /usr/share/griffin/main.py griffi")
root@ultimakersystem-ccbdd3008b14:/usr/share/griffin#

Share this post


Link to post
Share on other sites
Posted · Troubleshooting in Developer mode

did you do this command below?  You probably have to be in this folder:

cd /usr/share/griffin/

Other thoughts.  Try "G28 X0 Y0".  It could be that you have to home X and Y axes first before moving them.  Or even just "G28".

 

I've sent gcodes the way you describe but I'm not sure if I tried the G0 command.  I just don't remember.

 

I know if you want to heat up a core you have to do some special command first to unlock it or something.  I have notes if you need to know that one.

 

Here's a video of neotko sending a G28 successfully and playing with the RGB lights (although this gcode I think may have changed since this video).

 

 

In addition to sendgcode you can do things like this:

(Cmd) select printer printer/head/0/slot/0
(Cmd) list

 

Share this post


Link to post
Share on other sites
Posted · Troubleshooting in Developer mode

@3DPLAB

I have heard before (somewhere here) that "command_util" does not work anymore for users other than "ultimaker", especially not as "root" (current firmware version).

I don't know, if this was intended or not.

 

If you log in as user "ultimaker" you will be redirected straight into a working "command_util" prompt.

 

  • Like 1

Share this post


Link to post
Share on other sites
Posted · Troubleshooting in Developer mode

I have the same issue as yours. Do you also use the latest firmware? Right now, I could send G-Code as 'ultimaker'. But as 'root', the dbus part doesn't work. I searched by Google, it looks like dbus needs a correct interface, or some other problem leads to this. If you find out any solutions, please share. Thanks!

Share this post


Link to post
Share on other sites
Posted · Troubleshooting in Developer mode

First of all, the command_util script is a debug tool that Ultimaker uses internally and has no official support. This means that we don't test it every release and behaviour might change without notice.  I haven't tried the root login for this in a long time so it is very well possible that's broken (from the dump it seems like a dbus access right is missing).


The recommended way for starting the util_command is by logging in as ultimaker / ultimaker. This will immediately give you the command prompt.

Or, when you are logged in as root you can do an:

su ultimaker

 

As mentioned above, before you can execute any G0 or G1 command the head is to be homed once:

G28 X Y Z

or short:

G28

 

Having said all this, I don't know why you want to move the head, but the recommended procedure is to use the web API.

  • Like 1

Share this post


Link to post
Share on other sites
Posted · Troubleshooting in Developer mode

Thanks guys. ultimaker/ultimaker did work. Appreciate your help

Share this post


Link to post
Share on other sites
Posted · Troubleshooting in Developer mode
On 8/8/2019 at 4:17 AM, gr5 said:

did you do this command below?  You probably have to be in this folder:


cd /usr/share/griffin/

Other thoughts.  Try "G28 X0 Y0".  It could be that you have to home X and Y axes first before moving them.  Or even just "G28".

 

I've sent gcodes the way you describe but I'm not sure if I tried the G0 command.  I just don't remember.

 

I know if you want to heat up a core you have to do some special command first to unlock it or something.  I have notes if you need to know that one.

 

Here's a video of neotko sending a G28 successfully and playing with the RGB lights (although this gcode I think may have changed since this video).

 

 

In addition to sendgcode you can do things like this:


(Cmd) select printer printer/head/0/slot/0
(Cmd) list

 

 

Whats the new code (RGB), Do you or anyone else know? plz share...

Share this post


Link to post
Share on other sites
Posted · Troubleshooting in Developer mode

Have you tried? The M142 command is still the same

 

You still didn't mention why you want to use gcodes. The web API is the preferred interface method as that is officially documented and will have less potential problems interfering with the rest of the printer.

Share this post


Link to post
Share on other sites
Posted · Troubleshooting in Developer mode
28 minutes ago, CarloK said:

Have you tried? The M142 command is still the same

 

You still didn't mention why you want to use gcodes. The web API is the preferred interface method as that is officially documented and will have less potential problems interfering with the rest of the printer.

For us, we just want to provide a way for users to learn G-Code and coordinate system by 3D printer.

Share this post


Link to post
Share on other sites
Posted · Troubleshooting in Developer mode
13 hours ago, CarloK said:

Have you tried? The M142 command is still the same

 

You still didn't mention why you want to use gcodes. The web API is the preferred interface method as that is officially documented and will have less potential problems interfering with the rest of the printer.

Thanks for your reply. It doesn't work on atleast with me. I am trying to print gcode directly from my website to the 3D printer without using any interface like cura or 3dPrintOS etc... I am not interested in any slicing job or any other thing only to be able to send a gcode file directly from my(any) website to the 3Dprinter.... 

Share this post


Link to post
Share on other sites
Posted · Troubleshooting in Developer mode
13 hours ago, CarloK said:

Have you tried? The M142 command is still the same

 

You still didn't mention why you want to use gcodes. The web API is the preferred interface method as that is officially documented and will have less potential problems interfering with the rest of the printer.

Also, would you please let us know where do learn these gcode stuff etc. for example if i want to change the name displayed during the idle time into "googly eyes" or "resting person" something like that how is it possible? What are the possibilities we can do with the 3D printer software without breaking/bricking it? How far we can go? what would be the safe passage? These questions and many more related/similar you already being asked? Please getting more and more curious about 3D printer! Thanks.

Share this post


Link to post
Share on other sites
Posted · Troubleshooting in Developer mode
On 8/14/2019 at 1:46 AM, zaaf77 said:

Thanks for your reply. It doesn't work on atleast with me. I am trying to print gcode directly from my website to the 3D printer without using any interface like cura or 3dPrintOS etc... I am not interested in any slicing job or any other thing only to be able to send a gcode file directly from my(any) website to the 3Dprinter.... 

By saying you want to print gcode from any website, you are implying you want your printer naked on the internet. Please don’t do this. Like many IoT devices, these printers have zero security. They ship with all known accounts and passwords.

 

if you want to be able to send a gcode file from your web site to your printer, you will need to write a custom web service either hosted by a server on your network (with proper security) or with a VPN between the hosting server and your network. Then you can use the UM3 http API to transfer the file from your web service to the printer.

 

Getting this working correctly and securely is not a trivial task.

 

It might be possible to directly use the http API directly from an external server by using port forwarding on your router/firewall, but I would not recommend that as I doubt the http server in the printer is actually hardened against web exploits.

 

In no case should it be necessary to use the dev mode to do what you want.

Share this post


Link to post
Share on other sites
Posted · Troubleshooting in Developer mode
12 hours ago, johnse said:

By saying you want to print gcode from any website, you are implying you want your printer naked on the internet. Please don’t do this. Like many IoT devices, these printers have zero security. They ship with all known accounts and passwords.

 

if you want to be able to send a gcode file from your web site to your printer, you will need to write a custom web service either hosted by a server on your network (with proper security) or with a VPN between the hosting server and your network. Then you can use the UM3 http API to transfer the file from your web service to the printer.

 

Getting this working correctly and securely is not a trivial task.

 

It might be possible to directly use the http API directly from an external server by using port forwarding on your router/firewall, but I would not recommend that as I doubt the http server in the printer is actually hardened against web exploits.

 

In no case should it be necessary to use the dev mode to do what you want.

Many thanks for your time and concern. Yes, I am fully aware of the security issues but again thanks. I am struggling at the minute with the syntax as I am using https://github.com/ixudra/curl for curl commands. I am using Laravel from where I am calling different commands which work for the GET command but not for the PUT/POST command e.g;

$response=Curl::to('http://xxx.xxx.x.xx/api/v1/system/memory')->withHeader('Accept: application/json')->returnResponseObject()
->get();

It works absolutely fine and many other GET commands as well as the following;

$response=Curl::to('http://192.xxx.x.xx/api/v1/auth/request')
->withHeader('Content-Type: application/x-www-form-urlencoded')
->withHeader('Accept: application/json')
->withData(['application'=>'Laravel', 'user'=>'mughalz1'])
->returnResponseObject()
->post();

It above mentioned command sends the auth request to the printer which prompts on the printer where you have to tap 'allow'.

after that I can verify connection using the verify command too!

Here comes the trouble... ..

$response=Curl::to('http://192.xxx.x.xx/api/v1/system/display_message')
->withHeader('Content-Type: application/x-www-form-urlencoded')
->withHeader('Accept: application/json')
->withHeader('Content-Type: application/json')
-->withData(["message"=>"abc"])
->post();

 

If I try to run the command just mentioned above, It says :

{"message": "Authorization required."}

Now I have the 'key' and the 'password' BUT don't know the syntax to use it. Anyone know anything on it please help me out and

save me lol.... 

https://github.com/ixudra/curl This is the package I am using.

And only need help with the SYNTAX please ..... Thanks in advance and a very nice weekend!

 

P.S.Again the display_message command on the command prompt says BAD MESSAGE 400, on command prompt I know the syntax to use the --user.

Share this post


Link to post
Share on other sites
Posted · Troubleshooting in Developer mode

I think all you need to do is give curl the key/password. On a command line curl, you would use the -u option, as in “curl -u key:password”.

 

I found this Stackoverflow question: https://stackoverflow.com/questions/38330137/http-basic-authentication-using-laravel-curl-library

 

So you should be able to use:

withOption(USERPWD, ‘key:password’)

Share this post


Link to post
Share on other sites
Posted · Troubleshooting in Developer mode
2 hours ago, johnse said:

I think all you need to do is give curl the key/password. On a command line curl, you would use the -u option, as in “curl -u key:password”.

 

I found this Stackoverflow question: https://stackoverflow.com/questions/38330137/http-basic-authentication-using-laravel-curl-library

 

So you should be able to use:

withOption(USERPWD, ‘key:password’)

Thanks for your efforts. You are a true champ! Its still giving the same message. Must be a syntax or laravel version issue? What do you recon?

Share this post


Link to post
Share on other sites
Posted · Troubleshooting in Developer mode

Sorry, I don’t have any direct knowledge about the APIs, nor have I ever used PHP or Laravel.

Share this post


Link to post
Share on other sites
Posted · Troubleshooting in Developer mode
On 8/14/2019 at 10:52 AM, zaaf77 said:

What are the possibilities we can do with the 3D printer software without breaking/bricking it? How far we can go? what would be the safe passage? These questions and many more related/similar you already being asked?

The Web API is the only official supported remote interface. On the printer's own web page you can find this documentation. 

 

Note that we recently introduced a 'cloud connection' in Cura and Cura Connect. This makes it possible to start print jobs and monitor your printers from all over the world. Perhaps this already covers most of what you want to do?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Welcome to the Ultimaker Community of 3D printing experts. Visit the following links to read more about our Terms of Use or our Privacy Policy. Thank you!