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 :
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_ACQUITTEI do not see what can cause the exception in the code above. Any idea, someone? Thanks!