Sound Sensor on Node.JS

Just started to play in Node.JS with this sensor and I’m not able to read consistent data. With or without sound, the values are the same from Node.JS. I read the data using AnalogSensor and when I read 1.000 samples, the values are the same when there is a lot of sounds around or when is quite.
I’m doing something wrong, but I’m not able to identify the problem.

Configuration: GrovePI+, Sound Sensor v1.6 connected on A0

Below you can find the code that I’m using for it.

Code

Somebody? Or I am the only one that plays with sound sensor

Having the same problem with the sound sensor and Node js. I’ve tried with both the generic analog sensor library and generic digital sensor and I’m getting unreasonable results.

Configuration: GrovePI+, Sound Sensor v1.6 connected on A0

I had the same issue, I almost started doubting first my ears then my sanity.
Looking forward to this.

Hey folks, a couple of quick questions:

First, can you try using the sound sensor with the Python examples? If the sound sensor doesn’t work there, you may have a bum sound sensor.

Second, before you do that, can you upgrade the firmware on the GrovePi+? We put out an update to the firmware a few weeks ago. This should make reading and writing analog values much quicker (might not solve your problem here, but just looking ahead).

Best,

John

@andras75 @shacharl @vunvulear,
We had pushed a big update for the software and the firmware for the GrovePi a while back. Can you first run the DI update on the Desktop and Update the software. Next run this script and make sure that the firmware version is 1.2.7.

The Sound sensor is an analog sensor and would only work on the analog port. Can you try out this example with the sensor connected to A0 and make sure that the sensor returns reasonable values.

Just made the DI update from the Desktop, and now I can’t run the python scripts and i’m not getting any values from the sensors with my node.js app…
When I’m trying to run the version app i’m getting

File “groveversion.py”, line 7, in
print(“GrovePi has firmware version: %s” %grovepi.version())
File “build/bdist.linux-armv7l/egg/grovepi.py”, line 265, in version
return “%s.%s.%s” % (number[1], number[2], number[3])
TypeError: ‘int’ object has no attribute ‘getitem

@karan, the update went perfect. you fixed the bug.
i also noticed it is not updating the firmware forcibly if not needed. Is it true? How can I get info about the board? (version, etc…)

soon, I’ll check the sound sensor as well and report.

@andras75: great to hear that it is working for you. Can you expand a bit about the firmware not forcibly updating.

You can check the firmware version by running the script here . The hardware is pretty identical for all the GrovePi’s.

@karan hi karan , how do I roll back this update, I can’t get any metrics from any sensor now?

Before this update it always updated the firmware no matter if it was the latest. Well, it’s only an assumption… I simply run the firmware update twice in a row and i always saw the writing progress. The latest update just simply said the firmware is up-to-date and went on.
Now that I know how to check the board’s version i can check the validity of my thoughts.