I am new to both GrovePi and the Raspberry Pi.
I am following a blog series where it is described how to capture sensor data via a raspberry pi and send it to a cloud database.
In the blog post however, the author has directly connected the sensor to the raspberry pi using some soldering, which of course we avoid with the GrovePi. The author then uses Java code (deployed on Raspberry) to extract the sensor data from a file. The file he uses is /sys/bus/w1/devices followed by the folder created by adding the sensor followed by /w1_slave. Below is a snippet of the code.
I want to use the same code but need to understand where the sensor data of my sensor is stored. On my Pi, the folder /sys/bus/w1/devices is empty, and I assume I need to go to the i2c folder under some structure (but am not sure).
Can someone assist where I can get the sensor data file that I can parse and reuse the provided Java code?
Hey,
That post uses a sensor which has direct support for it in the linux kernel that’s why he was able to set up in /dev in the first post. GrovePi does not work like this. The easiest thing that you can do. is to deploy a socket server in Python which reads a temperature value from the GrovePi and sends it to a Javi client which is requesting the sensor data and send it to the cloud.
You should be able to find some examples for communicating b/w a python socket Server and a Java client on the internet.
Thanks. I knew that GrovePi works differently than a sensor directly connected to the Raspberry Pi.
I was hoping that there was a place (folder on filesystem) where the GrovePi writes the sensor values from where I could pick it up.
When you say “… reads a temperature value from the GrovePi…”, you mean directly from the sensor, not from any location on the file system where GrovePi sensor values are written, right?
Thanks, I will take up your suggestion.
Meanwhile I have also found some code on github which might be of assistance.
Hi Suneet,
Thanks for sharing the link, that project seems to be doing something similar to using a socket connection but it directly receives and sends the data to/from the cloud. This might be the easiest way to get the Grove Sensors working.
The sensor data from the grove sensors is not stored on disk right now, you just call the functions and it returns a value read directly from the GrovePi. To read a sensor you actually send/receive commands/data from the Pi to the GrovePi and you do not have direct access to the sensor.
Suneet,
I am interested on doing some tests with GrovePi related to SAP HCP, have you finally been able to solve this?
Otherwise, I may start building everything from the scratch.
Thanks and regards.
Alejandro.
Hi Alejandro, sorry but I had to stop on this project temporarily. So I am afraid I have to give you the bad news that you may have to start from scratch.