-
Notifications
You must be signed in to change notification settings - Fork 67
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
I'm getting Illegal instruction when running python3 screen-calendar-get.py #29
Comments
Tried again using a different google account. Same issue. |
I am getting the same error for outlook_util.py |
Yes I think once you start getting "illegal instruction" you'll start getting it everywhere. There's something in the new Raspberry Pi OS that causes this to happen and then it happens everywhere. I've only been able to reproduce this once, just once, and during that I couldn't even run "pip --version" I was still getting that error. What did you use to write the image to SD card? In this thread there seems to be better success using the Raspberry Pi Imager? #27 (comment) Although, that itself should make no difference but worth trying? |
I did use the pi imager, and the demo python scripts work from waveshare (python not python3). Do I really need to start over, or can you think of a way through it? Also, I would like to contribute the fact that I am using this project on a smaller screen, and it works just great. I simply changed the driver call to use the appropriate driver for my screen size, and the size of image that it creates when the script is run. Could be an option you add for those using different screen sizes. |
Only thing comes to mind is troubleshooting. Are you any good with I think the last time I got the error I was getting it just doing If you are gdb familiar (I'm not very) you can try
And then when it failed I think I used the So the other thing to try could be to create a virtual environment in the waveshare folder and do the package installations there. But that will depend if your pip is still working. |
No, not good at any of this. Just learning really. I did try; python3 -m pip install Pillow And it worked just fine. |
I was also able to run 'python3 utility.py' Screen-weather-get.py works as well. (Using: python3 screen-weather-get.py) |
I can try tonight after work - reflash an SD card until I get the problem. Then find a way around. My difficulty is I'm not getting a problem frequently enough or knowing what's gone wrong - we're just installing normal Python packages - so it's hard to find that workaround or root cause. OK if you're not familiar with gdb/venv. If you have time and willing, you can also try narrowing down something. Try to uninstall the python packages then reinstalling them. This is what the instructions said:
I'd suggest uninstalling the last few. Do a Then try running the screen-calendar-get. Hopefully it gives an error other than illegal instruction. Then one by one, reinstall the packages and run |
Finally! It took 7 tries and I finally got the error. Each time I reflashed the card, followed the README instructions exactly, but the code always worked. On the 7th try I got an 'illegal instruction' and I think I have the solution and cause. First, the solutionThe simplest way to recreate the error is
You should see "Illegal instruction" @mrdanjohnson the solution is to downgrade the cryptography package:
This should remove the current 36.0.1 version you have, and put 36.0.0 in its place. Now run the test command again.
You should see no output. That means it works, and the rest of the application should work too. You should be able to do the normal screen-calendar-get.py run. ObservationsSome of the packages involved require the pip During pip install this wheel gets downloaded
I tried to run a gdb of the test command. It pointed at a problem in
I then did some guesswork and tried downgrading to version 36.0.0 and the code started working. I had a look at the cryptography package's changelog and and the only change is that this 36.0.1 has been compiled with a new version of openssl. I don't know what that means for us. I think I should probably raise an issue in the cryptography Github repo but it's a bit intimidating 😝 Edit: I raised an issue : piwheels/packages#273 |
This could be useful. Which waveshare screen are you using. Can you show what you added to the display.py. Maybe I could add some environment variable and point it at the right driver version. |
It seems that it's not until the google-python-client is installed that I get that error. I did what you suggested. Uninstalled that group, and generally got a different error until I added that client. |
Wait a second. But the script to get outlook is doing the same thing... So it can't be the google api. Does that help? When I run ./run.sh everything else works just fine. |
Did you:
|
I think that worked! Thanks so much! What would cause it to randomly load the wrong cryptography? |
I did a bit of investigation in my long comment above, but best I can tell is that screen-calendar-get references msal package, msal references cryptography package. The cryptography library that Raspberry Pi uses is provided by a group called PiWheels. I think their version 36.0.1 may have been compiled just 4 days ago so it might be related - perhaps it was built against the wrong architecture? I'm not sure. But I've raised an issue there anyway. |
Seems to be working great now. Before I close this, could I run something by you? Because my screen is smaller, I was always able to resize the output using the settings in run.sh. For some reason, when I change them now, it draws a full black screen. Did something change in your recent update that would effect that? Also, do you know of a graphical editor for the SVG file? Because of the size of my panel and the way the panel refreshes, I would like to remove the time, and move the date to the left. Thanks so much for your time on my issue, and for maintaining your project. I really enjoy it. Dan |
Sure, I can give you a few things to try to troubleshoot. Regarding recent changes that will depend on the last time you ran the setup. I've got a Changelog if you know when you last did a setup. The most recent change has been to use 'cairosvg' instead of 'inkscape' to convert the SVG to PNG. Nothing has changed in the code to display the image on screen itself. What you could do is try to verify the image that's generated. In the waveshare directory you will see a file called You've also mentioned that you change the driver path in the You can even try copying over some sample image to the Pi and use display.py to draw it on screen. What you're doing is trying to figure out which thing could be the problem - driver, screen, or generated image. So to edit the SVG, I think Inkscape is the most popular one, you can try that, though I've personally not used it much. For most of my editing I've found the fastest, simplest way is to edit the Based on what you've described. Removing time is a matter of finding |
It's been a while I'll assume everything is OK now, so I'm going to close this issue. We can reopen it if there are still problems. |
This is my second time setting up this project. Had the previous one working fine, but this time, after importing the credentials.json file, I get "Illegal instruction" when running 'python3 screen-calendar-get.py.
note: the json file I downloaded from google was not called credentials.json but a name that started with "client_secret_..." Contents of the file look like this;
{"installed":{"client_id":"17292850-eqmq8jnabvtnvruc0ee.apps.googleusercontent.com","project_id":"flash-clover-337523","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_secret":"GX-iwNEA_k-CS7c17MV","redirect_uris":["urn:ietf:wg:oauth:2.0:oob","http://localhost"]}}
I removed characters in the secret vars before posting.
Thanks
The text was updated successfully, but these errors were encountered: