Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login
    1. Home
    2. j.dewit
    3. Posts
    • Profile
    • Following 0
    • Followers 0
    • Topics 4
    • Posts 22
    • Best 1
    • Controversial 0
    • Groups 0

    Posts made by j.dewit

    • RE: CustomHttpEndpoint script not working

      @chrishamm I got the service working by running as root user using a umask 0000. That way the created socket is readable by dsf user.

      There must be a better way to do this, but sadly I am not an expert on user management in linux.

      But for development this works.

      posted in DSF Development
      j.dewitundefined
      j.dewit
    • RE: CustomHttpEndpoint script not working

      @chrishamm

      I tried running the script as a service with the dsf user. But now the DuetControlServer is dropping the connection due to missing permissions.

      Sep 07 14:23:25 duet3 DuetControlServer[3666]: [error] IPC#67: Failed to find plugin permissions for pid #6017
      Sep 07 14:23:25 duet3 DuetControlServer[3666]: [warn] IPC#67: Terminating connection due to insufficient permissions
      

      I am running a stand-alone c# application on the pi and don't want to use the plugins 'yet' due to easy-er debugging. What is the best way to get these permissions working?

      posted in DSF Development
      j.dewitundefined
      j.dewit
    • RE: CustomHttpEndpoint script not working

      @chrishamm That makes sense, just tested with the pi user, but that also is giving permission errors.

      Perhaps it is a good idea to update the documentation how to properly run these testing scripts.

      posted in DSF Development
      j.dewitundefined
      j.dewit
    • RE: CustomHttpEndpoint script not working

      Upping the permissions on the /run/dsf/custom-http-endpoint/demo-GET.sock solves the issue.

      I am running the test scrips as root, perhaps it is better to use a different user? Or is there soms sort of permission mismatch during the installation?

      posted in DSF Development
      j.dewitundefined
      j.dewit
    • RE: CustomHttpEndpoint script not working

      @falcounet I will try that example perhaps I have more luck with that one. Are you running the same firmware or a newer version?

      I did manage to get the faul that is occuring:

      Sep 07 10:54:39 duet3 DuetWebServer[665]: Microsoft.AspNetCore.Server.Kestrel.Connections[39] Connection id "0HMKGLC886QRH" accepted.
      Sep 07 10:54:39 duet3 DuetWebServer[665]: Microsoft.AspNetCore.Server.Kestrel.Connections[1] Connection id "0HMKGLC886QRH" started.
      Sep 07 10:54:59 duet3 DuetWebServer[665]: DuetWebServer.Services.ModelObserver[0] New number of custom HTTP endpoints: 0
      Sep 07 10:54:59 duet3 sudo[3741]: pam_unix(sudo:session): session closed for user root
      Sep 07 10:55:03 duet3 sudo[3813]:       pi : TTY=pts/0 ; PWD=/opt/dsf/bin ; USER=root ; COMMAND=./CustomHttpEndpoint
      Sep 07 10:55:03 duet3 sudo[3813]: pam_unix(sudo:session): session opened for user root by pi(uid=0)
      Sep 07 10:55:04 duet3 DuetWebServer[665]: DuetWebServer.Services.ModelObserver[0] New number of custom HTTP endpoints: 1
      Sep 07 10:55:04 duet3 DuetWebServer[665]: DuetWebServer.Services.ModelObserver[0] Registered HTTP GET endpoint via /machine/custom-http-endpoint/demo
      
      
      Sep 07 10:55:49 duet3 DuetWebServer[665]: Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets[6] Connection id "0HMKGLC886QRH" received FIN.
      Sep 07 10:55:49 duet3 DuetWebServer[665]: Microsoft.AspNetCore.Server.Kestrel.Connections[39] Connection id "0HMKGLC886QRI" accepted.
      Sep 07 10:55:49 duet3 DuetWebServer[665]: Microsoft.AspNetCore.Server.Kestrel.Connections[1] Connection id "0HMKGLC886QRI" started.
      Sep 07 10:55:49 duet3 DuetWebServer[665]: Microsoft.AspNetCore.Server.Kestrel.Connections[10] Connection id "0HMKGLC886QRH" disconnecting.
      Sep 07 10:55:49 duet3 DuetWebServer[665]: Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets[7] Connection id "0HMKGLC886QRH" sending FIN because: "The client closed the connection."
      Sep 07 10:55:49 duet3 DuetWebServer[665]: Microsoft.AspNetCore.Hosting.Diagnostics[1] Request starting HTTP/1.1 GET http://10.0.0.2/machine/custom-http-endpoint/demo - -
      Sep 07 10:55:49 duet3 DuetWebServer[665]: Microsoft.AspNetCore.HostFiltering.HostFilteringMiddleware[2] All hosts are allowed.
      Sep 07 10:55:49 duet3 DuetWebServer[665]: Microsoft.AspNetCore.Routing.Matching.DfaMatcher[1000] No candidates found for the request path '/machine/custom-http-endpoint/demo'
      Sep 07 10:55:49 duet3 DuetWebServer[665]: Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware[2] Request did not match any endpoints
      Sep 07 10:55:49 duet3 DuetWebServer[665]: Microsoft.AspNetCore.Server.Kestrel.Connections[2] Connection id "0HMKGLC886QRH" stopped.
      Sep 07 10:55:49 duet3 DuetWebServer[665]: DuetWebServer.Authorization.SessionKeyAuthenticationHandler[8] AuthenticationScheme: SessionKey was successfully authenticated.
      Sep 07 10:55:49 duet3 DuetWebServer[665]: Microsoft.AspNetCore.Server.Kestrel[13] Connection id "0HMKGLC886QRG", Request id "0HMKGLC886QRG:00000005": An unhandled exception was thrown by the application. System.Net.Internals.SocketExceptionFactory+ExtendedSocketException (13): Permission denied /run/dsf/custom-http-endpoint/demo-GET.sock    at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)    at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)    at DuetWebServer.Middleware.HttpEndpointConnection.Connect(String socketPath) in /home/christian/Duet3D/DuetSoftwareFramework/src/DuetWebServer/Middleware/HttpEndpointConnection.cs:line 31    at DuetWebServer.Middleware.CustomEndpointMiddleware.InvokeAsync(HttpContext context) in /home/christian/Duet3D/DuetSoftwareFramework/src/DuetWebServer/Middleware/CustomEndpointMiddleware.cs:line 97    at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)    at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)    at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
      Sep 07 10:55:49 duet3 DuetWebServer[665]: Microsoft.AspNetCore.Server.Kestrel.Connections[9] Connection id "0HMKGLC886QRG" completed keep alive response.
      Sep 07 10:55:49 duet3 DuetWebServer[665]: Microsoft.AspNetCore.Hosting.Diagnostics[2] Request finished HTTP/1.1 GET http://10.0.0.2/machine/custom-http-endpoint/demo - - - 500 0 - 31.3982ms
      

      So the first thing is strange since it is telling that no endpoint is matched. And then there is a permission error on the unix socket that is created.

      posted in DSF Development
      j.dewitundefined
      j.dewit
    • RE: CustomHttpEndpoint script not working

      @jay_s_uk Thanks, I am trying to figure out where DSF puts it's logs on the SBC. But so far no luck on debugging.

      posted in DSF Development
      j.dewitundefined
      j.dewit
    • RE: CustomHttpEndpoint script not working

      @jay_s_uk The feature is for SBC:

      https://github.com/Duet3D/DuetSoftwareFramework#customhttpendpoint

      This should grant me an option to create a custom HTTP endpoint for custom sofware.

      posted in DSF Development
      j.dewitundefined
      j.dewit
    • CustomHttpEndpoint script not working

      Fresh install on the PI:

      Board: Duet 3 MB6HC (MB6HC)
      DSF Version: 3.4.1
      Firmware: RepRapFirmware for Duet 3 MB6HC 3.4.0 (2022-03-15)

      After Running the CustomHttpEndPoint the http status code returned after the request is 500.

      When closing the script a 404 error is returned, so routing seems to work. But the request is not properly handled.

      I have also tried to create a custom HTTP endpoint using the c# library but there I am also running into the same issue.

      posted in DSF Development
      j.dewitundefined
      j.dewit
    • RE: How to connect laser fire pin of K40 CO2 laser to Duet board.

      @jay_s_uk And I am planning to spend some more time testing why the g-code from Lightburn is a mess, I have ordered a cheap MKS S-base board since it should be compatible with lightburn, but I would rather keep using the Duet, since everything on the s-base is a big downgrade compared to the duet.

      posted in Laser Cutters
      j.dewitundefined
      j.dewit
    • RE: How to connect laser fire pin of K40 CO2 laser to Duet board.

      @jay_s_uk I have not tried images etc.

      But filling vectors works well.

      LaserWeb is a good piece of software, but it being totally free. It just can't be compared to lightburn as this is a far superior piece of software.

      posted in Laser Cutters
      j.dewitundefined
      j.dewit
    • RE: How to connect laser fire pin of K40 CO2 laser to Duet board.

      @jay_s_uk Seem to be having the same results here, but the gcode from laserweb is working absolutely perfect.

      I have done some g-code comparisation:

      LaserWeb:

      ; Pass 0 Path 1
      G0 X40.18 Y4.49
      G1 X39.07 Y4.49 S0.40 F10000
      
      ; Pass 0 Path 2
      G0 X39.07 Y4.59
      G1 X40.18 Y4.59 S0.40 F10000
      

      LightBurn:

      G1X13.92F10000S0.4
      G1Y0.1S0
      G1X-13.92S0.4
      G1Y0.1S0
      

      So far the only difference I see is the G0 moves in laserweb, when the laser is off by default. And in lightburn it is using a G1 with laser power to 0.
      And the difference in absolute and relative movements. But why the duet is having problems with the lightburn gcode is a mystery to me.

      posted in Laser Cutters
      j.dewitundefined
      j.dewit
    • RE: How to connect laser fire pin of K40 CO2 laser to Duet board.

      I have added my config file: (Comments may be a mess....)

      ; General preferences
      G90 						; send absolute coordinates…
      M83 						; …but relative extruder moves
      M550 P"MPCNC" 					; Machine name and Netbios name (can be anything you like)
      G21						; Work in millimetres
      M555 P2						; Set output to look like Marlin
      
      ; Communication and general
      M111 S0                            		; Debug off
      M551 Preprap                   			; Machine password (used for FTP)
      
      ;*** Networking
      M540 P0xBE:0xEF:0xDE:0xAD:0xFE:0xED		; MAC Address
      M552 P192.168.0.50				; IP address
      M554 P192.168.0.255				; Gateway
      M553 P255.255.255.0				; Netmask
      M552 S1						; Turn network on
      
      ; Pin for air assist via relay
      M950 P0 C"fan0"
      
      ; Drives
      M569 P0 S0					; Drive 0 goes backwards
      M569 P1 S1					; Drive 1 goes forwards
      M569 P2 S1					; Drive 2 goes forwards
      M569 P3 S1					; Drive 3 goes forwards
      M569 P4 S1					; Drive 4 goes backwards
      
      ; Drive mapping
      M584 X0 Y1 Z2 E P3			        ; Drive mapping
      
      ; Drive settings
      M350 X16 Y16 Z16 E16 I1	         		; Configure microstepping with interpolation
      M92 X157.575 Y157.575 Z3232.57		        ; Set steps per mm
      ;M350 X32 Y502 E128 I1				; Set steps per mm for the extruder to x128 (776 steps per mm) and X and Y to x32 (160 steps per mm)
      M566 X800 Y800 Z60 E3000 P1		        ; Set maximum instantaneous speed changes (mm/min)
      M203 X16000 Y16000 Z40		                ; Set maximum speeds (mm/min)
      M201 X2500 Y2500 Z80		                ; Set accelerations (mm/s^2)
      M204 P600 T2000					; Set accelerations (mm/s^2) for print and travel moves
      M906 X400 Y600 Z600 I30		                ; Set motor currents (mA) and motor idle factor in per cent
      M84 S0						; Set idle timeout
      
      ; Axis Limits
      M208 X0 Y-30 Z-13.6 U0 V0 S1	                ; Set axis minima
      M208 X300 Y200 Z70 S0		        	; Set axis maxima
      
      ; Endstops
      M574 X1 S1 P"xstop"  ; X min active high endstop switch
      M574 Y2 S1 P"ystop"   ; Y max active high endstop switch
      M574 Z1 S1 P"!zstop"  ; Z min active high endstop switch
      
      ; Allow movement before homing
      ;M564 S0 H0
      
      ; Laser Mode
      M452 C"e0heat" R1.0 S1 Q200                          ; laser uses !e0heat pin,  PWM frequency 100Hz
      
      
      posted in Laser Cutters
      j.dewitundefined
      j.dewit
    • RE: How to connect laser fire pin of K40 CO2 laser to Duet board.

      @jay_s_uk Sorry for the late reply, my notifications were turned off.

      I will try to post the config tonight.

      Some update on the project, I now have added an controllable Air assist using a Relay. That is controlled via gcode commands. And I have added a motorized Z-table.

      Both were easy to configure in the Duet, and work great.

      I do have a fully working k40 now, with the option to control the laser intensity from software. Gcode generated from LaserWeb is working perfect. I then upload these to the Duet, and that seems the way to go.

      I haven't had any luck on getting the gcode from the Lightburn software to work to an acceptable level. The generated gcode does work, but whenever I use a fill, the results are bad. Jagged edges and wobbly lines.

      I will need to find some time, to post some example pictures and the used gcode. Since I haven't found out what exactly is going wrong with the gcode from LightBurn.

      posted in Laser Cutters
      j.dewitundefined
      j.dewit
    • RE: G38 acting different on Toolboard 1LC then on Duet 3 Mainboard.

      I was aware of the endstops, good to know that the same applies to probes.

      And I did some more testing. I don't think that the problem is related to where the sensors (endstops/probes) are connected. They seem to always work. Even the probe works when controlling the motor on the toolboard. It is just not returning the right atual position after probing.

      The motor(Y) and zprobe are connected to the mainboard. And the endstop(Y) to the toolboard. Then everything works.
      Homing works and during probe the position of the Y is correct.

      But when the motor is connected to the toolboard, then the position after probing is incorrect. And it just returns the target position.

      posted in General Discussion
      j.dewitundefined
      j.dewit
    • RE: G38 acting different on Toolboard 1LC then on Duet 3 Mainboard.

      Have just connected the probe sensor to the mainboard, and the result is the same.

      Some more information:

      The working situation: Y motor connected to mainboard, Y endstop for homing connected to mainboard, and Y probe connected to mainboard.

      Not working scenarios:

      1 Y motor on toolboard, Y endstop on toolboard, Y probe on toolboard.
      2 Y motor on toolboard, Y endstop on toolboard, Y probe on mainboard.

      Next is to test some scenario's with the motor on the mainboard, and sensors on toolboard.

      posted in General Discussion
      j.dewitundefined
      j.dewit
    • G38 acting different on Toolboard 1LC then on Duet 3 Mainboard.

      I have recently switched my prototype to use 1LC toolboards, as this will reduce wiring complexity due to the size of the machine.

      I am running into a problem that the G38 probe command is working different on the Toolboard then when connected on the Duet 3 mainboard.

      I am using firmware version 3.1.1 on a Duet 3 with SBC.
      I have 2 toolboards connected on addresses 20 and 21. Running 3.1.0 firmware.

      We are using the G38 probe command to perform a movement that halts when a sensor is triggered. (It is a sort of locking mechanism.)

      The config used:

      M558 P8 C"!21.io0.in" H0 F500 T3000   ;
      

      And the command used to perform the movement:

      G38.2 F500 Y50  ;
      

      Y is always homed at 0, 0 is minimum and 50 is max.

      Both movements work, and stop when the sensor is triggered. But on the Mainboard, the current Y position is the actual amount moved (For example 35). On the Toolboard this is always the target position of 50, even if it only moves to 30.

      This is causing a problem when returning Y to 0, as on the toolboard we are trying to go to '-20'. Since it it thinking is it at 50. And end up stalling the motor since the end of the possible movement of the axis is reached. The only way to correct this misalignment is by re-homing the Y axis.

      On the mainboard this problem does not occur, and we are using the amount moved to check if the locking mechanism is working since it needs a minimum amount of travel.

      Could this be a Bug related to the Toolboard, or is this a limitation of the Toolboard?

      posted in General Discussion
      j.dewitundefined
      j.dewit
    • RE: How to connect laser fire pin of K40 CO2 laser to Duet board.

      Some more updates on this project.

      Tested lightburn software it does detect the duet board as a GRBL board (connected on USB), and some control options work. Homing for example does not work since a $H is sent. Was not getting great results, the cuts were off. And there is not a lot of configuration options, just select a profile and see if it works.

      Got some engravings but some were off center. I will have to test more, with different kind of profiles.

      After that I tested laserweb software, the software itself is a bit slower, and sometimes crashes. But it has a lot of configuration options, and the Duet is recognized and works.

      The gcode generated from laserweb works great, and I am getting good results. But running the gcode via USB was not that stable.

      I think I prefer running the job from the Duet interface, the board itself should complete the job. This is the same way as my 3d printers work. However none of the laser software seems to be build for this.

      I will do some more testing by uploading to the duet.

      The main problem is that when creating the gcode, you don't know the position of the piece of wood. But I think I could make a workable solution by positioning the laser at the correct position from duet web interface. And when starting the job, I can use that position as origin by using gcodes. But I will have to test that.

      In laserweb there are a lot op options to insert custom gcode, so customization is great. If it would have a button to upload the job to the duet and start the job, then that would be perfect.

      posted in Laser Cutters
      j.dewitundefined
      j.dewit
    • RE: How to connect laser fire pin of K40 CO2 laser to Duet board.

      I have installed a Duet Ethernet board and just had my first successful burn. 😀

      Connected the heater ground pin to the laser fire pin. And connected the ground of the laser power supply to a ground pin of the Duet.

      PWM control seems to work (getting different colors of burn), but I have to figure out the correct frequency.
      The smoothieboards use pwm per period in microseconds. And not sure if this is the same as Hz.

      posted in Laser Cutters
      j.dewitundefined
      j.dewit
    • RE: Max input voltage on sensor inputs 1LC toolboard

      Thanks but I meant the input voltage of the sensor inputs, io.0.in and io.1.in.

      On the Duet 3 Mainboard these are rated to 30v.

      posted in Duet Hardware and wiring
      j.dewitundefined
      j.dewit
    • Max input voltage on sensor inputs 1LC toolboard

      I was wondering what the Maximum voltage is that the 1LC toolboard can withstand on its inputs? Since we are using 10-30v inductive sensors.

      I was planning to power them using one of the 12v outputs on the toolboard.

      I was unable to find this in the specifications.

      posted in Duet Hardware and wiring
      j.dewitundefined
      j.dewit