Other Raspberry, B4J and B4A: webserver+websocket app how to?

udg

Expert
Licensed User
Longtime User
Hi all,

I read many tutorials and opened some projects with the goal to understand how to use my new Raspi board as a server for projects that go from serving a few web pages to manage a websocket-based app to be written in B4A.

I am new to some of the technologies involved so am facing a bit of confusion. Please correct my sentences below so to simplify my learning and test deployment.

Nohup
Using Putty to open an ssh session with a running Raspi board, I then need the nohup <command> & sequence to let the command stay active when I close the putty session. Right?
In this context the <command> should be like java -jar mysuperserver?

Running 24/7
Once I have a fully functional "superserver" what am I expected to do to launch it automatically everytime the Raspi board is booted? Using a cron table? Or editing the etc/rc.local file?

Superserver
With this I simply mean that I'd like to have a single server able to serve a few html/css pages as well as to act as the server side of a websocket-based service implementing a push service consumed by a B4A client app.
Is this doable or is it better to have two distinct servers, one for web services and the other devoted to the push service?

All the above said, is MySQL the only other element I have to install on Raspi to have my project come to life?

TIA for your comments and hints.

Umberto
 
Last edited:

rwblinn

Well-Known Member
Licensed User
Longtime User
Hi,

have a look at this B4J Webserver project running 24/7 on a Raspberry Pi (acting as a Home Server).

To note: The B4J webserver is started as a deamon (read the readme file in the www/sh folder where I decribed on how to set the service up).
 
Upvote 0

udg

Expert
Licensed User
Longtime User
Hi Robert,

thank you for your post and for the great B4J HowTos site.
I also found very promising for my goal your Team manager project. I never used sqlite before, so do you think it will be wiser to install MySQL on my Raspi board or should I spend some time with the former? I understand that often such a decision is based on expected scalability of a project, but here it's more about learning another tool than how the project could scale in its maturity (btw, if it grows larger enough the Raspi will need to be substituted by some other hardware).

Umberto
 
Upvote 0

rwblinn

Well-Known Member
Licensed User
Longtime User
Hi Umberto,

if the target is to learn, would recommend to use an SQLite database as a starter. Rather easy to setup and loads of documentation available to help.

Agree with the limitations of the RasPi - but again good to get a strawman going. Use tools like Putty and WinSCP to remote control the RasPi from your PC.

If your solution is mature, convert if required to other hardware.
 
  • Like
Reactions: udg
Upvote 0

udg

Expert
Licensed User
Longtime User
Hi Robert,

thank you for your comment. Indeed I am very proficient with MySQL and Oracle DBMSes, so the question about sqlite was intended mainly to understand whether that tool should be considered a must-have or something useful only when a MySQL implementation results too complex for the task at hand.
Yesterday I spent a couple of hours on jQuery Mobile to try to better understand it and then to mimic what I did an year ago with CSS+HTML.

Ok, time to read more stuff and experiment a bit more..

Umberto
 
Upvote 0
Top