B4J Question ABMaterial with RaspBerry Pi

walterf25

Expert
Licensed User
Longtime User
Hello all, I have a need to create a web app which can be deployed on a Raspberry Pi, the Raspberry Pi will have 2 or 3 USB to Serial cables, the reason for this is that I need to control 3 pieces of equipment to automate some board level testing at work. Upon reading some of the threads and specifically this one, I realize it can be done, however when i launch the project i receive an error which tells me that i am missing a sessioncreator.js file, i can't post the exact log at the moment as i was not able to save it earlier and i have already taken apart my set up, when i go to the web browser on the Raspberry Pi and type in the IP Address i can see the page starts loading but all I see is the progress circle and the actual page never loads.

I will try to post the actual error message tomorrow morning when i put my set up back together again, in the mean while if anyone can tell me if there is any special set up that I need to do on my Raspberry Pi besides installing java and B4J-Bridge please let me know, I can see the folders being copied into the /tempjar/www folder in the Raspberry Pi but i must be missing some other step, i'am using the latest version of the ABMaterial library 3.2 and also the latest version of B4J 5.82.

Thanks all,
Walter
 

alwaysbusy

Expert
Licensed User
Longtime User
i am missing a sessioncreator.js file
This is normal and is supposed te be like this. This is used to force the creation of a new session, and as it does not exist, 0kb are transferred.

You have to manually (using WinCSP for example) copy the full www folder to the Pi (the ones you see are the onses your app creates, but there is a lot more needed which B4J does NOT copy).
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
This is normal and is supposed te be like this. This is used to force the creation of a new session, and as it does not exist, 0kb are transferred.

You have to manually (using WinCSP for example) copy the full www folder to the Pi (the ones you see are the onses your app creates, but there is a lot more needed which B4J does NOT copy).
Thanks @alwaysbusy, i got it running on my Raspberry Pi now, any chance of getting this to run but be accessible from my laptop as well?, I am able to run Erel's HelloServer example and i can access the page from my laptop, but for the example that turns on an L.E.D on the Raspberry Pi, i can't access it from my laptop, any suggestions or ideas?

Thanks,
Walter
 
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
but for the example that turns on an L.E.D on the Raspberry Pi, i can't access it from my laptop
I don't know this particular example. Maybe better ask it in that forum topic? It should be the same, something like IPAddressOfThePi:port/programName
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
I don't know this particular example. Maybe better ask it in that forum topic? It should be the same, something like IPAddressOfThePi:port/programName
Thanks, i got it runnng on my Raspberry pi!!!

thank you,
walter
 
Upvote 0

incendio

Well-Known Member
Licensed User
Longtime User
Hi, i am also planning to run ABMaterial on Raspberry.

If you don't mind, May i ask a few question :
1. Which version on pi you are using, 2 or 3?
2. Which java version you are using, open java or from oracle?
3. OS you're using?
4. How's performance?
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
Hi, i am also planning to run ABMaterial on Raspberry.

If you don't mind, May i ask a few question :
1. Which version on pi you are using, 2 or 3?
2. Which java version you are using, open java or from oracle?
3. OS you're using?
4. How's performance?

Hi there, i'm using Raspberry Pi 3, i installed the latest java version jdk 8u144, and i'am using Noobs Rasbian version, performance wise, i'am still running some tests, one thing i noticed is that after a while the readings i expect from the instrument i'm controlling do not get to the webpage, i know for a fact that the instrument is responding and sending data back to the raspberry pi through the USB to serial port, but for some reason the values do not update on the webpage, i'm not sure why this is, it might be a delay issue, or packets getting lost, i'm not sure, If i launch the webpage from my laptop i don't see this issue, anyhow, hope this helps a bit.

Regards,
Walter
 
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
I have the same setup as @walterf25

Doing some test too in our company. We have several 'boxes' which read about 40 handheld scanners each (USB connected) every minute and then update a webpage and send the result over to another server. They have now been running for several weeks now without a hiccup.
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
I have the same setup as @walterf25

Doing some test too in our company. We have several 'boxes' which read about 40 handheld scanners each (USB connected) every minute and then update a webpage and send the result over to another server. They have now been running for several weeks now without a hiccup.
Hi @alwaysbusy i'm curious as to why the data being read from the equipment is delayed to show up on my webpage interface, when I first start the application in the Raspberry Pi, it works smooth, but as time goes by, i start seeing in the logs that no data is received, I know the equipment is responding and sending the readings because i can see the Tx and Rx lights on my USB to serial adapter blinking, but for some reason sometimes it takes up to 2 to 5 minutes for the readings on the webpage to update the values, any ideas?

Walter
 
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
@walterf25 How does you app receive the data? (polling usb in a timer and then updating the ABMaterial page for example).
I suppose you are using the Serial lib: Do you see the data arrive there and is it just the ABMaterial page which isn't updating?

EDIT: if you're sure the data arrives in B4J, I can have a look at your ABMaterial code tomorrow (you can mail me the relevant refresh code). Maybe it is just a matter of the usage of refresh.
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
@walterf25 How does you app receive the data? (polling usb in a timer and then updating the ABMaterial page for example).
I suppose you are using the Serial lib: Do you see the data arrive there and is it just the ABMaterial page which isn't updating?

EDIT: if you're sure the data arrives in B4J, I can have a look at your ABMaterial code tomorrow (you can mail me the relevant refresh code). Maybe it is just a matter of the usage of refresh.
Yes, i'am basically polling the USB to Serial in a timer, i've tried different timer intervals but i still see the same issue, as I mentioned before if I run the application in my Laptop everything runs smooth as expected, but when i deploy the jar file from my Raspberry Pi is when i start seeing this issue, but you may be onto something I also suspect it must be something in my code as i'am not very familiar with web applications and i just recently started playing with the ABMaterial library which by the way is beyond awesome :).

I ca send you the code, let me know when you would have some time to take a look at it.

Regards,
Walter
 
Upvote 0
Top