Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to record using more than 1 sensor at a time? #30

Open
vincentdjojo opened this issue Nov 17, 2020 · 6 comments
Open

Is it possible to record using more than 1 sensor at a time? #30

vincentdjojo opened this issue Nov 17, 2020 · 6 comments

Comments

@vincentdjojo
Copy link

I can't seem to record sensor data using at least 2 sensors. Is this possible? If so, how do you do it in Python?

@sswartley
Copy link
Contributor

Yes, you can use multiple Go Direct sensors. There is a getting started guide that can be found here:
https://vernierst.github.io/godirect-examples/python/#about-the-getting-started-examples

The guide will show where to find the examples. The guide also explains the various functions used in the examples. The open function is used to connect to one or more Go Direct sensors.

@vincentdjojo
Copy link
Author

vincentdjojo commented Nov 19, 2020

Yes, you can use multiple Go Direct sensors. There is a getting started guide that can be found here:
https://vernierst.github.io/godirect-examples/python/#about-the-getting-started-examples

The guide will show where to find the examples. The guide also explains the various functions used in the examples. The open function is used to connect to one or more Go Direct sensors.

Hello @sswartley. Thanks for responding.
I was able to get multiple sensors to work with my Raspberry Pi 4, but only got it to work by selecting the sensors one at a time through the following function from the Python library: gdx1.select_sensors().

I have 3 sensors (Temperature, Calcium and Dissolved Oxygen). What's the format that allows gdx1.select_sensors() to select the 3 sensors automatically? I've formatted the command as follows which doesn't seem to work in Python: gdx1.select_sensors( [ 1 ] [ 1 ] [ 1 ] ). Can help me out please? Thank you.

@sswartley
Copy link
Contributor

Hi vincentdjojo,

In the Getting Started Guide go to the "Notes Regarding the gdx Functions" section. Find the information about the gdx.select_sensors() function. In that section there is information about how to automatically connect specific sensors for your Go Direct device or devices.

For example, if you are just using a single Go Direct device, like the Go Direct Optical Dissolved Oxygen, you would first want to go to the User Manual for the device to see that it has a total of 5 on-board sensors (DO Concentration, DO Saturation, Temperature, Pressure, and DO Salinity). If you were writing a Python program that was just using this single Device, and you just wanted to read the DO Concentration sensor channel, then you would set the argument as such: gdx.select_sensors([1]). If you wanted to modify your program to also read the temperature and pressure sensor channels from this Device, then you would set the argument as such: gdx.select_sensors([1,3,4]).

Now, let's say you wanted to add a second Go Direct Device to your program, such as Go Direct Temperature. This Device only has a single on-board sensor. If you wanted to read Go Direct Optical Dissolved Oxygen sensor channels 1,3 and 4, as well as Go Direct Temperature sensor channel 1, you would set the argument as such: gdx.select_sensors([[1,3,4],[1]])

Again, this information is in the Getting Started Guide and is probably more clear than my explanation here. So take a look at that.

And one more thing... You should run the example called "gdx_getting_started_device_info.py" found in the example programs for each of your Go Direct devices. This example will give you information about your Go Direct Devices. It will tell you how many on-board sensors are on the device, and it will tell you what the sensor channel numbers are. In my example above I am assuming that the DO Concentration, Temperature, and Pressure channels of Go Direct Optical DO are 1, 3, and 4. I don't know that for sure. Run the device info example to double-check what the sensor channel numbers are.

Hope that helps and good luck!

@vincentdjojo
Copy link
Author

@sswartley
One more question.
Is it possible to know the order of which sensors are connected to my Raspberry Pi 4 with Bluetooth?
With Bluetooth the order of sensor devices seem to be different every time my Python code scans for them.
Seems like the order is always the same for wired connection through USB port.

@sswartley
Copy link
Contributor

I'm not sure how the scan list is generated. But the scan list only lets you know what bluetooth Go Direct devices are available. It does not determine which devices will be connected and it does not set the order for which they are connected. You determine which devices to connect and the order to connect them when you call the open function.

@vincentdjojo
Copy link
Author

I see thanks for taking your time to respond to the issue. I'll keep this issue open in case I have anymore questions with Bluetooth connection while using the sensors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants