I want to use the BME280 temparature sensor with my Jeton Nano. I found this C library on GitHub which seemed to help me out, because I need a solution for either C or C++. The devs state that it was only tested with Raspberry Pi (which uses wiringPi). I compiled it on my Jetson Nano and was faced with an error message, so it doesn't seem to work on Jetson platforms. It failed to read the chip's ID and returned error code -2:
Failed to initialize the device (code -2).
Is there a chance that this can be fixed so it can be used on Jetson platforms, too? And are there any other possibilities to use the BME280 with C++ on Jetson Nano?
Currently, we don't have plan to have our C++ platform for sensor API.
All C base sensor API is also working under C++ environment.
For the issue you met, it is bus communication problem. You can also put logic analyzer on the bus for further debug to see if the correct device address are issued on bus and if sensor send ACK to it. (-2 means device nout found which means host didn't see the ACK). so the logic on bus is very helpful to solve this issue.
Thanks for pointing out. As for me, I'm don't know much about I2C or Bus communication in detail which makes it difficult for me to solve this problem the way you described. I don't know hot to use a logic analyzer and also don't have one. Also, I didn't found any information on the internet on what an ACK is. Can you please point ot more precisely where the problem could lie?
I looked at the code where the error is returned and don't know what I would have to change. Also, for Jetson Nano, I had to compile it without linking the WiringPi library (since it doesn't work on Jetson).
Do you able to find the lower level device driver on that platform?
You need to mapping or link the system I2C driver to our API first.
You need to ask NXP for the hardware layer API and structure then to adding our sensor API into the structure.