-
Notifications
You must be signed in to change notification settings - Fork 27
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
Problem with GDX-PYR sensor, using example gdx_getting_started_bluetooth.py #62
Comments
Hello, I was able to test this and I see the same error with the Pyranometer. I will try to determine the source of the error tomorrow, and will give you an update. All the best, Sam |
Thank you, I look forward to your response. |
Hello, The sensor on GDX-PYR reads irradiance with units of W/m^2. The firmware for GDX-PYR encodes the string for the units and the godirect python library decodes that string. The issue is that the firmware for GDX-PYR has encoded this string in a different format than our other Go Direct devices. The godirect library is not expecting this, and throws an error when trying to decode the units string. The godirect library will need to be updated to fix this problem. In the meantime, you can go to the godirect library files and replace two files with the files attached. These files have minor changes to the code that handles the decoding. This will fix the issue with GDX-PYR.
Let me know if you have any problems with these instructions, and if you are now able to take readings with GDX-PYR. |
Hello,
When I select the sensor I want to connect to, I get the following error, that happens to me with all the sensors mentioned
List of found devices
attempting to open 1 device(s)... List of sensors for GDX-WTHR 134004B0 BLE -34 I hope you can help me with this other problem |
Hello, I am glad you were able to get the GDX-PYR running on Windows. I do not have a way to test on Raspberry Pi right now. Just to make sure, did you follow the install directions outlined for Linux and Raspberry Pi in the Getting Started document? The Bleak library is used for the Bluetooth communication. Check what version of the Bleak library is installed and compare that to what is the current version. Also, can you confirm that Bluetooth is working on your Raspberry Pi? |
Hi, I installed go direct following exactly the instructions in the guide you sent. The bleak library is updated to the latest version. I attached a list of the packages installed on my raspberry LCT@raspberrypi:~ $ pip list arandr 0.1.11 I also performed tasks to check the Bluetooth for its correct operation and I had no inconvenience with this. I leave information about the operating system I am using PRETTY_NAME="Debian GNU/Linux 12 (bookworm)" I hope you can help me with this |
Hello, I am not sure how much I will be able to help with this specific problem. I am not familiar with all of the nuances of Raspberry Pi. I will see if I can find a system to do some testing, but it will take some time. In the meantime I would suggest that you run the example called godirect-sensor-readout, found in the "example_without_gdx" folder. This example talks directly with the godirect library, without using the gdx module. This will be better for troubleshooting. Do you have any success with USB? |
I have already solved the problem I have, which is that I cannot get the GDX sensor to connect on the first attempt with my raspberry pi using BLE. The problem I have is that the solution is not exact, since what I do is enter a cycle until I manage to make the connection with the sensor. The problem is that since it can connect immediately, it can take 5 minutes or more. I attach a zip folder, where sensor.py is located, which is the main code that I use where the loops are to try to make the connection and also the gsx folder, where in the gdx.py file I made some modifications to be able to find the errors that it sends when the connection is not made with the sensor and to be able to enter a cycle. |
I'm using python 3.9, I've tested the code with other GDX sensors and I can connect without any problem, but when I try to connect the GDX-PYR it gives me this error
C:\Users\kyo_a\Documents\EduardoRamos\ProgramacionPython\LabER-Solar\SensorVernier.venv\Scripts\python.exe C:\Users\kyo_a\Documents\EduardoRamos\ProgramacionPython\LabER-Solar\SensorVernier\main.py
wait for bluetooth initialization...
C:\Users\kyo_a\Documents\EduardoRamos\ProgramacionPython\LabER-Solar\SensorVernier.venv\lib\site-packages\godirect\backend_bleak.py:21: FutureWarning: The discover function will removed in a future version, use BleakScanner.discover instead.
bleak_devices = await discover()
attempting to open 1 device(s)...
C:\Users\kyo_a\Documents\EduardoRamos\ProgramacionPython\LabER-Solar\SensorVernier.venv\lib\site-packages\godirect\backend_bleak.py:28: FutureWarning: BLEDevice.rssi is deprecated and will be removed in a future version of Bleak, use AdvertisementData.rssi instead
device.rssi = d.rssi
open device 0 = True
List of sensors for GDX-PYR 1L100046 BLE -38
Traceback (most recent call last):
File "C:\Users\kyo_a\Documents\EduardoRamos\ProgramacionPython\LabER-Solar\SensorVernier\main.py", line 39, in
gdx.select_sensors()
File "C:\Users\kyo_a\Documents\EduardoRamos\ProgramacionPython\LabER-Solar\SensorVernier\gdx\gdx.py", line 353, in select_sensors
sensors = gdx.devices[i].list_sensors()
File "C:\Users\kyo_a\Documents\EduardoRamos\ProgramacionPython\LabER-Solar\SensorVernier.venv\lib\site-packages\godirect\device.py", line 205, in list_sensors
if not self._GDX_get_sensor_info_all():
File "C:\Users\kyo_a\Documents\EduardoRamos\ProgramacionPython\LabER-Solar\SensorVernier.venv\lib\site-packages\godirect\device.py", line 300, in _GDX_get_sensor_info_all
if not self._GDX_get_sensor_info(i):
File "C:\Users\kyo_a\Documents\EduardoRamos\ProgramacionPython\LabER-Solar\SensorVernier.venv\lib\site-packages\godirect\device.py", line 560, in _GDX_get_sensor_info
sensor = GoDirectSensor(info)
File "C:\Users\kyo_a\Documents\EduardoRamos\ProgramacionPython\LabER-Solar\SensorVernier.venv\lib\site-packages\godirect\sensor.py", line 23, in init
self._sensor_units = sensorUnit.decode("utf-8").replace('\x00','')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb2 in position 3: invalid start byte
Process finished with exit code 1
I'm using python 3.9, I've tested the code with other GDX sensors and I can connect without any problem, but when I try to connect the GDX-PYR it gives me this error
How can I solve this error?
The text was updated successfully, but these errors were encountered: