Controlling the Master from Batch Files
deepforestgreen
Posts: 51
I'm trying to see if it's possible to control a master from my computer with simple batch files. I realize, of course, that I can use telnet or webcontrol, but I'd like a quick method of rebooting a controller, or calling up a function/call without logging into anything. Nothing flashy needed.
It makes sense that I can use IP_Client_Open to set up communications between the master and the PC. And the data_event -> string section of the code should make it easy to call up functions based on incoming strings. But I don't know how exactly to send a string to the master over the network.
Anyone tried this, before?
It makes sense that I can use IP_Client_Open to set up communications between the master and the PC. And the data_event -> string section of the code should make it easy to call up functions based on incoming strings. But I don't know how exactly to send a string to the master over the network.
Anyone tried this, before?
0
Comments
Try looking at SecureCRT from VanDyke Software. It supports telnet, SSH, serial, and others. You can script it with VBScript, JScript, PerlScript, and Python. I've used it for a while now and I love it. The same company makes SecureFX which is a file-transfer software for FTP, SFTP, and others. It comes with a utility SFXCL that can batch script file transfers, but can't use the advanced scripting that SecureCRT can.
There's also Indigo from shadeBlue. I only briefly used it due to it being a bit crashy, but it too does scripting, though I believe only VB, and has some pretty neat built in features that allow for "on the fly" scripting with a user-defined command library, variable library, and "command repeater". It has more "nifty" features and eye-candy than SecureCRT, which I assume is why it would crash a bit more. Sometimes simpler is better.
Enjoy!
-Nick
P.S. There's a new version in beta for Indigo. I haven't tried it.
Any more brainstorming out there?
Edit:
Finished, tested and working . . . this assumes:
1) Device 5001 exists on the system, as that is the "source" device.
2) ICSP Encryption is OFF
Powershell Script:
Batch file - substitute the name of the PS file with your own and 10.24.42.99 with the IP of your master.
As a quick side note, this is the first time I've done anything with PowerShell - and you know what? Thanks for making me venture into it. Seems like a handy scripting service, especially being familiar with .Net.
What other things? If you understand AMX's ICSP, you could do a lot, but honestly, I wouldn't waste my time. I'd rather write a full-boat .Net program to do what I wanted (which is what I did.)
Anyway, have fun & enjoy!
Speaking of ICSP - I find this very interesting....
http://findarticles.com/p/articles/mi_m0EIN/is_1999_June_10/ai_54852374/
Keep in mind, AMX has never released their encryption algorithm, you'll have to dig deep for that. I'm not saying, I'm just sayin'.
Would be interesting to see it though.
Would I be correct in assuming that the long system byte is the hexadecimal version of the reboot command? Should I be able to change that to some other command to do other things?
Yes and no. It's the ICSP command to reboot a device. You'd need to read up on the ICSP patent to know what to change.
I cannot help with that though - sorry.
Glad it's working.
Sent from my iPhone using Tapatalk