Increasingly slow implementation

Bonjour,

My application is getting slower and slower the more I use it. This has been happening since I set up a "feedback" function between my arduino Nano 33 BLE board and my phone.

My application works as follows: I send a value to my card to change its parameters and when the change is made, I send the code back to check the application of the instruction. It can also be information that comes directly from the card.

I also use a button attached to the map to trigger voice recognition. This feature slows down the application even more.

I've read a lot on the forum, but I can't seem to solve my slowness problem: can anyone help me?

I am attaching my 2 programmes. They are a bit complex. I'm not a programmer...



Uploading: blocks (7).png...

Please stick to one thread for one question.

Bonjour @Stephane_LAMBERT,
j'ai vu que tu as trois écrans. Tu sais que quand tu change d'écran le BT de chaque écran va reinitialisé. Je ne suis pas sur q'il soit ainsi rapide d' éteindre le BT de l'écran courent et réinitialiser celui du nuoveau écran.
La meme chose pour la reconnaissance de la voix (SR).
J'ai aussi vu que tu utilises 2 BT: un BLE et un "normal" et deux SR: un en legacy mode et l'autre "normal".
Je ne suis pas allé à fond car dans ton code il y a plusieures blocks ouvert (sans contenu) ou des block sans "tete").
Il Y a aussi une seriale ? Que fait elle ?
Et tu va écrire dans des fichiers ? Si l'écriture devient trop souvent, elle peut créer des délais.

C'et un conseil qu'on est en train de donner à tous : est il difficile pour toi de utiliser des "écrans virtuels" (avec Hor et Ver arrangements) au lieu de plusieures écrans ?
Cela va résoudre tous les pb de synchronisation (c'et à dire: les horloges, le SR, le BT, etc.) et de passage des données. Peut etre qu'il n'aille pas à resoudre ton pb principal mais il va rendre les choses beaucoup plus facile.
Le fichier ici en piéce jointe c'est un example de comme utiliser les écrans virtuels.
Dans ce code je utilise une extension faite par @shreyash :clap:que nous permet de appliquer des effects très charmant pour passer d'un écran à un autre.
provafade.aia (1.4 MB)
Bonne chance !!!

Bonjour merci pour ces réponses.
Pour l'instant je ne change pas d'écran. je n'ai donc pas de problèmes de reconnection. Le serial date du début de mes essais: cela peut gêner? (j'ai d'abord communiqué par série puis par Bluetooth, puis par BLE.
je n'écris pas dans un fichier
Je ne connais pas les écrans virtuels maje vais y jeter un coup d'oeil

See tip 1 here

Taifun

Thank you for thé tips. I'll try to build a new app with virtual screen and clean everything

Salut, @Stephane_LAMBERT,
Je continue en Anglais pour que aussi autres de la communauté puissent t'aider.

As a general hint, it's better to remove all the components that you don't use any longer.
It could happen that if you haven't deactivated them, they can continue to work without you are being aware.

So, if you don't change the screens, this means that your Screen1 is the unique that works ?
If this is the case, you are still in time to change the structure by using the virtual screens (@Taifun has indicated you the tutorial on that :+1:) .
While doing that, you can add small pieces of code step by step (if possible) so to find if there is a "moment" in which the things are getting worse.
Bonne chance,
Ugo.

Thank you Ugo. I will try to rebuild my app and share if it's ok

1 Like

The app is extensive. Do you create any long lists in the app? Are you collecting more and more data and the lists are getting longer? Then you analyze ever longer lists?

No, I just send information to a arduino UNO, to to change the setup up, an then the UNO send back the argument to confirm

Timer RX


Do you ever stop registering for strings?

If you are registered for strings, why do you need to read strings when they should now be arriving on their own?

Do you mean that I should'nt use thé clock tx? Stringreceive is enough?

I change this way, and now it's very fast. Thank you very much. Now I have new issues. I have to investigate


Since it looks like you're working with BLE, if you're looking to receive information from the device using the notification functionality of BLE, then you ought to declare on the peripheral that it will notify the central (i.e., your app) rather than polling it with a clock. The whole point of the notification protocol is to reduce energy consumption, and actively reading over and over, even if nothing has changed, is the antithesis of this.

Can you explain how to do thar, please?

Here examples of Notifications

(added to FAQ)

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.