-
Notifications
You must be signed in to change notification settings - Fork 190
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
hotfix - line follower kernel issue #273
hotfix - line follower kernel issue #273
Conversation
…dequate shebangs
This reverts commit 46be676.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One suggestion (clone the repo) and one request (documment the issue just a little more in the changed code so that we're kind to our future selves trying to remember what the issue was in the first place).
import time | ||
import math | ||
import RPi.GPIO as GPIO | ||
import struct | ||
import operator | ||
import pickle | ||
import numpy | ||
from periphery import I2C, I2CError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small request here. Can you put a comment explaining why we switched to this, and put a link into this PR since you wrote a detailed explanation about what you found (#273) and maybe also link to the original firmware bug report (raspberrypi/firmware#828) so if we ever have to pick this issue apart again, we have this info a little more readily accessible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Setup/install.sh
Outdated
sudo pip3 install -U RPi.GPIO | ||
sudo pip3 install pyusb | ||
sudo pip3 install numpy | ||
sudo pip3 install python-periphery |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An Idea: clone this repo to the DexterInd account. Check on changes once per quarter. This way, changes in the python-periphery library won't suddenly break things for us, forcing us to scramble and fix them.
Just an idea, not a requirement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're doing the fixed-version thing instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! From my end this is a go. Go!
@@ -81,6 +81,12 @@ install_dependencies() { | |||
sudo pip install -U RPi.GPIO | |||
sudo pip install pyusb | |||
sudo pip install numpy | |||
sudo pip install python-periphery==1.1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NICE!
# PR : https://github.com/DexterInd/GoPiGo/pull/273 | ||
|
||
|
||
debug = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NICE. Thank you very much @RobertLucian !
Software/Python/requirements.txt
Outdated
@@ -1 +1,2 @@ | |||
future | |||
quick2wire-api |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is quick2wire still required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope. Good catch. This is just a left-over. I'm deleting it.
Ready to merge? |
I'm testing it as of this moment on DexterOS just to be sure nothing gets messed up. If everything looks good, then I'm going to merge it. |
@CleoQc @johnisanerd tested it on DexterOS and the line follower sensor works with the new library. I've verified the functionality both in the terminal (by importing the sensor and calling the function) and by going in Bloxter and selecting the line follower sensor. |
This solves this issue: RobertLucian#8.
The initial report made by John is here: raspberrypi/firmware#828 (comment)
Explanation
Also, the alternative package that was used for interfacing with the line follower sensor is only supported in Python 3, which means that if someone wants to read data from it, the modules have to be imported in Python 3.
At the moment, I haven't removed the support for Python2, so anything that uses the line follower sensor in Python 2 (aka Scratch or GoPiGo3) won't work. Therefore, this PR needs further modifications before it's merged.
The only single way of keeping Python 2 around is to delve into this issue with the I2C and create a library for it in C++. Then some python bindings would be required in order to make the library importable in python and there goes the time. I find this solution to be best of them all, but it takes time and I don't think it's justifiable to do this just so we can keep Python 2 around.
So, I suggest that we move forward with Python 3. In order to do this, we would need to do the following:
feature
instead of ahotfix
and make it PR to the develop branch - the reason is that this is starting to look like a big mod to me and things may go haywire with the master branch.Also, to me, I find it peculiar that a sensor which is used on the GoPiGo3 is kept on the GoPiGo repo - I think this has to change as it makes the GoPiGo3 (and thus DexterOS) completely dependent on the GoPiGo repo and this causes us quite some delays because now lots of things have to change - by the way, this is similar to what we have with the distance sensor @CleoQc .
Testing Hotfix
In order to test the hotfix, follow the instructions:
sudo rpi-update 5d03351413d4021cc3feeb04459eea98bcb731c0
- this will update to versionv.4.9.53-v7
./Setup/
folder.Also, here's a chart with the tests I have run for the GrovePi and the line follower sensor. It looks like the GrovePi works in all cases, which is great, but the line follower sensor doesn't.
TL;DR
Can't hotfix kernel issue without pushing for Python 3 and "independence" of the software product. But even so, you should test it just as it is right now.
Update
@johnisanerd , @CleoQc the python scripts now use the
python-periphery
package as a tool for interfacing with the line follower sensor. I have tested it with the latest kernel version and with Python 2 and Python 3 and it works.Merge Requirements
python-periphery
package for interfacing with the line follower sensor.