pi@raspberry:~/solar_tracking_project $ sudo python runner/main.py
2018-11-15 20:34:00,636 - main_app.rtc - INFO - creating an instance of the rtc
2018-11-15 20:34:00,639 - main_app.sys_mon - INFO - creating an instance of the sys_mon
<Adafruit_MCP3008.MCP3008.MCP3008 object at 0xb5c0db30>
2018-11-15 20:34:00,651 - main_app.panel_power - INFO - creating an instance of the panel_power
2018-11-15 20:34:00,656 - main_app.battery_power - INFO - creating an instance of the battery_power
Traceback (most recent call last):
File "runner/main.py", line 166, in <module>
adc_object = adc
TypeError: 'module' object is not callable
I have dug around a bit and after checking this in the sun_sensor package, I do not see the same issues.
When instantiating the adc in main.py like so:
https://github.com/GlenNicholls/solar_tracking_project/blob/a6b06f27422e76f25a4b74cffd05f2398193b8c8/runner/main.py#L11
https://github.com/GlenNicholls/solar_tracking_project/blob/a6b06f27422e76f25a4b74cffd05f2398193b8c8/runner/main.py#L113-L117
It only fails here:
https://github.com/GlenNicholls/solar_tracking_project/blob/a6b06f27422e76f25a4b74cffd05f2398193b8c8/runner/main.py#L156-L167
but works fine for the previous instantiation:
https://github.com/GlenNicholls/solar_tracking_project/blob/a6b06f27422e76f25a4b74cffd05f2398193b8c8/runner/main.py#L136
https://github.com/GlenNicholls/solar_tracking_project/blob/a6b06f27422e76f25a4b74cffd05f2398193b8c8/runner/main.py#L149
This is the log:
I have dug around a bit and after checking this in the sun_sensor package, I do not see the same issues.