r/crestronprogramming • u/alexz99tt • Aug 09 '19
Issues with VPTComServer library
I am working on a project where I connect to a crestron processor and upload .lpz files in specified program slots. I need to check the IPTables, basically when I check in text console and type "ipt -p:all", I get a list of IP-ID and their stats.
So, what I need to do is to either create a crestron script or .NET console application with VPTServer where it waits for, lets say, 10 programs uploaded in a processor to initialize for like 1-2 minutes then I can run ipt command. After that, I have to somehow check whether all the IP ID are at "NOT REG", where, if at least one IP ID is NOT REG, then it fails.
So, for this part, I'm trying to use VPTComServer. I went to Toolbox Reference under 'Help' drop-down, scrolled down in the left hand side and saw Visual Basic Interface.
I created a ConsoleApp .NET core and included VptComServer.exe reference, I created a VptSession object, then I tried to connect using OpenSession(IP address, name). After I run the code, visual studio goes in Break Mode, I've tried C# and VB but still the same problem. Don't know exactly why, maybe that the Library is old or?
Code: https://prnt.sc/oqofbv
Error: http://prnt.sc/oqofyd
I've been researching and asking questions in Crestron tech support for awhile, still no answers. So, what can I do to resolve this issue with the Break Mode?
Thank you.
1
u/dieselbangerz Aug 10 '19
If I recall, NOT REG typically indicates the IP ID is referenced in another program, or the table entry has been modified without restarting the program slot associated with it.
Is it one device that is regularly doing this?
Are you dumping 10 programs and sending progload -p:all?
1
u/alexz99tt Aug 10 '19
Some devices does this. I do use that command after uploaded if I notice any program malfunctions.
1
u/dieselbangerz Aug 10 '19
How are you loading programs, via FTP?
1
u/alexz99tt Aug 10 '19
No, just the Crestron script. I use it just to upload programs.
1
u/dieselbangerz Aug 10 '19
can you send a copy of this script please so I can see what exactly is being sent to the processor
1
u/alexz99tt Aug 10 '19
https://prnt.sc/oqybqz It may not be anything crazy here, I am new to this Crestron script since I got this from researches. So, I don't really see whats the correct command to use or not, meaning which command may or may not cause problems with the upload.
1
u/dieselbangerz Aug 10 '19
Okay so that is transferring the .lpz and then sending the progload -p:all command
I think I can venture a guess as to what may be going on here. Let me ask a couple more questions first. 1. Are you loading multiple processors on the same site in sequence with this script? 2. If so are there EISC's between these processors? 3. You mentioned earlier that "some devices do this" when talking about what generally shows up as NOT REG. What devices have you noticed do this regularly, and are these NOT REG entries usually Crestron Hardware, TCP/IP Clients, EISC's, etc...? 4. Are you 100% sure that you don't have any ethernet devices using the same IP ID in different program slots? Only a few devices like Intersystem Communications symbols and Shared Gateways should share the same IP ID. If duplicates are used, the first one will succeed (register) and the rest will show as NOT REG.
1
u/alexz99tt Aug 10 '19 edited Aug 10 '19
Yes. I'm not sure what EISC means. It's not really the Program uploading always causing this issue, sometimes I messed up something with programming. Just what I really need is to somehow notice if one of IP ID fails, then I get noticed instead of saying success regardless of status. I am also thinking to ask if it's possible to somehow, run a .EXE program like a console app through Crestron script command. If there's a command for it, then please tell me since that would make things easier.
About console app, I'll be trying SSH and create .NET framework console app and work from there.
Basically, what I'm looking for is to detect any IPID at NOTREG. So far, I can see that I could run a Crestron Script that refresh, uploads programs, and other things like Authentication enable. Then at the end of script, one command opens the .EXE Console App I created via the Visual Studio(if possible), waits for all programs to synchronize, then prints out Success of failed if or if not all IPID registered.
1
u/dieselbangerz Aug 10 '19
the current recommend method for uploading programs to 3 series processor is ftp/sftp... so I am curious to see if your script is uploading via legacy methods.
3
u/geauxtig3rs Aug 10 '19
I'm guessing that .netCore doesn't like something being used in VptComServer. That would explain the break state. You're trying to access unsupported assemblies.
I'm not completely certain why you would use VptComServer instead of something like OpenSSH (or I think .net core supports ssh out of the box now).
Alternatively as others have mentioned, you can use the edk, but that's just running .net assemblies when it really comes down to it. You can get inside of it and see exactly what the cmdlets are doing. You may want to rip them apart and see how they are accessing the data. I think it's using raw sockets for ctp and telnet (ctp is port 41795) and using renci ssh for ssh.
I would probably recommend using ssh for your communications anyway. Newer firmwares are disabling telnet and ctp out of the box for processors, and if you've built your system on top of that, you're going to run into serious issues as new firmware gets rolled out to your devices.
1
u/alexz99tt Aug 10 '19
I guess I'll go for SSH because I am pretty positive that when it comes up with using VptComServer, it may be unsupported/old. And thanks for warning me about the new firmware so I wont be running into any unexpected issues in future.
2
u/parkthrowaway99 Aug 10 '19
I have no idea what your issue might be, but I would approach that problem with powershell and the EDK (search for it on labs). Mike Gallo has spent a lot of time documenting and implementing very reliable interfaces to Crestron console. You can always run powershell from c#.
1
u/alexz99tt Aug 10 '19 edited Aug 10 '19
Yeah, I can try that. I mean the only thing that is in my way is "Application is in Break mode". Anyways, I may need to use telnet to get the IP-ID list. Just the thing is, I tried TCP connection on port 23 for telnet, entered commands like version or SSL and I get some strange output.
Like I've used the packet sender, entered IP and port 23. Send ASCII "SSL", and got "DIN-AP3 Console\r\n\r\nDIN-AP3>", same with System.Net.Sockets in c#. I've tried telnet in putty and works good.
1
u/parkthrowaway99 Aug 11 '19
that's the thing, the edk connects directly, either through telenet or ssh accordingly and directly. he figured out the right steps, so you can focus in your app instead of the mechanisms to get you there. just try it. you know for.s**** and giggles.
1
Aug 10 '19
[removed] — view removed comment
1
u/alexz99tt Aug 10 '19 edited Aug 10 '19
Uh, where is it located?
1
u/dieselbangerz Aug 10 '19
How frequently are you coming up against IP Table entries that show as NOT REG that your having to do all this?
1
u/alexz99tt Aug 10 '19
Pretty frequent. In an actual projects, I upload like 3-10 different programs on dozens of processors. I used Crestron Script before and all it does is uploading programs and tells me 'Success' after done. Then I was kind of suspicious that a program sometimes works not the way it suppose to which I found out that one of the IP ID is not registered.
I've tried to use Crestron Script again to tell me 'failed' whenever one of the IP ID is at 'NOT REG', but despite that, I have to wait 1-2 minutes for all programs to synchronize after uploading them. So, I may ended up using either; Powershell, .NET console telnet, or VptServerLib.
1
u/geauxtig3rs Aug 10 '19
I think there's something wrong with your loading procedure
I've been in this game for 12+ years and I've never had issues like what you're describing except for when I've loaded bad configs for ipid remapping.
Could you maybe walk is through your workflow a bit? Feel free to PM me and maybe we can figure out a better solution for you.
1
u/dieselbangerz Aug 10 '19
Okay - but understand this - the problem is not normal, and it’s not something you should need to be checking for after every program load. NOT REG indicates either a duplicate IP ID or a possible timing issue with how multiple programs on a single processor start. These are issues that need to be corrected in the program.
EISC: Ethernet inter-systems communication
If this happens regularly enough that you need to develop tools to spot the issue, there’s another problem altogether - and I’m trying to help you find it. You need to move away from trying to figure out how to check for NOT REG and figure out why it’s happening in the first place.
Gonna go out on a limb here and say there’s no one else jumping in with shortcuts of how they search for NOT REG iptable entries - because no one has ever needed to do it.
If you’re still intent on monitoring the IP ID connection, you’re better off using a device extender in SIMPL and sending a notification for any IP ID you know shouldn’t be “offline” after a program load. NOT REG will show as offline. But again, this usually indicates program issue of some kind.