DWC Time sync
-
Hello,
I want to add an RTC clock to keep track of current time and send the value to Duet every time it is powered on, so that the current date can be displayed on LCD panel without the need for internet connection. My problem is that every time I connect to DWC it automatically overrides the actual date. I would like to change it and create a button for single synchronization event.
Could you guide me how the sync is done ? Which line of code is responsible for this ? I assume the code is somewhere inside dwc.js file but I can't find it.Thanks.
-
@dan_55 Look for the
rr_connect
request. It's one of the two parameters of this request (the other is the password). -
-
-
@dan_55 said in DWC Time sync:
@wilriker Thanks ! I will look into that.
@dc42 Yes, I know but DWC always overrides this value when connecting. It's not a big deal, but it creates a little mess in my code and I'd like to disable it.
You will need to patch DWC not to set the date/time in rr_connect, whether you use rr_connect or M905 to set the time and date yourself. I am fairly sure that you can just have DWC omit the date/time parameter when it sends the rr_connect request.