Python Forum
Pydroid3 app crashes on xiaomi poco F3
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pydroid3 app crashes on xiaomi poco F3
#1
Hi everyone,
I am a new member as of today.
I am developing a prototype application for remote control. It has the following architecture:
On my smartphone, the TouchOSC commercial application provides me with a GUI, and communicates with the world using UDP frames on TCP/IP.
I have written an application on Pydroid3 that
- exchanges UDP frames back and forth with TouchOSC (using localhost);
- exchanges UDP frames back and forth with a remote system (using wifi);
- translates the data between the two above to have the data properly displayed and to send to the remote system the appropriate commands, as a result of the user's actions on the touchscreen.

TouchOSC must run on the foreground, so I have written the python app so that a thread runs an endless loop that collects the received messages from TouchOSC and the external system, translates them, and send the result to TouchOSC and the external system.
All of this is actually straightforward.
The application works well, except that after about one minute the communication is broken.
On starting the python app, the terminal window shows:
starting the app
started

and if an exception occurred during execution it would stop with :
Error: end of execution
This text remains visible each time I pull the terminal window back to the foreground.
However, when the operation stops, an I bring the terminal window back to the foreground, the text above is erased and replaced with "/ $ ".
If I press the left arrow at the top of the screen, I return to the editor normally, and from there I can normally restart the execution, which will stop again after one minute.
I eventually could run the app in the foreground and have it fail. It then showed the following error message :
Error:
Exception in thread Thread-1: Traceback (most recent call last): File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/threading.py, line 973, in_bootstrap_inner self.run() File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/threading.py, line 910, in run self._target(*self._args, **self._kwargs) File "<string>", line 139, in gere_trafic PermissionError: [Errno 1] Operation not permitted
In function gere_trafic(), line 139, there is:
                self.efface_commandes_fugitives()
the code of the called function is:
def efface_commandes_fugitives(self):
    self.donnees_sortie_envoyees[BOUTON_VIRTUEL] = BT_AUCUN
    self.donnees_sortie_envoyees[RAZ_GYRO] = 0
    self.donnees_sortie_envoyees[COMMANDE_GROUPE] = GROUPE_REPOS
    
    # Effacement de la demande de changement de mode de commande quand le changement est obtenu
    if self.donnees_sortie_envoyees[DEMANDE_CONTROLE] != DC_ACQUITTE:
        if (self.mode_connexion == MC_SANS_FIL) and (self.donnees_sortie_envoyees[DEMANDE_CONTROLE] == DC_CONNECTER):
            self.donnees_sortie_envoyees[DEMANDE_CONTROLE] = DC_ACQUITTE
        elif (self.mode_connexion != MC_SANS_FIL) and (self.donnees_sortie_envoyees[DEMANDE_CONTROLE] == DC_DECONNECTER):
            self.donnees_sortie_envoyees[DEMANDE_CONTROLE] = DC_ACQUITTE
I do not see what can cause the exception in the code above. Any idea, someone? Thanks!
Yoriz write Nov-24-2022, 06:15 PM:
Please post all code, output and errors (in their entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Reply
#2
Thanks Yoriz, I have read the BBC document. I will comply from now on!
Reply
#3
It looks like the problem resides in my Xiaomi smartphone. I tried the Python application on a Nexus tablet, and it just runs fine. I was suspecting a bug of my own, but apparently Pydroid3 is not totally stable in the Xiaomi environment.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  HTML file crashes program mikefirth 12 2,157 Dec-31-2021, 03:57 AM
Last Post: Pedroski55
  Scraping a Flexible Element - works at first, and then crashes JonnyB 0 1,021 Aug-14-2021, 07:25 PM
Last Post: JonnyB
  Bug that crashes the Python interpreter 3.7 on Mac OS X Stef 1 3,022 Feb-18-2019, 06:30 PM
Last Post: micseydel
  Threading timer crashes my App panoss 4 5,554 Jun-05-2017, 05:57 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020