Thanks for your response. I was finally able to read. But write is still difficul. I still receive code 6.
I set 0 as length because the sensor juste require a write on the register that’s all. It for a reset
Do you have an exemple of a write without value ?
Thanks
Ps: I have update my fork with running code except write
I see your code. Sadly, we do not have RUI API that can cover your requirement of writing only on the address of the device but not on a specific register address. If you need the reset command and very critical on your application, doing via RUI might not be the best solution.
It’s a bit weird doing a write to a register without having any data, so I can’t say I’m surprised there isn’t an RUI command that supports that instance - I’ve run up against similar in the past.
I see that the sensor is actually based on an ATtiny414 so I guess the I2C command sequence is individual to the creator.
With RUI we can actually call the HAL commands, so there may well be a HAL_I2C command in the STM32 API that can do the job.
Thanks for your response, I write on the device but also on the register (0x00), but my point is to write nothing.
It’s quite common as far as I see on sparkfun stuff to write 0 bytes on a register, to activate it or to tell it to go to slepp, and it works nicely.
I’m currently evaluation RAK for a customer project with i2c sensor, I have just pick one sensor that work well with Arduino stuff.
I am not sure if it is the same with your application. To reset your moisture sensor you have, you are not writing nothing on a specific register but you are writing the register address on the I2C device address then end the I2C bus. I am not sure if we are on the same page but that features is not something we support at the moment and have no plans yet.
For which I can’t find anything in the I2C spec about doing that (I checked) which means that it is unlikely any of the major firmware API’s like STM32 are going to have support for “write to register but don’t actually send anything to write”.
I use I2C as a comms mechanism between MCU’s and Pi’s and it has never occurred to me to try that sort of sequence.
Maybe @litbos could evaluate a mainstream sensor with more mainstream I2C support? It would be a shame to rule the RAK range out, as I can’t image you’ll find another vendor range that uses well supported API’s that will enable this.
PS, Arduino based I2C doesn’t count, I can hack that as much as the next hacker to warp time & space.
Thanks for your response. And sorry for my newbies question. I m more used to python and business apps.
If if not common and not supported. We can close this topic.
I will clean my code to remove those write functions.