speedyg0nz / MagInkCal

E-Ink Magic Calendar that automatically syncs to Google Calendar and runs off a battery powered Raspberry Pi Zero
Apache License 2.0
3.08k stars 105 forks source link

Error 'NoneType' object has no attribute 'DEV_ModuleInit' #13

Closed popere closed 2 years ago

popere commented 2 years ago

Hello, firstly thank you very much about your work on this project!! I think it is a great project ;)

My problem starts when it starts the phase of drawing in the ink waveshare 7.5 inches b, the logs I see are these:

pi@raspberrypi:~/MagInkCal $ python3 maginkcal.py 
/usr/lib/python3/dist-packages/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.26.7) or chardet (3.0.4) doesn't match a supported version!
  RequestsDependencyWarning)
Starting daily calendar update
Invalid time sync command
Invalid battery output
Battery level at start: -1.000
Time synchronised to 2021-11-26 08:28:24.184037+01:00
Retrieving events between 2021-11-22T00:00:00+01:00 and 2021-12-26T23:59:59.999999+01:00...
Calendar events retrieved in 0:00:00.630859
Screenshot captured and saved to file.
Image colours processed. Extracted grayscale and red images.
EPD init...
'NoneType' object has no attribute 'DEV_ModuleInit'
Completed daily calendar update
Checking if configured to shutdown safely - Current hour: 8

As you can see, I think the problem is on third to last line:

'NoneType' object has no attribute 'DEV_ModuleInit'

I inspect a little bit your code and the error occurs in the line 115 of epdconfig.py file : spi.DEV_ModuleInit

I have searched on internet and this line should initialize the SPI module, but it does not work.

I have followed your README.md 2 or 3 times to try to see what I could have missed and I am not able to resolve my problem by myself :(

On the other way I have used the example python code from waveshare and it works correctly: epd_7in5b_V2_test.py

@speedyg0nz: Could you help me solving this problem to run your project?

By the way, I am using a Raspberry pi 4b and the SPI is enabled in my Raspberry pi 4b

An other thing very curios that happens is:

popere commented 2 years ago

I have resolved it in my fork from this repository.