RTClib icon indicating copy to clipboard operation
RTClib copied to clipboard

Issue : Should react to the case of IIC read failure (应该对IIC读取失败的情况做出反应)

Open MR-XieXuan opened this issue 2 years ago • 5 comments

If the read fails, you should return a DateTime error, which is not good for your program. write_then_read returns false on failure and true on success. The library should also handle this. It looks like this. Chinese (中文) : 如果读取失败,应该会出现返回DateTime错误的情况,这样子对程序不利。 而 write_then_read 在操作失败以后会返回 false , 成功后会返回true。 库中也应该对这个进行处理 。 像这样子。

MR-XieXuan avatar Mar 12 '23 16:03 MR-XieXuan

What RTC module is being used?

What Arduino sketch is being run?

The validity of the I2C connection is checked in begin() which returns false if it fails. If begin() is returning true but I2C is failing later, then it may be something else.

caternuson avatar Mar 13 '23 16:03 caternuson

I found that in the case of high core reuse, it is possible to fail to read the wrong data, such as the date of June 24, 2024. The DateTime object receives this error message and does nothing with it. And the write_then_read functionalso gives us the return value, if there is an error halfway through the read, and the value is read without any obvious exception. This may cause the read out data to be untrustworthy. The above translation results are from Youdao Neural Network Translation (YNMT) · computer image

Chinese(中文): 我发现在核心高复用的情况下可能会出现读取失败的情况,读取出来的数据是错误的,比如 2024年123月24日 。 而对象DateTime接到这种错误的信息却不做任何处理。 而且在write_then_read方法中也给出了返回值,如果读取到一半出现错误,而读取出来的值是无明显异常。 这可能会导致读出的数据不可信。 以上翻译结果来自有道神经网络翻译(YNMT)· 计算机

MR-XieXuan avatar Mar 13 '23 17:03 MR-XieXuan

RTC module : RTC_DS1307 Sometimes this problem occurs : image

MR-XieXuan avatar Mar 13 '23 17:03 MR-XieXuan

RTC module : RTC_DS1307 Sometimes this problem occurs : image

I am also getting similar issue. Any fix you haave got?

[ 3041][E][Wire.cpp:499] requestFrom(): i2cWriteReadNonStop returned Error 263

Thermelgy-Repo avatar Apr 09 '24 22:04 Thermelgy-Repo