You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was observed when running tests with automation on the Mina application:
There is not enough time for speculos to receive general status and display packets end up being appended one after the other:
In the following log you can observe that after the approval flow triggered by an apdu, we go back to the idle flow of the app which is the home screen but another apdu is received before the idle flow could be displayed and the idle flow and approval flow of the following apdu ends up being concatenated by the Nanox OCR part of the code
15:52:33.846:automation: getting actions for "Mina" (51, 28)
15:52:33.846:automation: getting actions for "is readyGetAddress" (44, 42)
It looks like speculos is on heavy load at this time because all the missed general status are received a few milliseconds after this (but too late)
Would there be any way to add some synchronization so that we don't perform new button events as long as all the display status of the current screen have not been received and ended by a general status ?
Or be able to detect the display status used to draw a rectangle to prepare for the next screen and consider all the display packets after that as a new text event ?
The text was updated successfully, but these errors were encountered:
jspada
pushed a commit
to jspada/ledger-app-mina
that referenced
this issue
Aug 4, 2021
diff --git a/speculos/mcu/nanox_ocr.py b/speculos/mcu/nanox_ocr.py
index 423e5d7..b08f110 100644
--- a/speculos/mcu/nanox_ocr.py+++ b/speculos/mcu/nanox_ocr.py@@ -132,6 +132,7 @@ def find_char_from_bitmap(bitmap: BitMap):
class NanoXOCR:
def __init__(self):
self.events = []
+ self.new_event = False
def analyze_bitmap(self, data: bytes):
if data[0] != 0:
@@ -145,11 +146,15 @@ class NanoXOCR:
char = find_char_from_bitmap(bitmap)
if char:
- if self.events and y <= self.events[-1].y:+ if not self.new_event and self.events and y == self.events[-1].y:
self.events[-1].text += char
else:
# create a new TextEvent if there are no events yet or if there is a new line
self.events.append(TextEvent(char, x, y))
+ self.new_event = False+ else:+ # if a bitmap which isn't a character was displayed, assume that the string is terminated+ self.new_event = True
def get_events(self) -> List[TextEvent]:
events = self.events.copy()
This was observed when running tests with automation on the Mina application:
There is not enough time for speculos to receive
general status
and display packets end up being appended one after the other:In the following log you can observe that after the approval flow triggered by an apdu, we go back to the idle flow of the app which is the home screen but another apdu is received before the idle flow could be displayed and the idle flow and approval flow of the following apdu ends up being concatenated by the Nanox OCR part of the code
seph_automation.log
It looks like speculos is on heavy load at this time because all the missed general status are received a few milliseconds after this (but too late)
Would there be any way to add some synchronization so that we don't perform new button events as long as all the display status of the current screen have not been received and ended by a general status ?
Or be able to detect the display status used to draw a rectangle to prepare for the next screen and consider all the display packets after that as a new text event ?
The text was updated successfully, but these errors were encountered: