kizniche / Mycodo

An environmental monitoring and regulation system
http://kylegabriel.com/projects/
GNU General Public License v3.0
2.98k stars 497 forks source link

part of mcp342x using python2 syntax? #1122

Closed nccappello closed 2 years ago

nccappello commented 2 years ago

Describe the problem/bug

mcp342x (analog input) input does not populate values

mycodo.log contains the following: ERROR - mycodo.inputs.mcp342x_ab51a19d - InputModule raised an exception when taking a reading: 'dict' object has no attribute 'iteritems'

Versions:

Reproducibility

Please list specific setup details that are involved and the steps to reproduce the behavior:

  1. add input
  2. activate input

Expected behavior

values should populate (ADS1115_CP is similar in that it's a 4ch ADC which works, SHT4X populates values without issue as well)

Screenshots

N/A

Additional context

new to this software, may be missing something. Can't determine where 'iteritems' is called.. searched through scripts within the home/pi/Mycodo folder with no hits

kizniche commented 2 years ago

I can't find iteritems() anywhere in the library that's used (python-MCP342x).

nccappello commented 2 years ago

I added a traceback to the mycodo/inputs/base_input.py file where the error message originated and it lead me to /var/mycodo-root/env/lib/python3.7/site-packages/MCP342x/init.py - I changed the syntax in this file and the sensor works fine. I will push the changes in the next few days after I wrap up a few other things.

kizniche commented 2 years ago

What do you mean you'll push the changes? What you changed is a file of the MCP342x library, not Mycodo.