Hello World

Create an UserApp

An UserApp for beroFix is easily created with the berofix application framework, short baf. It can be installed from here[1].

The first step after installation of baf is to create an UserApp-skeleton. This is done by entering the following command:

baf create hello-world

This will produce the following output:

* creating directory 'modules'... * creating directory 'pkg'... * creating directory 'pkginfo'... * creating directory 'template'...

and the resulting filesystem-strucuture is shown here:

hello-world hello-world/modules hello-world/pkg hello-world/pkginfo hello-world/pkginfo/VERSION hello-world/template hello-world/template/bin hello-world/template/init hello-world/template/lib hello-world/template/mnt hello-world/template/setup hello-world/template/www hello-world/.baf.conf

Let your UserApp say 'Hello, World!'

Switch to the directory hello-world/template/www and edit the file index.php.

Change the line:

to:

Save and close the file.

Create the UserApp package

Back at the command-prompt, type:

your favorite editor will open the file pkginfo/VERSION:

Now you could define or change the name of the UserApp, update its version or the slots taken by it. For now just save the file and close your editor.

After saving the file pkginfo/VERSION, baf continues to build the package with the following output:

After it's completed, you'll find the UserApp-package in the directory pkg/. It will be named similar to this:

Install the UserApp package

This package can now be installed using the beroFix GUI. Open Management->Firmware to upload and install your UserApp.

See the result

If this is the first UserApp you installed, you'll notice the additional entry Apps in the beroGUI menu. If the cursor hovers over it, you'll get a list of installed UserApps. Click the link of your 'hello-world' app to see what happens

 

Happy Coding!

If you need scheduled remote assistance, you can request our on-demand support services: https://www.beronet.com/support