Jump to content

zaaf77

Dormant
  • Posts

    17
  • Joined

  • Last visited

Posts posted by zaaf77

  1. On 11/3/2019 at 4:23 AM, davidhq said:

    Hi @zaaf77 ! Sorry for a bit late reply. Making a lot of "parallel progress" but all I can share for now is a few links for you to click around and explore for bits of information. Maybe check out http://fasterix.com and various "subnodes" on this site. I've just done a little bit more explaning on my landing site https://davidkrmpotic.com as well.

     

    Cheers and until soon 🙂

    Cheers much appreciated 🙂

  2. 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?

  3. 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.

  4. 1 hour ago, tinkergnome said:

     

    What about adding the acquired digest authorization to you first command?

    Something like this should work with 'curl':

     

    
    curl -X [...] --digest --user YOUR_ID:YOUR_KEY [...]

    curl -X PUT --header "Content-Type: application/json" --header "Accept: application/json" --digest --user "4f788954582aa8b80c591bae53a6a0a4":"96c4f972838de37f2f4f14a4bbfc4a9f77ed265ffbb1b80796c3cdd41daa5b39" -d "{\"message":"How are you?",\"button_caption":"Okay"\}" "http://192.168.1.38/api/v1/system/display_message"

    😴

    Now it's giving the error saying {"message": "400 Bad Request"}

  5. On Swagger I am able to change the name of the printer with the following command

    curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' -d '"zaaf77"' 'http://192.168.1.38/api/v1/system/name'

    But When I run the same command into the command prompt (by changing the single quotes into double) it gives the following error

    {"message": "Authorization required."}

    How do I authorize it?

    I am struggling with the logic as well as syntax mainly! I know the id and key you can get from the following command:

    curl -X POST --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' -d 'application=laravel&user=mughalz1' 'http://192.168.1.38/api/v1/auth/request'

    How do I use this id and key? Or would the id and key be the "root" and "ultimaker"?  again if it is "root" and "ultimaker", how do i use it in the cURL command, Can anyone help with the syntax please?

    Actually, i am trying to develop my own interface so that someone can print a model from my website directly. Any thoughts please... ..?

     

     

     

  6. 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.

  7. 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.... 

  8. 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...

  9. 17 hours ago, sxj1121 said:

    I am sorry that I can't directly share my code with you due to the restrictions of our lab. You could try to start from posting a gcode file on windows cmd by curl.

    In my PHP code, I also use curl to send gcode file. You could refer to my previous post. 

    For PHP7, it is:

            $data_array =  array(

              'jobname' => 'file',

              "file" => new \CURLFile($filedata)

            );

    If you want develop a perfect website. You need to develop a PHP file for using Get, Put, Post to call the API. Then develop another PHP file to receive the file which is uploaded from the front-end. Next save the file to local (You don't really need this step, but I don't know how to skip it). Then upload this file from local to API by Post.

     

    For restricting the number of prints, you could use AJAX to get the real-time print process. If it's not Not Found, then disable the upload function. But I think if 3D printer starts printing, then keep uploading files won't make any changes.

    @sxj1121... .. Many thanks for your help and is much much appreciated! Thanks for the piece of code just above as well as a reference to your PHP7, Would you be kind enough to share the link to this.... I mean PHP7 you just mentioned above.... 

    Much appreciated once again and thankyou so very much...

    Have a nice day!

  10. On 5/28/2019 at 10:41 PM, sxj1121 said:

    Thank you very much! I solved this POST print_job problem. There are several syntax errors of PHP code.

    @sxj1121

    any chance you got your printing done with PHP, would you like to share some more on it then? I am working on the same thingy, actually I want to authorize the user to print GCODE files from my website to directly to their 3DPrinter say ( ultimaker S5). I also want to restrict the number of prints as well but that's second step. More interested into the process of printing a GCODE directly from my website to the 3D printer, have you any thoughts on it? Waiting on you and thanking you in advance!

  11. 16 hours ago, tinkergnome said:

    Don't know, if it helps, but once upon a time someone developed a similar thing with PHP, but with the "old" API (that needs authentication).
    It should be rather easier in your case. Here is a link to the topic:

     

     

    Thanks for your help.

  12. 16 hours ago, Smithy said:

    I am afraid, but without some development skills you will not be able to achieve it. 

    There is nothing which you can just put on your website, you have at least develop a php (or similar script) which runs on your webserver to upload the gcode file.

     

    But you cannot connect from a public website to your printer, because I guess your printer is on a private network. Therefore you have to create a VPN network between your Webserver and the printer. There are several possibilities and depends on your infrastructure.

     

    So I am sorry, but there is no recipe which you could just follow.

    Many thanks for your reply. Yes, I do understand someone should have to have some development background, thanks for your concern. I was looking for something like:

    and 

     

    just in case someone else turn-up like me a newbie. VPN is another good clue, thanks again!

     

  13. I am sure what you mentioned just above is the perfect answer, but due to lack of my development skills I am unable to implement it. Any chance you can link any tutorial or article or close example of this or this sort of implementation. I am using Laravel and newbie to it as well!

    I tried to find out on youtube or google but couldn't find any example.

    Just can't figure out where I shall be putting this code into my website. Sorry, I know it's bit of far low but that's my start.

    I shall be really thankful to you.

  14. Hi community,

     

    Did anyone ever tried to access the Ultimaker S5 API from a web server ?

     

    Currently, I am using 3dPrinterOS, Cura etc to 3d-print my gcode files. I want to print without using these interfaces, e.g. If I have GCODE file I want to print it directly on the Ultimaker S5 without being on the same network. Is there any way?

     

     

    If some of you have feedbacks and tips on it, I'll be glad to ear.

     

    Thanks

×
×
  • Create New...