Finally fixed issues with reading / writing data
Things work on Linux, need to test on RPi