ofabel / mp-flipper

Python support for Flipper Zero
https://ofabel.github.io/mp-flipper/
MIT License
99 stars 5 forks source link

strange behaviours #3

Closed muziofg closed 2 weeks ago

muziofg commented 2 weeks ago

I updated the app to the latest version available at https://lab.flipper.net/apps/upython excited at the idea of ​​being able to use an interactive shell.

but I have encountered two strange behaviours: One, non fatal, happens when upython is launched and Flipper already has a /dev/ttyACM0 connected and used by a terminal client; App and device crashing immediately (reporting "bus fail"). Another, very strange and makes feature unusable is: how to confirm and execute an interactive command? return key won't work inside py shell. I've tried with "screen" and "putty" terminal client without success

ofabel commented 2 weeks ago

@muziofg thank you for your bug report!

Does it say "bus fail" or "bus fault" ? For me, sounds quite familiar to this issue here: https://github.com/flipperdevices/flipperzero-firmware/issues/3927

About the second issue: Damn, that should not happen! I always connect to the app with the ufbt cli (out of convenience). But just tried with minicom and can confirm the behaviour you describe. This must have something to do with the line endings, seems only ufbt cli is sending \r\n. I will fix that right away, you can expect an update within the next days. In the meantime, you can try the following:

ofabel commented 2 weeks ago

Commit https://github.com/ofabel/mp-flipper/commit/c0d6c6edebbe4dc4ec6a5a2946977ecd7f21995d should solve this problem by only accepting \r for a new line. Any \n character is ignored. A nice explanation of why \r and not \n or any combination of it can be found on superuser.com.

muziofg commented 2 weeks ago

Does it say "bus fail" or "bus fault" ? For me, sounds quite familiar to this issue here: flipperdevices/flipperzero-firmware#3927

"bus fault", sorry and happens only if also the flipper is connected with flipper android app through bluetooth

muziofg commented 2 weeks ago
* Change screen or PuTTY to send different line endings: `\r\n`

* Try https://github.com/ofabel/fssdk with `fssdk cli`

Also I can get around this by using CTRL+J

thanks in advance

ofabel commented 2 weeks ago

happens only if also the flipper is connected with flipper android app through bluetooth

Hmm, it's possible that the active BT stack uses too much RAM. So there is not enough left for the uPython app to start. Unfortunately this leads to a Bus Fault at the moment. Again, thanks for the feedback - I'll see what I can do about it.

Also I can get around this by using CTRL+J

Ah, great - glad that you found such a simple solution!

muziofg commented 1 week ago

I've updated to 1.5 today Now I'm unable to start flawlessly the app, I get a BusFault every try to start Also without smartphone not connected, also with BT disabled

I think you can run the app, what is your configuration? What can I do to debug this crash?

ofabel commented 1 week ago

@muziofg yes, it seems that the application became a bit more unstable :cry:

But the core developers are working on this issue, see https://github.com/flipperdevices/flipper-application-catalog/pull/522 for details.

I usually start the application over the serial CLI, but same here - success rate is about 80%. I also shutdown any background tasks (like Bluetooth or Subghz) to have as much RAM space as possible.

muziofg commented 1 week ago

The goal of the app is run script without an external device However, how do I stop background tasks?