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

Fix issue on logging #26

Merged
merged 22 commits into from
Apr 9, 2021
Merged

Fix issue on logging #26

merged 22 commits into from
Apr 9, 2021

Conversation

yeyeto2788
Copy link
Contributor

@yeyeto2788 yeyeto2788 commented Mar 16, 2021

Initially was a dirty fix for the logging issue. Please refer to PR #18

Now I added more lint fixes and also get rid of the check with regex for pin validation and leave it for blinka to validate pin being used.

Add latest changes to the feature branch
Make a default attribute as a standalone logger.
Error when logging to the console.
@yeyeto2788
Copy link
Contributor Author

I pulled your changes into my fork so you don't have too much problems to merge my changes.

I noticed I did not get any readings from the DHT sensor 🤒

███╗   ███╗██╗   ██╗██████╗ ██████╗ ██╗
████╗ ████║██║   ██║██╔══██╗██╔══██╗██║
██╔████╔██║██║   ██║██║  ██║██████╔╝██║
██║╚██╔╝██║██║   ██║██║  ██║██╔═══╝ ██║
██║ ╚═╝ ██║╚██████╔╝██████╔╝██║     ██║
╚═╝     ╚═╝ ╚═════╝ ╚═════╝ ╚═╝     ╚═╝
____________________________________________________________

Eric Davisson @MudPiApp
https://mudpi.app
Version:  0.10.0

Loading MudPi Configs ............................... Complete
DEBUG MODE ENABLED
Config path: /home/yeyeto2788/workspace/mudpi-core/mudpi.json
Current Directory: /home/yeyeto2788/workspace/mudpi-core
Initializing Logger  ................................ Complete
Preparing State Manager  ............................ Complete
Preparing Event System for redis  ................... Pending
Event System Ready on redis   ....................... Connected
Initializing Core  .................................. Complete
_________________ Detecting Configurations _________________
Detecting Configurations ............................ Pending
Detected 1 Non-Core Configurations .................. Complete
Preparing 1 Configurations to be Loaded  ............ Pending
Sensor Ready for Import ............................. Ready
1 Configurations Ready to Load  ..................... Complete
_____________________ Load Extensions ______________________
Loading 1 Configurations into Extensions  ........... Pending
Loading: sensor
Importing Sensor .................................... Pending
Imported Sensor ..................................... Success
Dht Ready for Import ................................ Ready
Dht requirements .................................... Installing
Installing package adafruit-circuitpython-dht==3.5.5
Importing dht:sensor ................................ Pending
Imported dht:sensor ................................. Success
Configuration for dht:sensor ........................ Validated
Example Ready for Import ............................ Ready
Importing example:sensor ............................ Pending
Imported example:sensor ............................. Success
Configuration for example:sensor .................... Validated
Sensor Configuration ................................ Validated
Initializing Sensor ................................. Pending
Importing Dht ....................................... Pending
Imported Dht ........................................ Success
Dht Configuration ................................... Validated
Extension dht did not define an `init()` method.
Initializing Dht .................................... Pending
Initialized Dht ..................................... Success
can't set attribute
Loaded 1 Extensions  ................................ Complete
MudPi Fully Loaded .................................. Complete
______________________ Start Systems _______________________
Starting All Workers  ............................... Pending
Started All Workers  ................................ Complete
MudPi Systems   ..................................... Online
____________________________________________________________

MUDPI LOADED EXTENSIONS
Namespace: dht
Provides interface for DHT sensors to take climate readings.
https://mudpi.app/docs/pi-sensors-humidity
MUDPI DISABLED EXTENSIONS
MUDPI REGISTERED ACTIONS
ACTION CALL                                        ACTION
--------------------------------------------------------------------------------
mudpi.turn_on                                    | turn_on
mudpi.turn_off                                   | turn_off
mudpi.shutdown                                   | shutdown
____________________________________________________________
^C____________________________________________________________
Stopping All Workers for Shutdown   ................. Pending
All MudPi Systems   ................................. Offline

@yeyeto2788
Copy link
Contributor Author

Hey @olixr,

Want me to keep updating this PR? Shouldn't we merge it?

@olixr
Copy link
Member

olixr commented Mar 28, 2021

Yes I plan to merge this in, I got busy with fixes and testing. So most of the items are working well but like you I also had issues with the DHT on some of my boards.

I read this tonight: adafruit/Adafruit_CircuitPython_DHT#33 and it looks like many others are having issues with this on older boards. Not sure what changed in the library but might need to consider older version for better response on some boards.

Also I ran into some ARMv6 vs ARMv7 support finally. After about 10+ corrupted kernels and flashes on the Pi zero I figured out some libraries were not working. We may need to utilize this check to also do something about the DHT.

For now perhaps increasing the read_attempts config to a larger number may force it to read with the cost of more time.

@yeyeto2788
Copy link
Contributor Author

Hey @olixr I had some similar issues with the sensor and that's why I reported it here and I also made a PR with this script which let's you change the default timing for the sensor and get better readings.

I would suggest to increase the read attempt but no more than 5 since that would be depending on the sensor up to 10 secs if we wait 2 seconds per read which in my opinion is not that cool to wait. I would also suggest (even add a note on the docs) to rely on a different sensor using another protocol like I2C/SPI or even use the same sensor with nanpy 😄

@yeyeto2788 yeyeto2788 mentioned this pull request Apr 8, 2021
@olixr olixr merged commit b0e1d93 into mudpi:feature Apr 9, 2021
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

Successfully merging this pull request may close these issues.

2 participants