Home AMX User Forum AMX Technical Discussion
Options

Loading new .tko via ftp

Hi there!

I have 2 very interesting questions:
1. Is it possible make this procedure:
If I send to Netlinx FTP server new compiled tko file, it takes it after restart and change previous version of program.
2. How can I send telnet commands via Netlinx.
I found by myself interesting TechNote http://amx.com/techsupport/techNote.asp?id=286

Comments

  • Options
    AMXJeffAMXJeff Posts: 450
    1) Currently you can download code via NetLinx studio or File Transfer, Why do you want to do it with FTP?

    2) Open a TCP/IP socket in code and send away... The TechNote you indicated gives you the code example for this TCP/IP Socket. But if you want the same information, just use the keyword GET_IP_ADDRESS;
  • Options
    jjamesjjames Posts: 2,908
    I find his question not at all . . . questionable? I have a job that I cannot get access to remotely, however I can access the outside world from the job. If something like this was possible - it'd be awesome if the server could go out, every minute or two and check an FTP server to see if an update is available, and if so - transfer the file to the master, then reboot and load up the code.

    I dunno - perhaps that's what he's going for - I know I am. :D
  • Options
    ericmedleyericmedley Posts: 4,177
    jjames wrote: »
    I find his question not at all . . . questionable? I have a job that I cannot get access to remotely, however I can access the outside world from the job. If something like this was possible - it'd be awesome if the server could go out, every minute or two and check an FTP server to see if an update is available, and if so - transfer the file to the master, then reboot and load up the code.

    I dunno - perhaps that's what he's going for - I know I am. :D

    It is doable if you connect the remote master to one that is accessable. Then you can device map through to the hidden one. I houses where I have multiple masters, I make sure to create a device for the sub-masters so I can send code to them too. That way I don't have to port forward all of them.

    I suppose one could connect the remote master to something like I have in the mothership. It's a Netlinx master here at my office.

    I wouldn't want it to stay connected all the time. but you could write in the code to connect up at certain points and be ready and standing by when it's connected.

    I dunno, I can think of lots of ways to make something like that work.
  • Options
    jjamesjjames Posts: 2,908
    ericmedley wrote: »
    It is doable if you connect the remote master to one that is accessable. Then you can device map through to the hidden one. I houses where I have multiple masters, I make sure to create a device for that master so I can send code to them.

    I suppose one could connect the remote master to something like I have in the mothership. It's a Netlinx master here at my office.

    I wouldn't want it to stay connected all the time. but you could write in the code to connect up at certain points and be ready and standing by when it's connected.

    I dunno, I can think of lots of ways to make something like that work.

    Yeah - that was my other option. Having the master connect to the one here at the shop and send via M2M - but didn't know if that's possible.
  • Options
    HedbergHedberg Posts: 671
    jjames wrote: »
    Yeah - that was my other option. Having the master connect to the one here at the shop and send via M2M - but didn't know if that's possible.


    Yes, that is very much possible.
  • Options
    jjamesjjames Posts: 2,908
    Hedberg wrote: »
    Yes, that is very much possible.

    Sounds good - I'll play with that today and see if I can get it to work. Now for the real problem - having the guys here at the shop leave my processor alone and quit swapping! I saw one on ebay that was super cheap - wonder if the boss would buy me one so I can have one here 100% of the time.
  • Options
    ericmedleyericmedley Posts: 4,177
    jjames wrote: »
    Sounds good - I'll play with that today and see if I can get it to work. Now for the real problem - having the guys here at the shop leave my processor alone and quit swapping! I saw one on ebay that was super cheap - wonder if the boss would buy me one so I can have one here 100% of the time.

    Mine is an ME-260. It's pretty much worthless to the techs. :)
  • Options
    HedbergHedberg Posts: 671

    2. How can I send telnet commands via Netlinx.
    I found by myself interesting TechNote http://amx.com/techsupport/techNote.asp?id=286

    You may have difficulty connecting to some telnet servers using this tn example. For example, the telnet server that comes with Windows XP Pro will not allow the connection. There was a discussion thread about this topic some time ago which explains how to go about figuring this stuff out:

    Telnet--Ethereal thread
  • Options
    jjamesjjames Posts: 2,908
    ericmedley wrote: »
    Mine is an ME-260. It's pretty much worthless to the techs. :)

    Haha - nice! I need one of those.
  • Options
    Thanks all guys. I read all threads about telnet and make all I want.

    AMXJeff. I want to find easy way to update program file from anythere. Now I'm in client's house, but soon I go.
  • Options
    I wrote a program for NetLinx that updates its URL list depending on the email I send it. Once it retrieves the Email it initiates a connection to my NI700 located on my DMZ. Now I could load code and even use the ports on the remote master to test code in realtime. Of course the remote Netlinx would need Internet access but it could remain behind a firewall.
  • Options
    jjamesjjames Posts: 2,908
    kbeattyAMX wrote: »
    I wrote a program for NetLinx that updates its URL list depending on the email I send it. Once it retrieves the Email it initiates a connection to my NI700 located on my DMZ. Now I could load code and even use the ports on the remote master to test code in realtime. Of course the remote Netlinx would need Internet access but it could remain behind a firewall.

    I got it to the point where I can load code remotely, but is there a way I can check variables, watch diagnostics, notifications, etc.?
  • Options
    ericmedleyericmedley Posts: 4,177
    jjames wrote: »
    I got it to the point where I can load code remotely, but is there a way I can check variables, watch diagnostics, notifications, etc.?

    If you're able to connect remotely via NS2, then all the other stuff should work. It's not all that fast, but it works. I'll quite often have debugger open wathcing variables while the client is using their system.

    ... but I'm kinda nosey that way...
  • Options
    jjamesjjames Posts: 2,908
    ericmedley wrote: »
    If you're able to connect remotely via NS2, then all the other stuff should work. It's not all that fast, but it works. I'll quite often have debugger open wathcing variables while the client is using their system.

    ... but I'm kinda nosey that way...

    Yeah - when I'm connected though, It shows me the variables loaded on the main master and not the master that's connected remotely. I have it connected like so:

    M2 ---> M2 <--- Me

    I can only see M1's variables & diagnostics, but can do online trees for M2.
  • Options
    ericmedleyericmedley Posts: 4,177
    jjames wrote: »
    Yeah - when I'm connected though, It shows me the variables loaded on the main master and not the master that's connected remotely. I have it connected like so:

    M2 ---> M2 <--- Me

    I can only see M1's variables & diagnostics, but can do online trees for M2.

    I wonder if a person could do a
    DATA_EVENT[local submaster port 1]
    {
    string:
    command:
    etc...
      {
      send_string(main_master), data.text
      }
    }
    
  • Options
    chillchill Posts: 186
    Hi there!

    I have 2 very interesting questions:
    1. Is it possible make this procedure:
    If I send to Netlinx FTP server new compiled tko file, it takes it after restart and change previous version of program.

    If you meant "tkn", i.e. a compiled program, then yes. I just did a writeup for the benefit of our service techs. The basic idea is that you ftp to the master, then PUT <your_program.tkn> to ../PROG.TKN. Then telnet in and reboot.

    For now, my writeup is at http://www.monochrome.org/amx/amx_upload.html
    2. How can I send telnet commands via Netlinx.
    I found by myself interesting TechNote http://amx.com/techsupport/techNote.asp?id=286

    Also possible. Use ip_client_open to the IP address of the server (or equipment), typically to port 23. Once the connection is established, you can send and receive strings as if to an RS232 device.

    If you use the master's own IP as the target IP (127.0.0.1 should always work), you can issue commands to the master from your program as if from a telnet session. Fun stuff.

    HTH.
Sign In or Register to comment.