PBuilder - Huh?

I am sure this has been asked many times in the past, but what the hell is PBuilder? I just want have a web server, grab when it asks for a file, and send my data/pages. I have looked through all the documentation: the AWS.pdf and the Ajax document are the only references I can find, and they are useless. Could someone point me in the right direction?

P.S. Whomever came up with compiled web pages should be shot.

For the advanced web server (AWS) to handle your web pages they must be converted to C. For better or worse that is how it works. The pbuilder utility performs this task. In general 2 .c files are generated as follows:

Lets assume for simplicity your application is made up of one html file (yes this is quite simpliistic) called myWebPage.html.

myWebPage.c
myWebPage_v.c

myWebPage.c contains the html code and data structures used by AWS to build the html that is sent to the browser (data to be combined with the html code is discussed below).
myWebPage_v.c contains “stub” functions. These are empty functions that you (the software designer) fill in to (generally) access device data and send it back to AWS.

The html from myWebPage.c and the data from myWebPage_v.c is packaged up and ultimately sent back to the browser.

There is a document called the AWS toolkit users guide that comes with the cd that discusses the pbuilder utility and the calls that can be made “into” AWS from "stub functions.

Thanks for all the help!

I finally gave up and wrote my own web server. Only took me a few hours and it works great. It is tied in with NetOS security and also allows for virtual files which is nice for Ajax.

It seems that whomever wrote that monster one for NetOS has entirely forgotton the KISS principle.

Thanks for the reply.

> There is a document called the AWS toolkit users
> guide that comes with the cd that discusses the
> pbuilder utility and the calls that can be made
> “into” AWS from "stub functions.

I have read the AWS document. It really doesn’t say much. It is obviously a document written to appease a manager somewhere and not a serious attempt to document the crazy precompiled page scheme. Your quick note was much better written and gave more info than the document.

I still haven’t figured out how to add pages to my project, and I have been trying for days. I am about ready to quit and write my own web server. That would only take me a few hours and would be much more KISS.

Do you know if the uCLinux version uses real web pages like the full Linux? That may be a reasonable alternative.

Thanks,
-Erik

To add new web pages to a project can be done in one of two ways as follows:

Using the precompiled (pbuilder) method
Using the gnu comand line and green hills development environments:
In your project, I recommend starting with the nahttp_pd project. Remove the html files from the \pbuilder\html directory of the project. In the pbuilder\html directory, place your html files. If you are taking advantage of AWS’s ability to access device data, then add your AWS comment tags, if not then just place the html file(s) in the aforementioned directory.

In the directory pbuilder of the project, is a file called list.bat. This contains a list of files that the pbuilder utility will convert into C. Remove any vestigates of existing files. Places the names of your files into this file (list.bat). Put them in as follows:

/html/ (I forget whether to use the / or the . Use whatever th eexisting files use. Also be mindful that the FIRST file referenced in list.bat will be the “home” page of your device. That is if your surf to http:// you’ll get that page. The order of all other pages listed in list.bat is immaterial.

Open a DOS shell set your current directory to the pbuilder directory of your project. Run the pbuilder utiltiy (in the /bin directory of your project). When done, in the \pbulider\html directory of your project, you should find a new file called .c and one called _v.c. In my last note I explained the copntents of .c and _v.c.

If you are using ESP list.bat is called pbuilder.pbb (I believe). I believe with the latest version of ESP, you can run the pbuilder utility directly from ESP. The directory structure might be a little different. But essentially list your files to be “compiled” by pbuilder in pbuilder.pbb and run the pbuilder utility against pbuilder.pbb.

From that point, the process should be the same.

Now if you really really really had a bad taste for using pbuilder, you could do the following:

I have run ourt of room . More in next posting....

Create 1 page that is compiled by the pbuilder utiltiy. Place the remainder of your files (html files) on the device’s file system. Have a link (anchor tag with an href attribute) to the rest of your web files on th efile system as FLASH0//. What you’ll lose is the ability to access device data. But if you do not need that, this might reduce the use of the pbuilder utility.

Of course you will have to add the .c and the _v.c files to your make file. If you are using ESP, they will be picked up. Also remember that every time you run pbuilder, it overwrites the _v.c file. So I generally move it to the \pbuilder directory. If you are using ESP, you’ll want to rename the version in \pbuilder\html so it is not compiled. If you are not accessing device data, then this i snot an issue

There is a white paper on Digi’s site called something like accessing web pages on the fly, that talks about doing something like this.

Now as far as the Linux’s kit is concerned, I do not know it well enough, at the web server level to answer your question. Perhaps someone else can help.

Hello,

here is a couple of file you can find on Digi’s support pages when you’re looking for them hard enough. It’s a bunch of app notest that should shed some more light on the usage of AWS.

Kind regards,

Christopher

Hello,

here is a couple of file you can find on Digi’s support pages when you’re looking for them hard enough. It’s a bunch of app notest that should shed some more light on the usage of AWS.

Kind regards,

Christopher

Here’s the rest of the files…