TroubleshootingGravity

SEN0539: i2c not stable on rpi2 or pi0w

userHead karl.wachs 2024-12-08 06:37:40 574 Views2 Replies

I can use the i2c connection on an rpi3 w/o problems. Trying the same on an  rpi0W or rpi2 - i still have 5 spare ones - becomes unresponsive after ~ several minutes.

Only a power recycle solves the problem.  Using the uart/serial connection works, but lacks the option of turning on continuous awake state through a command. That only works with i2c (call: set_wakeup() ).

 

Any advice besides the standard  “ https://www.dfrobot.com/forum/topic/332598” which is just the example c code ??

 

 

ps:

 

the suggestion to use 
set_type= DF2301Q_UART_MSG_CMD_SET_ENTERWAKEUP ;   set_value = 0 

in 

setting_CMD(self, set_type, set_value):

 

in uart/serial mode does not work.

 

 

2024-12-11 06:47:42

yes it is… ONY AFTER some time (10 minutes) on rpi2 or rpi0w i2c hangs with THIS sensor.  RPI3 seems to work fine. 
Now after some days of running, same error on the RPI3.  It looks as if read / write to sensor must not happen to frequently, added a wait of 0.08 secs, that seems to help (for the rpi3, not for the rpi0w/rpi2)
 

ps. sudo is not needed for i2cdetect -y 1

userHeadPic karl.wachs
2024-12-08 22:50:01

Use i2cdetect to ensure your device is properly detected:

sudo i2cdetect -y 1
 

userHeadPic lia.ifat