-
Notifications
You must be signed in to change notification settings - Fork 2
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
Can't convert int to string #1
Comments
Line 40ish |
hello @Sfrjoshpro it relates to the SDI12 address used. Instead of integer address, use it as string (e.x. "0") Indeed this needs to be made more flexible. |
Yea this is a basic issue i tried hard coding the value and it just |
I'll give ThAt a shot and report back |
If I pass a int tho it cause it to lock up and I have to reflash. |
First of all, sharing screenshots is not a very effient way to help you with code bugs. always prefer copy/pasting code in your response. Also try to write one answer each time (not multiple responses) as they are harder to track. Any way, the code you should run is: from microsdi12 import SDI12
sdi12 = None
try:
sdi12 = SDI12(16, 17, None, 2) # Pins are integers
manufacturer = None
model = None
sensor_response = None
address = "3" # Addresse are strings
if sdi12.is_active(address):
manufacturer, model = sdi12.get_sensor_info(address)
response_array = sdi12.get_measurement(address)
print(response_array)
except Exception as e:
print("Exception while reading SDI-12 data")
finally:
if sdi12:
sdi12.close() Regading the "device locking" that you mention, most likely the device that you are using is already using the UART 1 for something else. Thus, when initializing the SDI12 with UART ID 1, the device looses control. This is why i have initialized the SDI12 object with UART ID 2 at the end. |
Thanks and my apologies I'm new to most this GitHub stuff. I'll give that a shot thanks |
Closing due to inactivity. If the issue still exists, reopen. |
In _send self.p_tx pin(self.pin_txd
Seems to give me this error. Been trying everything. Not sure. Can copy and paste all your code and nothing
The text was updated successfully, but these errors were encountered: