sds011 icon indicating copy to clipboard operation
sds011 copied to clipboard

Error Reading from Sensor

Open fabianbaier opened this issue 7 years ago • 3 comments

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?

fabianbaier avatar Dec 07 '18 23:12 fabianbaier

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...

maurorappa avatar May 08 '19 22:05 maurorappa

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

matitalatina avatar Nov 13 '20 07:11 matitalatina

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.

matitalatina avatar Nov 13 '20 08:11 matitalatina