OpenIotOrg / openiot

The Open Source Project for the Internet of Things
461 stars 189 forks source link

Wrapper for an audio sensor #69

Open DavidGuillen opened 10 years ago

DavidGuillen commented 10 years ago

Hi all,

I would like to integrate audio sensors in OpenIoT platform and I have some doubts.

  1. What is my target? I would like to integrate audio sensors in OpenIoT platform. I read in the DOC that this is mainly a GSN issue, but maybe someone who already did it could give me a hint. The idea is to select an audio sensor from the Graphical Interface and stream the audio from the physical layer to the Graphical Interface. NBo SafeStorage is intended to be used for now.
  2. How am I working with OpenIoT? I downloaded the VM available in the website.
  3. What am I doing? 3.1 · I read the theory on the Website and the book Gobal Sensor Networks (2nd July 2009 version). 3.2 · I created the "xml.metadata" file based on another example. source=http://localhost:22001/audioinstance sensorName=EAR-IT_audioRecorder author=DavidGuillen dataGraph=http://openiot.eu/OpenIoT/sensordata# metaGraph=http://openiot.eu/OpenIoT/sensormeta# registered=true fields=audioStream field.audio.unit=dBW field.audio.propertyName=http://lsm.deri.ie/OpenIoT/AudioStreamer sensorType=AudioStreamer sourceType=gsn information=AudioRecorder_n0001_Hospital_BusinessPole latitude=43.624085 longitude=7.045362 sensorID=http://lsm.deri.ie/resource/444615681548945fake

3.3 · I created the "xml" file based on another example. I am not sure yet about how to define the query. But I would like to get the

org.openiot.gsn.EAR-IT_audioRecorder.LSMExporter false false AudioRecorder_n0001_Hospital_BusinessPole BusinessPole Dolines 1047, 06901 Sophia-Antipolis, France 43.624085 7.045362
data/station_1047.csv timed, audiodata, audio, sound timestamp(d/M/y H:m), numeric, numeric,numeric,numeric,numeric,numeric NaN,6999,-6999,null GMT+1 500 csv-check-points
select \* from wrapper select \* from audioSensorW
    1. I created a java class that I placed in the Folder of the workspace"/xgsn/src/main/java/org/openiot/gsn/wrappers/general". I extended from Abstract Wrapper and I implemented the four compulsory methods: initialize() finalize - (dispose??) getOutputFormat() getWrapperName()
  1. Which are my doubts? 4.1. getOutputFormat() I know that I should give a SQL format to the information to be accessed, but I am not sure how to do it. Let's say I only want 4 fields to set the sourceID, the time stamp, the packet number and a byte array containing the audio. 4.2. sendToWrapper(). As far as I know this is to commmunicate back to the sensor. If I need to stop the audio streaming I think I should implement it. Am I right? 4.3. Should I create a VSensor class too? The XML definition at least? Is the same I created before? 4.4. The XML metada should be copied into the "/xgsn/virtual-sensors/samples"? 4.5. How can I add it and test it when it is finished?

Thank you so much for, at least, reading until here.

Best regards,

DavidGuillen commented 10 years ago

The XML file lost the format when posting. I attached in this link

https://docs.google.com/document/d/15AZGXoqEZaTNOVtnuCO4rtKXfr_LBulOZHaHcWQg9eI/edit?usp=sharing