Home AMX User Forum Duet/Cafe Duet

Direct Web Content

Hi All,
This question will seem a little out of place, but. I was wondering if anyone can point me in the right direction for creating a module with similar functions to Virtual Keypad.

The web side of things is fine and I can handle that in plain ol' JAVA. Where I am having the issue is working out how to attempt to create something along the VKPD lines - Not so much clicking the device on the web engine (like a G4 panel), although a nice feature. Just being able to bring content up in a folder

ie: 192.168.1.1 takes you to the normal web pages of the processor and 192.168.1.1/something/mywebpage will take you to the java web page

Any pointers in the right direction would be appreciated.

Thanks in advance

Colin

Comments

  • viningvining Posts: 4,368
    You could try this link and see if it has parts you need or ideas you can use:
    http://www.amxforums.com/showthread.php?6462-AMX_Mobile
  • Thanks for the link, this is in standard netlinx code which works fine but gets progressively more messy the more complicated the web design. Also the web port has to be moved so that the netlinx code can have this port.

    What I was interested in is being able to place content so that the AMX's port doesn't need to be changed, instead the content can be accessed as a folder/extension of the main processors IP just as in Virtual Keypad
  • AuserAuser Posts: 506
    I suspect you may be able to with ftp.

    You can't list files above the home folder, but you can write to them with ftp commands a la:
    put prog.tkn ../prog.tkn
    

    So, if you determine the path to where the standard NetLinx web pages are (by mounting an NI compact flash on a PC), you may be able to create a folder and drop your files in it via ftp.

    I seem to remember there being a couple of partitions on NI compact flash cards and space on the partition that you need may be an issue.
  • PhreaKPhreaK Posts: 966
    You can browse the complete file system on the NI's from telnet and SSH, just use the list command. All the web interface guff is stored in ../http/.

    I haven't tried it yet but you should be able to write what you need into there from a Duet or NetLinx module that handles your web interface. If you want to overwrite the standard web interface so that when the box is browsed to just overwrite default.html with your GUI. From there it should be possible to use html5 websockets API to communicate back to a module running on the master.
  • Thanks all,
    Kim has just given me something to go on. It appears that if I FTP into the server and add a folder, nothing happens! However - add an index.html file to that folder and it instantly appears in the Webcontrol page under the folder name.

    The VKP folder has a simple redirect to /web/modules/ think with a little prodding I should be able to find how to dump files somewhere around here from DUET

    Thanks again all
  • John NagyJohn Nagy Posts: 1,742
    Be sure you are not making folders with spaces in their names. A common error is to presume that a folder named NEW FOLDER can exist in the unix environment. It can't. It's legal in WINDOWS but not in the NetLinx.
  • jweatherjweather Posts: 320
    Maybe not on NetLinx, but there's nothing wrong with spaces in a folder name in a Unix environment. Unix has had long folder names since before the DOS 8.3 days...

    Edit: And for that matter, it works fine on NetLinx too:

    C:\Users\Jeremy> echo "index test" > index.html
    C:\Users\Jeremy> ftp 192.168.1.195
    Connected to 192.168.1.195.
    220 VxWorks (VxWorks5.5.1) FTP server ready
    User (192.168.1.195:(none)): NetLinx
    331 Password required
    Password:
    230 User logged in
    ftp> mkdir "new folder"
    200 " new folder" directory created
    ftp> cd "new folder"
    250 Changed directory to "doc:user/new folder"
    ftp> put index.html
    200 Port set okay
    150 Opening ASCII mode data connection
    226 Transfer complete
    ftp: 24 bytes sent in 0.09 seconds 0.27Kbytes/sec.
    ftp> quit
    221 Bye...see you later

    C:\Users\Jeremy> wget -O - http://192.168.1.195/new%20folder/index.html
    index test
  • John NagyJohn Nagy Posts: 1,742
    Huh. Yes, it does work. I don't know if my info is old or just plain wrong. I know I can't move datasets with spaces into our tech site ftp space, maybe that's were I got the idea that the NetLinx can't do it either.
    Sorry.
  • viningvining Posts: 4,368
    John Nagy wrote: »
    Huh. Yes, it does work. I don't know if my info is old or just plain wrong. I know I can't move datasets with spaces into our tech site ftp space, maybe that's were I got the idea that the NetLinx can't do it either.
    Sorry.

    Maybe your thinking Linux not Unix? I think using double quotes work there as well?
  • PhreaKPhreaK Posts: 966
    vining wrote: »
    Maybe your thinking Linux not Unix? I think using double quotes work there as well?
    Yep, you need to use double quotes as spaces are used to separate parameters and the file / directory needs to be considered a single parameter.
  • jjamesjjames Posts: 2,908
    Ok - I've spent days, if not a week and a half, to try and create a web server, and I still can't get it. I've read up and down, down and up, left to right and backwards, and still can't figure this out.

    I'm to the point where the Jetty server starts, but cannot serve up one page (that's all I have.) I don't care if it's on another port (I'd actually prefer that) - can someone lend a hand? I know I'm missing something (perhaps a brain & sleep?)
  • viningvining Posts: 4,368
    Look at the AMX_Mobile link posted earlier in this thread. It's not duet if that's what you're looking for but it does create a server on port 80 which you can change if you want and it does serve up html when you connect to it. You can interact with it and it does provide simple feedback. It's very primitive but does give on/off and level feedback if I recall. It would actually change the html sent out based on the browser connecting.
Sign In or Register to comment.