I tried to read information from a "character device file". This file is used by a sensor which stores data with a high frequency. I looked at some solutions but they didn't work. Could someone briefly explain to me how to solve this and also which libraries I have to import.
import os
import numpy
data = numpyndarray(100)
#data = "xxxx"
dev = os.open("/dev/rtlightsensor0", os.0_RDWR)
os.write(dev,0,os.SEEK_SET)
print os.read(dev,16)
OSError: Invalid argument [Errno 22] Edit, i changed the data with a buffer, but still same problem.