Error in Grove Dust Sensor code (Solved)

Hi.
I have been trying to run the grove dust sensor, set it up properly and updated the framework version as well. Still, when I connect dust sensor to grovepi+(on port D2) and run the script provided, I get the following error:

AttributeError: module object has no attribute ‘dustSensorRead’

I assume, this is telling me that grovepi+ has no function for dustSensor. And what to do in this case?

I think you need to update the library (and most likely the firmware too) on the GrovePi.

To update the library, execute this:

curl -kL dexterindustries.com/update_grovepi | bash

And after that, flash the firmware onto your GrovePi by doing these:

cd /home/pi/Dexter/GrovePi/Firmware
bash firmware_update.sh

Once the firmware gets flashed, launch a Python shell, import the grovepi module and check the version of the firmware:

import grovepi
grovepi.version()

Also, make sure you read the documentation for it too:
https://dexterind.github.io/GrovePi/

Thank you!

Hi Robert,

I have exactly the same issue. I used the DI image and GrovePi is running smoothly with the other sensors. I followed your advise concerning updating as well. I have Firmware version 1.3.0 installed.

Do you have an idea? I need this sensor for an upcoming project.

Thanks,
Adrian

On 1.3.o I think the firmware grovepi.py was changed. Try replacing DustSensorRead() with dust_sensor_read()

Worked like a charm. Thanks @reunny

Good for you. Mine is not showing any readings at all.

Hi @adrian.schoene, @reunny, @nashezzubair and for everyone else.

For those that visit this thread, maybe you can try out the suggestion I have come up in this post:

Or you can have a look at the documentation and see if there’s anything missing out of your scripts:
https://dexterind.github.io/GrovePi/

Which by the way, were you aware of the documentation? I’m wondering if we somehow have put the documentation in some hidden place where nobody can find it. If so, please let us know.

And speaking of which, where do you usually go to find instructions/information regarding the GrovePi?

Thank you!

I had always relied on the forum queries for anything related to the dust sensor. Apart from that, a few blogposts regarding the sensor.

Never knew there was a detailed documentation. But then I returned to the Grove space and forum after more than an year

So it’s safe to assume you don’t generally go to the project’s repository and read the README, right? Like here.

If you check this repo, you’ll see somewhere down the page a link taking you to the documentation. My feeling is that it is positioned way too below and it’s not even obvious to the users. What do you think?