RTC over USB malfunction

Hi RaspberryShake community!

I am opening this topic because I face issues when trying to communicate between my RaspberryShake 1Dv8 and an USB Real Time Clock (USB Real-Time Clock (RTC) for Raspberry Pi | The Pi Hut and github here: https://github.com/sbcshop/USB-RTC-Software).

For the record, I wanted to add this functionnality to the RShake because the network is sometimes unavailable at my remote site, and I wanted to keep a good time-reference for the data.

The problem I face is the following:

  • I have a raspberry 4 for tests at the office. When I plug the USB RTC and run the codes from the RTC gitlab, I succeeds everytime both in time reading (from RTC to RSpi OS) or in time writing (from the RSpi OS to the RTC).
    It succeeds at the 1st attempt, and takes 0 second.

  • when I run the same code on the Rshake (raspberry 3), I face various issues. Sometimes, it is possible to read or write the time from/to the RTC. But I takes generally hundreds to thousands of communication attempts (and around 10 seconds) to get one “successful” date-time communication.
    But most of the time, it takes forever because no communication attempt succeeds…

My question is -in brief!- : do you have any idea what could cause such a difference between my test raspberry (which runs accordingly to the expected behavior) vs the rshake (issues) ?
I am wondering what could cause such trouble…

Thanks for sharing your opinion, any ideas welcome!


Pierre, from France

Hello Pierre, and welcome back to our community!

This is a very interesting question, and the USB RTC could also be useful for other projects, so thank you for posting all its documentation here.

From what you wrote, I think (assuming that the OS on the PI4 you have tested was the official Pi OS) that there are some compatibility issues between our Shake OS and the code provided for the USB RTC.

Our Shake OS, fully optimized for its designated work, is based on a modified version of what normally runs on any Raspberry Pi, so we provide OS updates when they are available (as the latest one, for example: Shake OS v0.20 image has been released!).

If the USB RTC software provides some logs, or the possibility to enable them, they could give you input on what is not working as expected, and you can try to proceed from there.

If anyone else here in the community wants to add something that I may have missed, feel free!

Hello! And thanks very much for your answer.

Yes indeed, the PI4 that I use for tests runs an official Pi OS.

I checked the logs produced by the Pi4 and the Rshake in /var/log/syslog and journalctl.
I tried both reading/writing routines, betwwen the Pi’s and the RTC.

I don’t see any obvious difference in the logs, at my comprehension level (which is quite low!).

When I initialize the USB-serial connexion between the Pi’s and the RTC, I get the following lines in syslog:

Apr  3 08:39:40 raspberryshake kernel: [253238.219767] usb 1-1.5: USB disconnect, device number 23
Apr  3 08:39:41 raspberryshake kernel: [253238.740900] usb 1-1.5: new full-speed USB device number 24 using dwc_otg
Apr  3 08:39:41 raspberryshake kernel: [253238.881120] usb 1-1.5: New USB device found, idVendor=04d8, idProduct=00dd
Apr  3 08:39:41 raspberryshake kernel: [253238.881128] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Apr  3 08:39:41 raspberryshake kernel: [253238.881133] usb 1-1.5: Product: MCP2221 USB-I2C/UART Combo
Apr  3 08:39:41 raspberryshake kernel: [253238.881137] usb 1-1.5: Manufacturer: Microchip Technology Inc.
Apr  3 08:39:41 raspberryshake kernel: [253238.883183] cdc_acm 1-1.5:1.0: ttyACM0: USB ACM device
Apr  3 08:39:41 raspberryshake kernel: [253238.887107] hid-generic 0003:04D8:00DD.0015: hiddev96,hidraw0: USB HID v1.11 Device [Microchip Technology Inc. MCP2221 USB-I2C/UART Combo] on usb-3f980000.usb-1.5/input2

Everython seems fine for both Pi’s (“normal” and Rshake).
The only difference is the following line when mly script succeeds:

Apr  3 08:40:10 raspberryshake systemd[1]: systemd-timedated.service: Succeeded.

[Note: it succeeds EVERYTIME at 1st try with the PI4;
while it may succeed with the RShake but it takes hundreds to thousands of repeated attemps in the code. And sometimes it fails until the 30s timeout]

Journalctl gives the same code lines as syslog (it recongnizes the USB microchip in both cases, and I don’t get any error message)

I would like to avoid updating the RShake firmware because I will have to re-install my 3rd party packages I guess (such as the rtc libraries, services, etc).

I think that I am pretty stuck with this issue right now. If you have any idea…! Thks again, best regards

Hi Stormchaser!
Thanks for your suggestion

I tried to proceed as described, i.e. burn a new microSD card with the new Shake OS v0.20 on it. I re-installed the requirements (dependencies) for my RTC over USB.

I get the same results as before (with the older Shake OS), i.e. the communication between the Shake and the USB RTC is not reliable.
I can read or write sometimes the date/time, but some other times the communication fails during more than 30sec timeout (max time for communication attempts).

Anyway, I think that I am wasting more time than what it’s worth. Maybe I’ll give a try in the future using a GPS antenna to setup the date with ntp; in case when ntp servers are unavailable (ex: no internet connection).

Best regards,

1 Like

Hello Pierre, great to see you back!

At this point, as you said, there is some kind of missing dependency/incompatibility between the USB RTC and the Shake OS we are using. It is possible that, in the future, further OS updates will address this, even indirectly, but as of now, I cannot provide any ETA.

My recommendation is your conclusion, that if you have the necessity of timing data acquisition in the case of in-the-field (or simply offline) Shake installations, the GPS module will be the fastest way to achieve it.