Http requests

MobileMe

Active Member
Recently I made my own web app interface for the webcontrol board. It's very quick and reliable running on a dell net book that I wasn't using. The app has a jquery mobile base with php and JavaScript.

I read somewhere on this forum that the board has a http queue. My question is how large is the queue before http request are deleted?

Right now the app dynamically updates every three seconds by getall.cgi. I'm looking for a balance between updating data and sending data over the Internet. The app also sends commands to the board. An example would be when I want to turn the temperature up, the command gets a var value then adds one and sets the var with the new value.

My concern is having the app update to much might kill a command. How much can the board handle?
 
If you have the latest revision of the firmware ( I forget the number) you can push the changed values to your 'server' when the change happens, or add some code send a 'check me' flag to the server and only poll the board when that flag is present.
 
i am trying to make web page where i can have all my temps and name  and automatically update but don't know how to do it.
 
I have version v03.02.15 and a v03.02.16 and know about HTTP commands but how to i put them on page 
 
I did consider using webset, but I like being able to get all the board's values at once. As for the app, I used php to get and format the data then JavaScript to display the data. Same goes for sending commands to the board.
 
I wrote something perhaps similar for my tracker controllers, except that the web page served actually goes and gets the data *once* at the time the page is actually displayed (rather than constantly). The data is formatted for html display in the shell script that actually gets the data from the WC board. It's presented in a form, which lets me change things (like set high-wind manually, or manually move the arrays east or west, set the on their edge for washing, etc) which submits back to my webserver - which in turn sends the commands to change outputs or variables.
 
It adds a slight (but barely perceptable) delay to things, but it also eliminates the need for constant re-reading of the WC board.
(I use a meta-refresh in the page for periodic updates in the browser)
 
WEBSET PLC instruction can only get one value at a time.  If you write your own server CGI code and able to send back a TEXT/PLAIN page, the new 3.02.17 firmware allows WEBCONTROL reads back server reply through a special string in the reply. HTTP server must in its reply first thing stating "SET_WC=12345678", where 12345678 is the command HTTP server telling WEBCONTROL. That value will be read in by WEBCONTROL. PLC code can access it by reference to "WSRPLY".  You can arrange between your PLC code and HTTP server certain command sequence, for example, 78901111 is reading VAR1, 78901121 is reading temprature 1. 8899 is turn all TTL output on, etc.  You can also set WebControl do WEBSET once a hour waiting for server command.
 
Due to so limited RAM space, there is only four TCP socket. If you pulling board actively, it may use up all the socket, causing WEBSET fail. If you want to use WEBSET, then try not actively pull the board.
 
After about three months, I figured out how to dynamically update the page without reloading it making a huge impact on bandwidth. With compression enabled, I was able to get the bandwidth down to 10kb every three seconds. My goal was to get a fast, efficient and lightweight web app that could be used by any device. It loads in about 2 to 4 seconds on my Motorola droid X depending on how slow the phone is that day. It load instantly on my iPad.

I use getall.cgi to poll the board, then extract what I want and format it. When D1 is 0, the page displays "Garage: CLOSED". When D1 is 1, the page displays "Garage: OPEN".

The web app can do pretty much do anything you can think of with the board. I thought about releasing it, but I didn't document anything. Yes, I know that's bad. I document everything for work so when I was making the app, I just didn't care. There is no one config file, which means you need a good understanding of php and JavaScript. Not to mention I don't have time to support it.
 
MobileMe,  that is a great news. I am sure many will find that is useful.
Do you send in encrypted user name/password?  If you do that also, then your app is secure over the Internet.
 
Yes, it is encrypted. I use xampp as my web server and just enabling ssl in apache does the trick. Like I said, there was a lot of configuration involved. There is one security flaw in my app though. I just used a php login script without a database, which means that the username and password are stored in a config file in the root directory. It could be fixed with a different login script, but I haven't found a good free script yet.

I did find out that if the ssl cert is not signed properly, apple products have a bit of an issue with it. My iPad sometimes has issues with it. My androids don't have any issues with it. I used apps geyser to make a native app for quick access.
 
If there is an interest, I would be more than happy releasing the web app with the understanding that I can't provide support for it. Wish I could, but I just don't have the time. It's the first version, so there is allot of room for improvement.
 
I don't know if there is a way for upload/download file on this forum. If not, we can provide the web space for put MobileMe's app online on CAI Networks site. We do not provide support to it, either. Of course, if MobileMe has his own web site, it will be perfect to host that there with whatever the notes he has.
 
Back
Top