B4J Question B4J App Slow on Raspberry Pi 4

walterf25

Expert
Licensed User
Longtime User
Hi all, I am working on a project for work, basically I am attaching a DAQ (Data Acquisition System) we designed with 4 ADCs that communicate with raspberry pi over I2C communication protocol. This all seems to work fine so far, I am able to communicate with each of the ADCs and collect data very well without any issues.

The issue I am seeing is when I try to plot live data on a chart, I am using this project https://www.b4x.com/android/forum/threads/https-github-com-knowm-xchart.147329/#post-938242 for the charts. When I add the chart I start noticing that although the data from the ADC is being collected the chart doesn't render the data immediately, and it is very slow, I am only polling around 1024 samples per second from the ADC, so I don't think that is the issue, the chart is supposed to update the data every 1 second, but in some cases it takes even ~40 second for the data to be updated on the chart.

Not sure if this is an issue because it is running on a raspberry pi 4, if I run the program on my PC by generating random data it works just fine.

Does anyone have any experience with running B4J apps on a raspberry pi and have any suggestions or advice on how what to optimize to make the programs run smoother and faster please let me know.

Thanks,
Walter
 

DonManfred

Expert
Licensed User
Longtime User
I guess the bottleneck here is the very limited power of the Raspberry Pi
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Upvote 0

walterf25

Expert
Licensed User
Longtime User
I guess the bottleneck here is the very limited power of the Raspberry Pi
I'm not sure that's true, we use these devices at work all the time to run automation tools and they seem to have a pretty good amount of power.
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
Which implementation and version of Java are you using? OpenJDK v11.01? Oracle JDK8? Looks like some implementations/versions may work better on a Pi than others. One of them may be this: https://www.b4x.com/android/forum/t...ll-problem-in-raspberry-pi-4b.132001/#content (even though newer versions may have even better Pi support).
I am running java 11 on it at the moment, I will check out your link posted and trying to install a newer java version as we speak as well.

Thanks,
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Upvote 0

walterf25

Expert
Licensed User
Longtime User
Upvote 0

hatzisn

Expert
Licensed User
Longtime User
Upvote 0

tchart

Well-Known Member
Licensed User
Longtime User
Also check the write/read speed of your SD card. I’ve had bad performance On Azure app service due to slow disk access.
 
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
Upvote 0
Top