cancel
Showing results for 
Search instead for 
Did you mean: 

Hi everyone, I'm trying to acquire a temperature from a MCP9808 sensor with a B-L072Z-LRWAN1. But I got an "onRxTimeout" error everytime I try. Is someone knows why ? Thank you a lot for helping me.

YMAIL
Associate II

 I'm using stm32cubeIDE and I got nothing more than the STM32CubeExpansion_LRWAN_V1.2.1's libraries (stm32l0xx_hal_i2c) to help me. I'm on the i2c1 interface on PB8 and PB9 ports. I think the problem is that I don't know how the flags works.

5 REPLIES 5

Can you actually read the sensor via I2C currently?

Which LRWAN example are you using as a basis for this project?

onRxTimeout can simply mean nothing was heard on the radio during the timeout period, ie 1 second, or whatever.

Something on the network would need to be transmitting message(s) with the same radio settings for this node to be able to hear it.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
YMAIL
Associate II

Thank you for your quick response.

With an arduino code I was reading the sensor clearly. Now I'm using the ping pong example.

I tried to see with an oscilloscope if something was transmited on the I2C ports but the signal didn't move.

Here are the part of my code coresponding to the I2C communication :

#define MCP9808_I2CADDR_DEFAULT     0x18      //I2C addr sensor

uint32_t TimeoutI2c = 100;

...

HAL_I2C_IsDeviceReady(&hi2c1, MCP9808_I2CADDR_DEFAULT, 5, TimeoutI2c);

PRINTF("Ok \n\r");

Thank you for helping me.

YMAIL
Associate II

Hi !

I just tried with HAL_I2C_Master-Transmit-IT() and HAL_I2C_Master-Receive-IT(). I don't get error but I'm not sure of how these functions works. I will try to understand. I think that the solution is in the MCP9808's datasheet.

Thank you again for helping me !

YMAIL
Associate II

Hi !

In fact HAL_I2C_Master-Transmit-IT() don't work. It just let the code go on even if it does nothing.

I'm new with this kind of work. Is someone know if I'm missing something obvious ?

YMAIL
Associate II

Hi everyone !

Just to say that it works with a project correctly configurate with cube mx. I think that the problem comes from the example config wich doesn't match what I need. If someone knows how to put a .ioc config file in the example project it will help me a lot.

Thanks all