Javascript GUI on extermal server

Efried

Active Member
Is this correct that using the javascrip enhancements and XML operations is only possible if the GUI code is loaded into the WC?
because this may brick the WC I would like to use the code on my server instead of the cgi access method. Is ist possible to redirect the javascript to the factory javascript library loaded onto the wc or to gain access to the code somehow?
any experience with that would be highly appreciated.
 
No. WC board does not run any JavaScript or xml code.  Having them executed in external machine is perfectly fine.  Java library stored on the WC board does not execute on board, merely send to browser to execute. You can write your own library and totally bypass using any library call from WC.  Please note different version firmware may have additional function added to the library.  If you could develop your code on server, you either based on latest firmware, or based on the version number reading back from the board to use different data structure.
 
Changes from one version to next mostly are small.
 
Ok, thanks to the info. Where to start? Is it possible to use the htm-code from the WC itself? 
are the api and js standard on a windows client?

<script type="text/javascript" src="api/NetDevAPI.js"></script>
<script type="text/javascript" src="api/ajax.js"></script>
<script type="text/javascript" src="api/assembler.js"></script>
<script type="text/javascript" src="api/encoding.js"></script>
<script type="text/javascript" src="api/helpers.js"></script>
<script type="text/javascript" src="help/help.js"></script>
<script type="text/javascript" src="help/version.js"></scri
 
Depends on what function you want to implement on your server, you may want to start with one part at time. You don't need to develop all those java libraries. If you familiar with server CGI programming, you know each time when user click on the submit button, browser will send to server data.  That data can be captured by using Wireshark.  You can see those are hex encoded ascii bytes of the data structure.  As long as your server sending to the board in the same format, it will be accepted. 
 
You can start by disable login. Once that is working, your server can also send encrypted user ID password, similar like browser, then it will work totally.
 
CAI_Support said:
Depends on what function you want to implement on your server, you may want to start with one part at time. You don't need to develop all those java libraries. If you familiar with server CGI programming, you know each time when user click on the submit button, browser will send to server data.  That data can be captured by using Wireshark.  You can see those are hex encoded ascii bytes of the data structure.  As long as your server sending to the board in the same format, it will be accepted. 
 
You can start by disable login. Once that is working, your server can also send encrypted user ID password, similar like browser, then it will work totally.
Once I had a php script logging data, but I thought using js  might replace that working in my own private network. But I see no guide for doing so using the NetDevAPI.getBoardStatus(statusUpdate). The htm file would be on the client file:///C:/Users/User1/Desktop/webcontrol.htm
thanks
 
NetDevAPI is an embedded library stored in the WebControl board.  When you writing your own code, you don't need to call that.  If you just want to get board status, simply do HTTP GET on  /api/status.xml will get all the status.
 
ok thanks, so my initial posting was correct. In order to exploit NetDevApi, the html-code using this XML/js-functionality should be on the WC itself. Working with http get was something I tried to work around using XML.
 
Tom is correct, Lars actually works on a feature that will allow his software from one board backup all configuration then upload on a new board. Which is similar to Efried talking about.
 
If you have a server already running, do you want to try to use WEBSET call to report to your server through HTTP protocol?
FTP is not work well going through firewalls because it may redirect to another data port.
 
CAI_Support said:
If you have a server already running, do you want to try to use WEBSET call to report to your server through HTTP protocol?
FTP is not work well going through firewalls because it may redirect to another data port.
I do have a domain and web space for it, a cron job would be an option, yes. This would work right now, but needs some hassling around.  I had hoped that ftp to my web space would work with WC, it works from my PC.
 
Adding each TCP protocol  client to the board will require to use certain amount RAM and ROM, especially FTP require to have a large buffer space before sending, since FTP must send a chunk a time.  SMTP and HTTP can break down to much smaller packets. In addition, FTP server in most implementation out there will redirect traffic from FTP port to a high port.  That could cause transfer fail if both sides are behind firewalls. 
 
If you just want to keep log of everything, simply let WebControl send you an email each time you think needed, by set up PLC logic do so. On most Linux servers, those emails are in text file easy to process.  If you want to have certain special event to trigger action, then you can use WEBSET to send to your CGI code, which can take that event code and start actions on your server side.
 
CAI_Support said:
Adding each TCP protocol  client to the board will require to use certain amount RAM and ROM, especially FTP require to have a large buffer space before sending, since FTP must send a chunk a time.  SMTP and HTTP can break down to much smaller packets. In addition, FTP server in most implementation out there will redirect traffic from FTP port to a high port.  That could cause transfer fail if both sides are behind firewalls. 
 
If you just want to keep log of everything, simply let WebControl send you an email each time you think needed, by set up PLC logic do so. On most Linux servers, those emails are in text file easy to process.  If you want to have certain special event to trigger action, then you can use WEBSET to send to your CGI code, which can take that event code and start actions on your server side.
Should we wait for WC32 for a all-in logging capability?  What is the roadmap.
Opening the WC for web access without password to retrieve data via CGI is something which would make the NSA happy.
 
Back
Top