NOTICE: This forum has been archived (i.e. registration and posting is disabled).

Please go to the new forum at https://forum.kylegabriel.com

AHT10 I2C Digital T...
 
Notifications
Clear all

[Solved] AHT10 I2C Digital Temperature Humidity Measurement Sensor Module


devaka
(@devaka)
Active Member
Joined: 7 months ago
Posts: 6
Topic starter  

Hello, Im was not into programming languages but inspired by Kyles automated hydroponics project and determined to try it out. I have bought AHT10 for the tempedratrature and humidity sensing and have failed to get it working. this is the first I/O device i have connected to mycodo so far. Really appreciate if you can help me set it up. 


Quote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 7 years ago
Posts: 612
 

Is there a Python library available for this sensor?

Mycodo Developer


ReplyQuote
devaka
(@devaka)
Active Member
Joined: 7 months ago
Posts: 6
Topic starter  

@kylegabriel Thanks for your reply. I have found some files in the below two links but im not sure if they could work. Im actually very bad in codes and would appreciate some help from you. 

https://github.com/adafruit/Adafruit_CircuitPython_AHTx0

https://github.com/gejanssen/aht10-python


ReplyQuote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 7 years ago
Posts: 612
 

Save and rename the attached file from txt to py, import it on the Configure -> Custom Inputs page, then add it on the Setup -> Data page, activate, and see if it works. Check the Demon Log if it doesn't and copy any relevant errors.

Mycodo Developer


ReplyQuote
devaka
(@devaka)
Active Member
Joined: 7 months ago
Posts: 6
Topic starter  

@kylegabriel thanks you so much. i have followed your instructions. the library was uploaded and everything was green. but it is not fetching temperature and humidity readings when i go data=>live. the demon error log is as below. Please see how i can fix this. 

2021-02-24 2056,415 - ERROR - mycodo.controllers.controller_input_e9f3cd4e - Error while attempting to read input: 'NoneType' object has no attribute 'next'
Traceback (most recent call last):
  File "/var/mycodo-root/mycodo/controllers/controller_input.py", line 391, in update_measure
    measurements = self.measure_input.next()
AttributeError: 'NoneType' object has no attribute 'next'

ReplyQuote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 7 years ago
Posts: 612
 

This error occurs after the Input has crashed and is of no use in determining the issue. You need to find the Input activation log line and the relevant error will be immediately following it.

Mycodo Developer


ReplyQuote
devaka
(@devaka)
Active Member
Joined: 7 months ago
Posts: 6
Topic starter  

@kylegabriel Thank you so much. and please see the below error log. i hope i have gotten the required parts now. appreciate your kind advice so much. 

 

2021-02-25 2101,166 - INFO - mycodo.daemon - All activated Input controllers started
2021-02-25 2101,167 - INFO - mycodo.daemon - All activated Math controllers started
2021-02-25 2101,168 - INFO - mycodo.daemon - All activated PID controllers started
2021-02-25 2101,168 - INFO - mycodo.daemon - All activated LCD controllers started
2021-02-25 2101,168 - INFO - mycodo.daemon - All activated Custom controllers started
2021-02-25 2101,308 - INFO - mycodo.controllers.controller_widget - Activated in 139.6 ms
2021-02-25 2102,310 - INFO - mycodo.daemon - Mycodo daemon started in 2.989 seconds
2021-02-25 2102,316 - INFO - mycodo.daemon - 39.06 MB RAM in use
2021-02-25 2101,148 - ERROR - mycodo.controllers.controller_input_e9f3cd4e - Error while attempting to read input: 'NoneType' object has no attribute 'next'
Traceback (most recent call last):
  File "/var/mycodo-root/mycodo/controllers/controller_input.py", line 391, in update_measure
    measurements = self.measure_input.next()
AttributeError: 'NoneType' object has no attribute 'next'

ReplyQuote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 7 years ago
Posts: 612
 

No, you are still not including the activation line (and the error that follows it). The activation line says "Input Activated" and will occur before the "All activated Input controllers started" line at the top of what you copied. 

Mycodo Developer


ReplyQuote
devaka
(@devaka)
Active Member
Joined: 7 months ago
Posts: 6
Topic starter  

@kylegabriel Thanks again, I have copied a larger chunk of the error code as below. hope this covered the part we are looking for. I really appreciate your support. 

2021-02-26 0759,933 - ERROR - mycodo.controllers.controller_input_7736837f - initialize_variables() Exception: 'custom_options'
Traceback (most recent call last):
  File "/var/mycodo-root/mycodo/controllers/base_controller.py", line 72, in run
    self.initialize_variables()
  File "/var/mycodo-root/mycodo/controllers/controller_input.py", line 338, in initialize_variables
    self.measure_input = input_loaded.InputModule(self.input_dev)
  File "/home/pi/Mycodo/mycodo/inputs/custom_inputs/ahtx0_circuitpython.py", line 57, in __init__
    INPUT_INFORMATION['custom_options'], input_dev)
KeyError: 'custom_options'
2021-02-26 0759,942 - INFO - mycodo.controllers.controller_input_7736837f - Activated in 315.5 ms
2021-02-26 0759,942 - ERROR - mycodo.controllers.controller_input_7736837f - Error while attempting to read input: 'NoneType' object has no attribute 'next'

ReplyQuote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 7 years ago
Posts: 612
 

v02 to test attached

Mycodo Developer


ReplyQuote
devaka
(@devaka)
Active Member
Joined: 7 months ago
Posts: 6
Topic starter  

@kylegabriel you are awesome. it works perfectly now. let me now move onto other sensors and configurations. Cant thank you enough for the amazing and prompt support. 


ReplyQuote