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

    j.dewit

    @j.dewit

    1
    Reputation
    1
    Profile views
    22
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    j.dewit Unfollow Follow

    Best posts made by 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

    Latest 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