• Tags
  • Documentation
  • Order
  • Register
  • Login
Duet3D Logo Duet3D
  • Tags
  • Documentation
  • Order
  • Register
  • Login

Send event data to remote server

Scheduled Pinned Locked Moved
Firmware wishlist
2
5
752
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • undefined
    jeanmarc_Scaled
    last edited by 30 May 2018, 12:14

    We run a number of machines and are looking to collate the event log data on a central server. This will enable us to monitor machines, analyse the data perhaps eventually run a print queue from that server.
    Looking at IoT dashboards, such as thingsboard.io (and there are many others), it appears that devices need to authenticate with the server before being able to send data.
    I see a few people have discussed the idea of the Duet sending data, (https://forum.duet3d.com/topic/4285/g-code-to-actually-send-a-message, https://forum.duet3d.com/topic/4795/how-to-use-m118-to-send-http-requests) but no neat solution has been presented.

    I think it would be useful to add a webclient class to RepRapfirmware to be used by M118 and M929 to send data to a remote server.

    Before I tackle adding this myself, I wanted to ask whether anyone else is working on such a solution so as not to reinvent the wheel?

    There are plenty of example code snippets online, such as http://lwip.wikia.com/wiki/Raw/TCP, which describe how to structure such a feature.

    Jean-Marc Giacalone
    Scaled

    1 Reply Last reply Reply Quote 0
    • undefined
      Danal
      last edited by 30 May 2018, 17:05

      I would carefully consider how much you want TCP/IP connections that depend on a remote server running on the Duet itself, even under RTOS. It might work just fine, with careful enough coding. It also might turn into a can of worms.

      The other alternative, that could easily be implemented with no changes to the Duet itself, is to periodically "poll" using the same status commands that Duet Web uses today. An intermediary would do the polling, and then push the resulting data logs wherever you wished. The intermediary could be very simple, a script with curl commands, or could be in whatever platform/language you prefer.

      Just a thought...

      Delta / Kossel printer fanatic

      1 Reply Last reply Reply Quote 0
      • undefined
        Danal
        last edited by 30 May 2018, 17:07

        This is in many ways pretty far from what you want... I'm showing it because it is an example of multi-printer polling.

        This only took a few days to build, using the existing Duet Web control as a starting point.

        https://github.com/DanalEstes/MultiDuetWebMonitor

        Delta / Kossel printer fanatic

        1 Reply Last reply Reply Quote 1
        • undefined
          jeanmarc_Scaled
          last edited by 30 May 2018, 18:20

          @Danal Thank you for your comments. I already played around with your MultiDuetWebMonitor. It looks good.
          I am also considering polling from the remote server, but although that would give me data to draw some nice graphs, it wouldn't provide accurate data for print start/stop/cancel events and filament usage.
          In a production scenario, the standard DuetWebControl interface wouldn't be running as print start commands would come from the remote server, so opening an intermittent outgoing connection from the Duet shouldn't add too much strain on its processes, but I agree this extra overhead will have to be investigated further and monitored.
          Perhaps it would be safer to modify the data written to the eventlog on the SD card, and have the server poll the last line to check for new events.

          Jean-Marc Giacalone
          Scaled

          1 Reply Last reply Reply Quote 0
          • undefined
            Danal
            last edited by Danal 30 May 2018, 19:48

            Yeah, I think there are a lot of ways it could work.

            Accuracy? DWC polls four times a second today. I believe that's a bit much, but one second polls would certainly work, and would seem to give "accurate enough" stats.

            You probably already got this, but just to be super clear: I'm talking about an intermediate "marshaling point" for the farm, pulling from multiple printers, and pushing only aggregated stuff to the final repository server.

            And, again, probably lots of ways... 🙂 Will be interesting to follow.

            Delta / Kossel printer fanatic

            1 Reply Last reply Reply Quote 0
            4 out of 5
            • First post
              4/5
              Last post
            Unless otherwise noted, all forum content is licensed under CC-BY-SA