hi,
i'm trying sensirion smf3000 flow sensor (i2c) work rpi.
senrsor: https://www.sensirion.com/products/mass ... low-meter/
i2c data sheet: https://www.sensirion.com/fileadmin/use ... n_v1.1.pdf
have got i2c enabled on rpi , can detect sensor correct address (0x40). have kind of communication going between sensor , rpi without errors, data don't make sense me , static regardless of te flow.
far understand want me start measurement writing address 0x40 2 bytes 0x1000. new measured value should read 3 bytes (including crc checksum) same address 0x40.
how do simple steps? don't think i've found suitable functions. far i've tried:
, lot of this...
there way send , receive several bytes without defining target register?
or problem somewhere else?
in advance
i'm trying sensirion smf3000 flow sensor (i2c) work rpi.
senrsor: https://www.sensirion.com/products/mass ... low-meter/
i2c data sheet: https://www.sensirion.com/fileadmin/use ... n_v1.1.pdf
have got i2c enabled on rpi , can detect sensor correct address (0x40). have kind of communication going between sensor , rpi without errors, data don't make sense me , static regardless of te flow.
far understand want me start measurement writing address 0x40 2 bytes 0x1000. new measured value should read 3 bytes (including crc checksum) same address 0x40.
how do simple steps? don't think i've found suitable functions. far i've tried:
code: select all
import time import smbus i2c = smbus.smbus(1) address = 0x40 cmd_start = 0x1000 cmd_serial = 0x31ea cmd_soft_reset = 0x2000 i2c.write_word_data(address, 0x00, cmd_soft_reset) time.sleep(0.1) i2c.write_word_data(address, 0x00, cmd_start) try: while true: time.sleep(.03) msb = i2c.read_i2c_block_data(address ,0x00) print (msb) msb = i2c.read_word_data(address, 0x00) print (msb) msb1 = i2c.read_byte(address) msb2 = i2c.read_byte(address) msb3 = i2c.read_byte(address) print (str(msb1) + " " + str(msb2) + " " + str(msb3)) except keyboardinterrupt: # ctrl+c pressed, so... print ("bye")
code: select all
[16, 19, 126, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255] 4880 16 16 16
or problem somewhere else?
in advance
i know it's been on year, wondering if able find solution, experiencing same issue. thanks.
raspberrypi
Comments
Post a Comment