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

[stretch] Left brick button is not working in brickman #957

Closed
ddemidov opened this Issue Sep 10, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@ddemidov
Member

ddemidov commented Sep 10, 2017

I've flashed the latest (snapshot-ev3dev-stretch-ev3-generic-2017-09-09.img.xz) stretch image and noticed that brickman interface ignores the left brick button. This makes things like entering wi-fi password difficult. This is not a hardware issue: when I remove the SD card and boot into the stock system, the button works.

@ddemidov

This comment has been minimized.

Show comment
Hide comment
@ddemidov

ddemidov Sep 10, 2017

Member

I tried to test this from python. I had to apply this patch to ev3dev/ev3.py for the Button class to work at all:

diff --git a/ev3dev/ev3.py b/ev3dev/ev3.py
index 725f713..ca295ed 100644
--- a/ev3dev/ev3.py
+++ b/ev3dev/ev3.py
@@ -165,12 +165,12 @@ class Button(ButtonEVIO):
 
 
     _buttons = {
-            'up': {'name': '/dev/input/by-path/platform-gpio-keys.0-event', 'value': 103},
-            'down': {'name': '/dev/input/by-path/platform-gpio-keys.0-event', 'value': 108},
-            'left': {'name': '/dev/input/by-path/platform-gpio-keys.0-event', 'value': 105},
-            'right': {'name': '/dev/input/by-path/platform-gpio-keys.0-event', 'value': 106},
-            'enter': {'name': '/dev/input/by-path/platform-gpio-keys.0-event', 'value': 28},
-            'backspace': {'name': '/dev/input/by-path/platform-gpio-keys.0-event', 'value': 14},
+            'up': {'name': '/dev/input/by-path/platform-gpio_keys-event', 'value': 103},
+            'down': {'name': '/dev/input/by-path/platform-gpio_keys-event', 'value': 108},
+            'left': {'name': '/dev/input/by-path/platform-gpio_keys-event', 'value': 105},
+            'right': {'name': '/dev/input/by-path/platform-gpio_keys-event', 'value': 106},
+            'enter': {'name': '/dev/input/by-path/platform-gpio_keys-event', 'value': 28},
+            'backspace': {'name': '/dev/input/by-path/platform-gpio_keys-event', 'value': 14},
         }
 
     @property

After that, all buttons except for the 'left' one work as intended. 'Left' button is always reported to be pressed. This script was used:

>>> import ev3dev.ev3 as ev3
>>> b = ev3.Button()
>>> b.left # while not pressing the button
True
>>> b.left # while pressing the button
True
>>> b.right # while not pressing the button
False
>>> b.right # while pressing the button
True
Member

ddemidov commented Sep 10, 2017

I tried to test this from python. I had to apply this patch to ev3dev/ev3.py for the Button class to work at all:

diff --git a/ev3dev/ev3.py b/ev3dev/ev3.py
index 725f713..ca295ed 100644
--- a/ev3dev/ev3.py
+++ b/ev3dev/ev3.py
@@ -165,12 +165,12 @@ class Button(ButtonEVIO):
 
 
     _buttons = {
-            'up': {'name': '/dev/input/by-path/platform-gpio-keys.0-event', 'value': 103},
-            'down': {'name': '/dev/input/by-path/platform-gpio-keys.0-event', 'value': 108},
-            'left': {'name': '/dev/input/by-path/platform-gpio-keys.0-event', 'value': 105},
-            'right': {'name': '/dev/input/by-path/platform-gpio-keys.0-event', 'value': 106},
-            'enter': {'name': '/dev/input/by-path/platform-gpio-keys.0-event', 'value': 28},
-            'backspace': {'name': '/dev/input/by-path/platform-gpio-keys.0-event', 'value': 14},
+            'up': {'name': '/dev/input/by-path/platform-gpio_keys-event', 'value': 103},
+            'down': {'name': '/dev/input/by-path/platform-gpio_keys-event', 'value': 108},
+            'left': {'name': '/dev/input/by-path/platform-gpio_keys-event', 'value': 105},
+            'right': {'name': '/dev/input/by-path/platform-gpio_keys-event', 'value': 106},
+            'enter': {'name': '/dev/input/by-path/platform-gpio_keys-event', 'value': 28},
+            'backspace': {'name': '/dev/input/by-path/platform-gpio_keys-event', 'value': 14},
         }
 
     @property

After that, all buttons except for the 'left' one work as intended. 'Left' button is always reported to be pressed. This script was used:

>>> import ev3dev.ev3 as ev3
>>> b = ev3.Button()
>>> b.left # while not pressing the button
True
>>> b.left # while pressing the button
True
>>> b.right # while not pressing the button
False
>>> b.right # while pressing the button
True

@ddemidov ddemidov referenced this issue Sep 10, 2017

Closed

ev3dev-stretch #339

@dlech dlech added bug kernel labels Sep 10, 2017

@dlech dlech self-assigned this Sep 10, 2017

@dlech dlech added this to the ev3dev-stretch milestone Sep 10, 2017

dlech added a commit to ev3dev/ev3-kernel that referenced this issue Sep 10, 2017

@dwalton76

This comment has been minimized.

Show comment
Hide comment
@dwalton76

dwalton76 Sep 10, 2017

Using @ddemidov patch all of the buttons work for me...I'm not seeing left as stuck. Tested with

robot@ev3alt[ev3dev-lang-python]# cat utils/button.py 
#!/usr/bin/env python3

from ev3dev.auto import Button
import logging
import sys
from time import sleep

# logging
logging.basicConfig(level=logging.INFO,
                    format="%(asctime)s %(levelname)5s: %(message)s")
log = logging.getLogger(__name__)

btn = Button()

while True:
    print("left %s, right %s, up %s, down %s, backspace %s, enter %s" % (btn.left, btn.right, btn.up, btn.down, btn.backspace, btn.enter))
    sleep(1)
robot@ev3alt[ev3dev-lang-python]# 

dwalton76 commented Sep 10, 2017

Using @ddemidov patch all of the buttons work for me...I'm not seeing left as stuck. Tested with

robot@ev3alt[ev3dev-lang-python]# cat utils/button.py 
#!/usr/bin/env python3

from ev3dev.auto import Button
import logging
import sys
from time import sleep

# logging
logging.basicConfig(level=logging.INFO,
                    format="%(asctime)s %(levelname)5s: %(message)s")
log = logging.getLogger(__name__)

btn = Button()

while True:
    print("left %s, right %s, up %s, down %s, backspace %s, enter %s" % (btn.left, btn.right, btn.up, btn.down, btn.backspace, btn.enter))
    sleep(1)
robot@ev3alt[ev3dev-lang-python]# 
@dlech

This comment has been minimized.

Show comment
Hide comment
@dlech

dlech Sep 10, 2017

Member

You probably haven't upgraded your kernel. This bug is a regression in the ev3dev-1.5.0 kernel released yesterday.

Member

dlech commented Sep 10, 2017

You probably haven't upgraded your kernel. This bug is a regression in the ev3dev-1.5.0 kernel released yesterday.

dlech added a commit to ev3dev/ev3-kernel that referenced this issue Sep 14, 2017

@dlech

This comment has been minimized.

Show comment
Hide comment
@dlech

dlech Sep 14, 2017

Member

Fix released in the ev3dev-1.5.1 kernel

Member

dlech commented Sep 14, 2017

Fix released in the ev3dev-1.5.1 kernel

@dlech dlech closed this Sep 14, 2017

dlech added a commit to ev3dev/ev3-kernel that referenced this issue Nov 1, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment