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

error on Begin/Clear Calibration with Atlas PH ( I2C Mode ) #425

Closed
studi0z opened this issue Mar 14, 2018 · 20 comments
Closed

error on Begin/Clear Calibration with Atlas PH ( I2C Mode ) #425

studi0z opened this issue Mar 14, 2018 · 20 comments

Comments

@studi0z
Copy link

studi0z commented Mar 14, 2018

Error 500: Internal Server Error
Something bad happened but it's probably not your fault. Letting the developers know about these issues is crucial to supporting Mycodo. Please submit a new issue on GitHub with the following error traceback (copy the entire traceback):

Error (Full Traceback):

Traceback (most recent call last):
  File "/home/pi/Mycodo/env/lib/python3.5/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/pi/Mycodo/env/lib/python3.5/site-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/pi/Mycodo/env/lib/python3.5/site-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/pi/Mycodo/env/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/home/pi/Mycodo/env/lib/python3.5/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/pi/Mycodo/env/lib/python3.5/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/pi/Mycodo/env/lib/python3.5/site-packages/flask_login/utils.py", line 261, in decorated_view
    return func(*args, **kwargs)
  File "/home/pi/Mycodo/mycodo/mycodo_flask/routes_calibration.py", line 122, in calibration_atlas_ph
    selected_input, 'temperature', temp, 'continuous', 1)
  File "/home/pi/Mycodo/mycodo/mycodo_flask/routes_calibration.py", line 208, in dual_commands_to_sensor
    atlas_command = AtlasScientificCommand(input_sel)
  File "/home/pi/Mycodo/mycodo/utils/calibration.py", line 27, in __init__
    i2c_address=sensor_sel.i2c_address,
AttributeError: 'Input' object has no attribute 'i2c_address'
@kizniche
Copy link
Owner

Thanks for the bug report. I'll push a fix later today and make a release for you to upgrade and try the new code.

@studi0z
Copy link
Author

studi0z commented Mar 14, 2018

thx for fast reply !!! and thanks for sharing this great project !!

@kizniche
Copy link
Owner

What version Mycodo?

@studi0z
Copy link
Author

studi0z commented Mar 15, 2018

Mycodo Version: 5.6.4
Python Version: 3.5.3

@studi0z
Copy link
Author

studi0z commented Mar 15, 2018

got a little error on status bar but worked !!!! huge thx

Success: Calibration: high (10.0 pH): ('error', OSError(121, 'Remote I/O error'))
Success: Command: end: ('error', OSError(121, 'Remote I/O error'))
5. Calibration: pH: Atlas Scientific (I2C) 4 ( Atlas pH (I2C)): Calibration Succeeded

Calibration Complete

@kizniche
Copy link
Owner

Did that error only appear at the last part?

@studi0z
Copy link
Author

studi0z commented Mar 15, 2018

no it also appeared while i was calibrating with the solutions

@kizniche
Copy link
Owner

If that's the case, I don't think calibration was successful. Can you verify it's actually been calibrated?

@kizniche
Copy link
Owner

kizniche commented Mar 15, 2018

I think I may have a fix. Can you change this:

self.ph_sensor_i2c = AtlasScientificI2C(
i2c_address=sensor_sel.location,
i2c_bus=sensor_sel.i2c_bus)

to this:

            self.ph_sensor_i2c = AtlasScientificI2C(
                i2c_address=int(str(sensor_sel.location), 16),
                i2c_bus=sensor_sel.i2c_bus)

save, then restart the frontend with sudo service mycodoflask restart

then reload the page and try calibration again. That should fix the IO errors and allow calibration to work. If not, can you paste the new error?

@studi0z
Copy link
Author

studi0z commented Mar 15, 2018

it is calibrated , i verified with the ph4/7/10 solutions . i also have a 2nd PH probe to verify .

@kizniche
Copy link
Owner

The error you showed indicates the calibration command was never sent to the board. Did you see lights flashing on th board to indicate communication?

@kizniche
Copy link
Owner

Did you clear the calibration before attempting the calibration?

@studi0z
Copy link
Author

studi0z commented Mar 15, 2018

no , but my Atlas probe is brand new and wasn't calibrated when i first plugged
i worked for sure , time to order the dripper from Atlas now , is it compatible to Mycodo ?

@kizniche
Copy link
Owner

I'm skeptical your calibration was successful. If you can confirm the above code change causes no errors, then the fix will have allowed the calibration commands to be communicated with the pH circuit. If the errors go away, then it most likely means the initial calibration with the errors did not work.

Did you test the probe before calibration to determine if the calibration was successful? If not, there's not a good way to know if the calibration procedure worked or not. You will have to trust me that the error being returned indicates there were no commands successfully reaching the pH circuit.

@studi0z
Copy link
Author

studi0z commented Mar 15, 2018

image

@kizniche
Copy link
Owner

Does that indicate it's been calibrated? I don't think it does.

@kizniche
Copy link
Owner

I would actually think the pH would read nearly exactly 10 if it were properly calibrated.

@kizniche
Copy link
Owner

I have to go to sleep. If you make the above code edit and restart the frontend and retry the calibration, let me know if the errors have been resolved.

@kizniche
Copy link
Owner

Just thought of something... Did you see the actual pH returned on the page during the calibration? There should have been a pH displayed next to the countdown clock, slowing your measured pH. If there wasn't a live updated pH measurement displayed, then it also suggests the calibration wouldn't work as well.

@kizniche
Copy link
Owner

After reviewing the code again after a good night's sleep, I've strengthened my position that none of the calibration procedure was working. I believe my fix is the solution to the issue. Your measurement in a pH 10 solution strengthens the argument because of your inaccurate measurement following calibration. Let me know if you're willing to test the code change, otherwise I'm going to implement it in the next software release, as the change brings the calibration code to the same operation as the measurement code (why measurements worked and calibration didn't).

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