Using my sensors within CODAP

CODAP Forums CODAP Help Forum Using my sensors within CODAP

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #496 Score: 0

    Hi,

    What do I need to know about my sensors to create a plugin so CODAP can read directly from them?

    My sensors are from LabMate console (Einsteinworld, formerly Fourier).

    Clicking here you can access LabMate specs.

    Thanks a ton.

    Cristián

    #501
    Scott Cytacki
    Participant

    Hi Cristián,

    There can be quite a few pieces involved in getting this to work.  It looks like your sensors use Bluetooth. If this is Bluetooth Low Energy then it is a little easier. If it is classic bluetooth, or you need to use USB, then it gets more complicated.

    An important question is what platform (Windows, Mac, ChromeOS, Android, iOS, …) do you want to run CODAP on.  If you are using ChromeOS, Android, or iOS we don’t have a good pattern for you to follow if you need to use Classic Bluetooth or USB.

    BLE Sensors

    I wrote an article in our newsletter about connecting to BLE sensors in the browser: https://concord.org/newsletter/2017-fall/sensors-in-the-browser-with-web-bluetooth/

    If you can use BLE then you will need to get the protocol for the LabMate console. Sometimes sensor vendors are reluctant to provide this. The most common concern is that you will build something popular that connects to their sensors, and then sensor vendor will start getting support requests about this software over which they have no control.

    After getting this protocol, then I think your best option is to extend our Sensor Interactive: https://sensor-interactive.concord.org/ This interactive can be added to CODAP, and it will export data to CODAP. The code for it is here: https://github.com/concord-consortium/sensor-interactive A branch of that code supports some BLE sensors: https://github.com/concord-consortium/sensor-interactive/blob/sensor-tag-support/src/models/sensor-tag-manager.ts  You can start there and create your own ‘manager’ class to communicate with your sensors.

    Bluetooth Classic or USB

    In this case we use our application called Sensor Connector. This page provides some high level info about it: http://sensorconnector.concord.org/ This only works Windows and Mac.

    The same Sensor Interactive code supports talking to the Sensor Connector. If you follow this pattern then you need to add support to the Sensor Connector to talk with your sensors. The Sensor Connector uses a set of Java libraries we wrote for talking with sensors: https://github.com/concord-consortium/sensor-projects So you would start by adding support in these libraries to talk to your sensors. And then do a minor update to Sensor Connector so it can use your new support.

    The hardest part with this is usually getting support from the sensor vendor. If you are lucky they will give you an SDK that includes a USB driver (if you are using USB), and a dynamic library for communicating with their sensors. This dynamic library usually has an interface that is designed to be used by C or C++.  This dynamic library uses a protocol to talk to sensors.  The dynamic library often takes care of the details so it is easier to work with the sensors from code.  In our sensor-project code we talk with these libraries using a Java framework called JNA.  There are several examples in the sensor-projects code for talking to dynamic libraries like this.

    If the vendor does not give you a SDK, they might give you a just a protocol and a USB driver. In this case need write the code that uses this protocol to communicate with sensor.  This is essentially how we communicate with the Vernier LabPro, which you can see the code from here: https://github.com/concord-consortium/sensor-projects/tree/master/sensor-vernier/src/main/java/org/concord/sensor/vernier/labpro

    It also turns out that we used talk with Fourier sensors, but were not able to maintain support for them. If I remember right we just had a USB driver from them, and we wrote the protocol ourselves for talking with the driver. I’m pretty sure the protocol for talking to the sensors will have changed somewhat, however often these protocols remain similar over time. So if I can find our old Fourier code it might be a good place to start if you are going this way.

    Conclusion

    Here is what you need to get started:

    • a developer: depending on which route you need to go, this developer might need to work in Javascript, or in Java.
    • support from the sensor vendor: you either need the protocol to talk to the sensor, or an SDK to talk to the sensor. If you find the right developer and have enough time, it might be possible to figure out the driver and/or protocol without support from the vendor.

    There is one more option that I didn’t mention yet. Instead of using our Sensor Interactive and/or Sensor Connector. You can come up with your own way to get data out of your sensor.  Then you can create your own plugin (that is what the sensor interactive is) and use CODAP’s Plugin API to send this data to CODAP.

    #507

    Thanks a lot Scott for your detailed explanation!!

    I’m using LabMate+ through USB, not bluetooth. I tried with the Sensor Interactive and Sensor Connector with no luck.

    The SDK that Fourier/EinsteinWorld provides is just for mobile technology  (Android/iOS).

    Let me know if you find the old Fourier code that you developed and see if that works. If not, I will continue working with MiLab and MultiLab as the record loggers and will export the data as CSV into CODAP. This works fine by the way.

    Creating a plugin or modifying sensor connector are far away beyond my technical knowledge.

    Thanks again for your support.

    Kind regards,

    Cristián

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.