Home NetLinx Studio

Sending arbitrary files to a master

AuserAuser Junior MemberPosts: 506
Hi all,

I'm trying to figure out whether it's possible to send a text file to a master via a serial link using NetLinx Studio, File Transfer or other software.

Obviously it's possible to do so using ftp, but I'm trying to figure out a way to send all files I need using a serial cable so that the person who's on site commissioning the system doesn't have to be able to communicate with the master via IP. In addition to the usual .tkn, .tp4, .irl, etc. files, I need to be able to upload a text file or two to the master but can't find any way to do this with NS2/FT2. Any ideas?

Many thanks :)

Comments

  • NMarkRobertsNMarkRoberts Junior Member Posts: 455
    You could send it as a string to a device using NS2 Diagnostics / Control a device with some code waiting on that device that does with the text whatever you wish.

    A quick experiment shows that the text buffer has a limit of quite a lot.
  • AuserAuser Junior Member Posts: 506
    Thanks Mark, I'd kind of resigned myself to that course of action but was hoping there was a ready made AMX solution :( On the plus side I'll have a back door built into all systems that I can use for other purposes as well...

    The way I envisage it working is sending the necessary files to the person commissioning the system and getting them to run a batch file. The batch file will use FileTransfer to transfer the touch panel, keypad, IR, etc. files followed by the .tkn file via the program port. Once the master has rebooted and is back up and running, the batch file will fire a small utility which will put the program port into pass mode to a predefined virtual device and send the text files to the master via a module watching string events on that virtual device. Should be fairly easy.
  • alexanboalexanbo Junior Member Posts: 282
    You might be able to cheat it by taking a text file and using an .irl extension instead of .txt.

    When you download an irl file, those files show up in the root directory, I don't know if the master checks if it's a valid irl file or not before it places it there though. Then you would change the filename you're trying to read in code from filename.txt to filename.irl

    Actually I gues the file gets renamed so you'd need an empty ir port to upload the file to and then need to figure out the renaming scheme.
  • NMarkRobertsNMarkRoberts Junior Member Posts: 455
    Or find a terminal emulator that allows you to paste in large amounts of text, and connect via serial cable to one of the serial ports, and write code on the master to wait for text on that port.
  • AuserAuser Junior Member Posts: 506
    Thanks guys. I'd considered both of these options but discounted them. I liked the IR file idea but didn't want to waste an IR port and couldn't think of a sensible procedure for uploading a text file as an IR file, having the program realise this had happened, copying/renaming the bogus IR file and subsequently uploading the authentic IR file for that port.

    Similar scenario for the serial port method, I'd rather leave all the serial ports available for dealing with real devices in all systems. It would be possible to have a module watching for certain comms on any or all serial ports normally used by projectors, etc., but then the NetLinx has to parse incoming data on the port twice, once by the device module and once by the module waiting for control/file transfer type comms. Also, who knows what arcane baud rate, parity, etc. setting the physical device plugged into that port may be using. It's preferable that the guy in the field can plug in a single cable and send all the required files without having to reconfigure anything.

    I've implemented the solution which I described above which seems to work quite well in the absence of anything more elegant. I'm going to include that module in all systems and add other functionality to it as I feel the need - like being able to copy, list and retrieve files from the control system and 'do_push(d: p:s,channel,time)'. At the moment the file transfer functionality is pretty rudimentary and doesn't include any error checking, but I'll implement a superset of the TFTP protocol or similar as and when I find the time.

    I may run into hassles with this as USB program ports are starting to appear on NetLinx controllers, but hopefully the good folks at AMX were helpful enough to implement the USB connection as a virtual COM port so that we'll still have a terminal interface available when the Telnet and SSH ports are locked down on the device.

    Thanks for the ideas.
Sign In or Register to comment.