Error Reading from Sensor
Hi,
First thanks for putting this together!
When plugging my SDS011 I found the device is mounted under /dev/tty.usbserial-1410
I get
2018/12/07 15:39:47 ERROR: sensor.Get: bad checksum: &sds011.response{Header:0x98, Command:0xe6, Data:[6]uint8{0x0, 0x98, 0x80, 0x0, 0x9e, 0x80}, CheckSum:0x0, Tail:0x80}
Do you know how to quickly fix this?
Hi,
I have exactly the same issue:
2019/05/08 22:53:16 ERROR: sensor.Get: bad checksum: &sds011.response{Header:0x98, Command:0xe6, Data:[6]uint8{0x0, 0x7e, 0x60, 0x86, 0x18, 0x9e}, CheckSum:0x86, Tail:0xf8}
my serial number is 5002-7B72, it must be a newer version...
Same issue
2020/11/13 07:23:16 ERROR: sensor.Get: bad checksum: &sds011.response{Header:0x0, Command:0x3f, Data:[6]uint8{0x1, 0xe9, 0x94, 0xa1, 0xab, 0xaa}, CheckSum:0xc0, Tail:0xe2}
2020/11/13 07:23:17 ERROR: sensor.Get: bad checksum: &sds011.response{Header:0x0, Command:0x40, Data:[6]uint8{0x1, 0xe9, 0x94, 0xa0, 0xab, 0xaa}, CheckSum:0xc0, Tail:0xe3}
My serial number is 5003-XXXX
I just fixed using, I don't put error handling for clarity.
sensor.Awake()
sensor.SetCycle(1)
sensor.MakeActive()
sensor.Get()
In other words, make everything explicit about what you want to do. Maybe the sensor is in a different state, so it fails checksum.