-
Notifications
You must be signed in to change notification settings - Fork 54
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
Added rpi plugin for controlling components/sensors #93
Conversation
- create rpi plugin which only appears when running on Raspberry Pi - add support for - digital input & output - all kinds of buttons - HCSR04 Distance sensor - all types of OLED displays - some additional blocks (high, low, delay) for side - add all the dependencies for them
You're adding about 487 files. I looked briefly and saw a few licenses. Your commit message doesn't mention if you considered licensing. Could you improve that? Also, you are adding a lot of Python modules deep inside the app. These won't be updated automatically, and will rapidly age. The Adafruit modules in particular change quite freequently. |
Yes, they all have an MIT License, forgot to mention. My bad 👍🏻
I thought about that but if you look at electronics, the sensors and modules don't change at all if I may say that. There are electronic components from 15-20 years ago still being used in large scales. The models change (that too rarely) and we will have to include support for them anyway, but if it works now then it will work forever for that model. I don't have much experience with bundling libraries. So what I did was download the required prebuilt modules from pypi.org and put them in Apart from the This is the structure:
Thanks |
Adding a part to the readme that states how to install the packages is a good solution because this is a fructose activity and bundling it with dependencies means the size of Sugar increases in our downstream, and these dependencies are only needed when using sensors on RPi. |
Downstream packaging, such as flatpak, snap, or debian, can handle the dependencies automatically, we just have to make sure they are discoverable by those packaging processes. Having the plugin report missing dependency would be nice, rather than just failing to proceed. |
Sorry, I was a little caught up with my exams. Can you check this commit please before I create a PR? Let me know if you find any poor implementations. Sorry for the trouble. Thanks ^^
@chimosky Thanks! The size is now ~100KB, without the dependencies
@quozl Thanks for letting me know about it. I don't have experience in any of those. Should I look into it? @walterbender Let me know if this is alright sir. Thanks |
Reviewed 7da12b1
Hope that helps. |
(Also, although Raspberry Pi OS includes distribution packages for use of snap and flatpak, it doesn't have packages for Turtle Art, in turn because Debian does not. I was making derivative debian packages between 2016 and 2017, with a package name of turtleblocks. It was dropped in April 2020 because the work needed to fix it exceeded the time available before a release.) |
@quozl Thanks for reviewing ^^
I didn't know about this. Thanks, I'll format it
I added the dependencies in readme. However, the dependencies list grows with every addition of sensors, so isn't the req.txt file enough?
I believe it's better to install it globally since other activities too, in the future, will be using the same dependencies.
I don't know what probing is. If I understand you correctly, it is a test tool that checks for missing dependencies and installs them? Won't that install dependencies for non-Rpi devices too? Again, thanks for taking out time to review |
I updated the Readme (relative image links and dependencies) and formatted everything according to pep8. Let's continue here #94 |
Do let me know if there is something to improve or add.
Also, I added to the system path to import local libraries (see here). Relative imports were somewhat troubling me and also it was feeling bulky to rewrite the path every time. But anyway, I may be wrong. Let me know if I can improve it.
Thanks