This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

App crashes with some experiments (Android)
#1
Hi,

I'm working on an experiment to try to extract multiple sensor values packed in a single notification from an ESP32 based device (notification include 7 16bit integers packed as 14 bytes).
Afterwards the values should be put into a timely sequence (plan is to raise the frequency of sensor values).
That's just to explain the background.

I've the problem that Phyphox app crashes on my Android phone.

  1. I've a version of the experiment that is working fine regarding stability (including the graph) ("ESP32_07_einfach08.phyphox")
  2. another one (I entered completey from scratch) crashes the app as soon as I start the experiment and push the screen again to stop the experiment ("ESP32_07_einfach10.4.phyphox"); the graph shows nothing ...
    This version has same functionality as #1 (I re-entered it to get rid of some inconsistencies)
  3. there is an advanced version a friend of mine created that is also crashed the app on my phone ("ESP32_07_einfach10(1).phyphox")
    In this version a view tab just displaying some values works fine; a second view tab containing a graph crashed the app immediately

So #1-3 are working on my friends phone (also Android)
Only #1 is working on mine.

Some more details on my phone:
- Samsung S6 with 32GB storage
- Android 7 (latest available for this phone)
- around 2GB free on SD card, around 700MB free RAM
- latest Phyphox app (updated today)

I use Firefox to access Phyphox editor.

Any idea what to check ?
The issue seems to be related to my phone, but also depends on the experiment.
I'm somewhat confused :-(

Uwe


Attached Files
.phyphox   ESP32_07_einfach10(1).phyphox (Size: 6.22 KB / Downloads: 533)
.phyphox   ESP32_07_einfach10.4.phyphox (Size: 4.14 KB / Downloads: 481)
.phyphox   ESP32_07_einfach08.phyphox (Size: 4.21 KB / Downloads: 466)
.phyphox   ESP32_07_einfach11.3.phyphox (Size: 4.66 KB / Downloads: 499)
.zip   Phyphox_ESP32_07.ino.zip (Size: 1.81 KB / Downloads: 446)
Reply
#2
That's weird indeed. Can you provide the code for the ESP32 and would it run without any additional electronics? I would like to try if this also happens on some of the devices I have at hand (Android 4, Android 8 and Android 10).

At a first glance I could not see anything unusual about your files. Have you set your phone to report crashes to Google? There were not too many error reports from Android 7 in the past 14 days and none of them came from a Samsung phone. I am not sure how long it takes before I can see a reported crash, but if you can enable these reports, it would be very helpful. Alternatively, if you can either use adb or any logcat app, you should be able to find exact error of the crash.

I would really like to either reproduce this or see the exact reason for the crash.
Reply
#3
Thank for your reply.

Code for ESP is attached.
It just generates 14 bytes of data for the notification, which are the numbers from 0 to 6 (7 values) in format of 16bit integers LittleEndian.
I could verify the data with nRF Connect and LighteBlue apps.
The experiment -as described - unpack the 7 numbers and try to bring the in a sequence.

The ESP32 is a DOIT DevKit V1 and has no additional hardware or sensors - just the board.

I will work on Android debugging an see what I can acchieve (never done before on this level). Thank for this hint ...

P.S.: meanwhile I played around with another very basic experiment just to better understand the functionaly of Phyphox analysis modules behaviour.
It has only 4 inputs (3x values, 1x time), 2x counts, 1 graph and 6 values. Values and graph are separated on 2 tabs.
While everything works fine (start & pause) on the value tab, as soon as I switch to the graph tab the app crashes.
Data comes from same ESP code.
I also attached this experiment just as another example ("ESP32_07_einfach11.3.phyphox")

I attached both to first post in thread since I found no way to attached to a reply (update: attachments seems to work if one edit a reply  Smile )

Update 2: added Android bug report; Phyphox is mentioned several times.
I had to split the report (sorry for it's size) and rename the files (forum SW doesn't accepts files with extensions .001, .002 ...).
So please remove trailing .zip from all filenames before unzipping.
PW sent per PM


Attached Files
.zip   bugreport-2020-04-15-11-14-55.zip.001.zip (Size: 1.91 MB / Downloads: 476)
.zip   bugreport-2020-04-15-11-14-55.zip.002.zip (Size: 1.91 MB / Downloads: 493)
.zip   bugreport-2020-04-15-11-14-55.zip.003.zip (Size: 280.24 KB / Downloads: 495)
Reply
#4
Wow, thanks a lot for all the information. I have not yet had the chance to try the ESP32 myself, but from checking the bugreport this seems to be a very weird one. The crash occurs in a line that creates the tic labels (i.e. "-2.0", "-1.0", "0.0", "1.0") and measures their height to determine the required margin for the graph. The strange part is that the crash does not originate from our code but it is an ArrayIndexOutOfBoundsException triggered within the system function that formats the value into the text.

After a quick research, I suspect that this is an older Java bug (https://bugs.java.com/bugdatabase/view_b...id=7088271) that triggers the exception when we try to format the value "zero" with one or zero significant digits. This would explain why it is so specific to your phone (it just uses the specific Java Runtime Engine that has this bug, while the other phones use newer / different versions), it explains why the crash occurs on specific graphs (the value elements use a different formatter not affected by the bug) and it explains why I have not heard of this problem before (as far as I know, none of the default phyphox experiments uses xPrecision or yPrecision set to 0 or 1).

The only thing that does not entirely make sense to me is why "ESP32_07_einfach08.phyphox" works for you. I can only imagine that you do not get any data that triggers a tic at zero on the y axis...?

So, if my assumption is correct, there is no point for me in trying to reproduce this. It would indeed be extremely specific to your device and the exact system version of your phone. The simplest why to verify this, is to modify the not working experiments and to set "xPrecision" and "yPrecision" for all the graphs to 2 or higher.

If it does not crash in that case, I will try to catch the problem in the next version of phyphox and use a work-around for this case. It may be very specific to this device, but a simple catch and fallback is simple to implement and the Samsung S6 is a rather common device and there might be other devices with the Java version out there.
Reply
#5
Amazing - impressed by your fast and detailed reply !!

And yes, your assumption is absolutely correct: with precision 2 and higher my graphs are working like a charme.
Precision 1 makes phyphox crash instantly.

I'm very happy to know about this workaround so I can spend more time on learning about great Phyphox :-)
I wouldn't have found that in weeks of testings ....

Thank's a lot !
Reply


Forum Jump: