walterf25 Expert Licensed User Longtime User Sep 27, 2023 #1 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
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 Sep 27, 2023 #2 I guess the bottleneck here is the very limited power of the Raspberry Pi Upvote 0
OliverA Expert Licensed User Longtime User Sep 27, 2023 #3 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). Upvote 0
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).
walterf25 Expert Licensed User Longtime User Sep 27, 2023 #4 DonManfred said: I guess the bottleneck here is the very limited power of the Raspberry Pi Click to expand... 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
DonManfred said: I guess the bottleneck here is the very limited power of the Raspberry Pi Click to expand... 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.
walterf25 Expert Licensed User Longtime User Sep 27, 2023 #5 OliverA said: 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). Click to expand... 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 said: 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). Click to expand... 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,
OliverA Expert Licensed User Longtime User Sep 27, 2023 #6 walterf25 said: install a newer java version Click to expand... Just make sure to ignore OpenJDK for now. Looks like it may have zero support for the Pi's graphics capabilities. See https://seihotech.com/why-is-javafx-ui-running-slow-on-raspberry-pi/ Upvote 0
walterf25 said: install a newer java version Click to expand... Just make sure to ignore OpenJDK for now. Looks like it may have zero support for the Pi's graphics capabilities. See https://seihotech.com/why-is-javafx-ui-running-slow-on-raspberry-pi/
walterf25 Expert Licensed User Longtime User Sep 27, 2023 #7 OliverA said: Just make sure to ignore OpenJDK for now. Looks like it may have zero support for the Pi's graphics capabilities. See https://seihotech.com/why-is-javafx-ui-running-slow-on-raspberry-pi/ Click to expand... Yeah, I read that post, I think I will have to find a different solution for now. Walter Upvote 0
OliverA said: Just make sure to ignore OpenJDK for now. Looks like it may have zero support for the Pi's graphics capabilities. See https://seihotech.com/why-is-javafx-ui-running-slow-on-raspberry-pi/ Click to expand... Yeah, I read that post, I think I will have to find a different solution for now. Walter
hatzisn Expert Licensed User Longtime User Sep 27, 2023 #8 OliverA said: Just make sure to ignore OpenJDK for now. Looks like it may have zero support for the Pi's graphics capabilities. See https://seihotech.com/why-is-javafx-ui-running-slow-on-raspberry-pi/ Click to expand... I noticed this too in a Desktop App and you just cleared things out for me. Upvote 0
OliverA said: Just make sure to ignore OpenJDK for now. Looks like it may have zero support for the Pi's graphics capabilities. See https://seihotech.com/why-is-javafx-ui-running-slow-on-raspberry-pi/ Click to expand... I noticed this too in a Desktop App and you just cleared things out for me.
tchart Well-Known Member Licensed User Longtime User Sep 28, 2023 #9 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
Also check the write/read speed of your SD card. I’ve had bad performance On Azure app service due to slow disk access.
techknight Well-Known Member Licensed User Longtime User Oct 3, 2023 #10 OliverA said: Just make sure to ignore OpenJDK for now. Looks like it may have zero support for the Pi's graphics capabilities. See https://seihotech.com/why-is-javafx-ui-running-slow-on-raspberry-pi/ Click to expand... Out of curiosity, which one does support it? Liberica? or no. Reading the article leads me to believe its just JavaFX in general. Makes me feel like Java as a language is likely dying off on platforms like this. or, perhaps in general. Upvote 0
OliverA said: Just make sure to ignore OpenJDK for now. Looks like it may have zero support for the Pi's graphics capabilities. See https://seihotech.com/why-is-javafx-ui-running-slow-on-raspberry-pi/ Click to expand... Out of curiosity, which one does support it? Liberica? or no. Reading the article leads me to believe its just JavaFX in general. Makes me feel like Java as a language is likely dying off on platforms like this. or, perhaps in general.
A amykonio Active Member Licensed User Longtime User Oct 5, 2023 #11 I wonder how better would your process run in a pi 5. Andreas. Upvote 0