Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
Search
VC-4 lack of console for printing msgs
I have always been a fan of the good old method of printing stuff to console for some basic debugging and even some exception handling (in addition to saving to a log file etc)...? But as we all know, VC-4 does not give us a console.
?
During Master's 2022, I remember seeing their suggestion of outputting "Error" and "Notice" strings to Simpl? so we could watch it in debugger... this looks like an ok idea but it does not help much when trying to debug Simpl#Pro stuff.
I also remember at the first virtual Master's in 2020, I think Toine or one of the other guys developed a quick and dirty way of emulating the console using a telnet connection (I think it was telnet, but I don't remember exactly). This also seemed alright, but it was definitely unsecured.
?
My question is: anybody out there *created* their own "console emulator" for printing out messages, statuses etc? If yes, what approach did you take?
I'm wondering about creating an SSH Server or something along those lines that I can connect to with Putty or MobaXterm which could give me some resemblance of a console that I can monitor for print/trace statements... but I wonder what some of you guys recommend?
Does anybody miss the ability to print stuff to console as a means of live debugging or am I the only one?!??It would be so nice if Crestron could create a console for VC-4....
I was never fan of the "attach-to-process" method of debugging because it seems to be pain to get going most of the time and also requires a restart in certain scenarios (which is a no-go if you are trying to catch a bug in the act).?
|
¿ªÔÆÌåÓýI know that CrestronConsole.PrintLine (I don't know about SIMPL+ PRINT or TRACE) definitely shows up in the syslog, so it's not completely gone. https://support.crestron.com/app/answers/detail/a_id/1001239?
Caleb Radecky | Manager, Online Products & Services
Crestron Silver Certified Programmer | DMC-D-4K | DMC-E-4K
ControlWorks Consulting, LLC | Crestron Services Provider | 8228 Mayfield Rd. #6B Rear Cleveland OH 44026
D. 440.771.4809 | O.440.449.1100 X1109 | F.440.449.1106 | http://www.controlworks.com
From: fabiodaubermann <fdaubermann@...>
Sent: Thursday, October 13, 2022 00:08 To: [email protected] Subject: [crestron] VC-4 lack of console for printing msgs I have always been a fan of the good old method of printing stuff to console for some basic debugging and even some exception handling (in addition to saving to a log file etc)...? But as we all know, VC-4 does not give us a console.
?
During Master's 2022, I remember seeing their suggestion of outputting "Error" and "Notice" strings to Simpl? so we could watch it in debugger... this looks like an ok idea but it does not help much when trying to debug Simpl#Pro stuff.
I also remember at the first virtual Master's in 2020, I think Toine or one of the other guys developed a quick and dirty way of emulating the console using a telnet connection (I think it was telnet, but I don't remember exactly). This also seemed alright,
but it was definitely unsecured.
?
My question is: anybody out there *created* their own "console emulator" for printing out messages, statuses etc? If yes, what approach did you take?
I'm wondering about creating an SSH Server or something along those lines that I can connect to with Putty or MobaXterm which could give me some resemblance of a console that I can monitor for print/trace statements... but I wonder what some of you guys
recommend?
Does anybody miss the ability to print stuff to console as a means of live debugging or am I the only one?!??It would be so nice if Crestron could create a console for VC-4....
I was never fan of the "attach-to-process" method of debugging because it seems to be pain to get going most of the time and also requires a restart in certain scenarios (which is a no-go if you are trying to catch a bug in the act).?
|
In at least one version of the manual, it gave instructions about copying a .conf file into rsyslog.d directoy to create a creston log file that you could print to with the error.notice function then ssh sudo tail -f /var/log/crestron/crestron.log and watch the log in realtime.
1. Move the 50-default.conf file from [VirtualControlHome]/samples/conf_files to the /etc/rsyslog.d/ directory. 2. Issue sudo systemctl restart rsyslog.service to restart the system logging service. |
Hi?chrmac68,?what direction did you take with that? CWS, SSH, STCP Server, etc? I really like your idea of being able to input console commands as well... it is always nice to be able to "turn debug on" and "turn debug off" straight from a console interface. |
So it seems like the Exceptions, Errors and Notices are saved to a file and can also be printed on the linux command line as they happen. Which is great.
However, I am still looking for the ability to issue a simple "print" command that does not save to a file and all it does is display some text on the screen (this helps a lot when debugging in realtime).?
?
Based on what @LightDemon wrote, It looks like we can "repurpose" the error.notice to write to a file which is separate from the exceptions and errors, correct?
If this is true, this is kind of a decent workaround... All I am looking for is the ability to output some live text in a console without polluting the actual error logs.?
The way I see it:
Error logs should only contain the exceptions and errors while "print" statements should be ephemeral and only aid with live debugging... I'm not sure why this seems to be so difficult.
Thanks for all the tips, I will dig into the manuals. |
We created a simpl#pro program that get¡¯s loaded in one of the program slots on VC4. It allows for a programmer to login with credentials and choose which program instance names running to watch, using a filter console command. Each of the other program implements the companion ¡°Debug¡± class that communicates with console program. Pretty easy and works as expected. This was written when only SIMPL#Pro programs ran on VC4.?
|
Tim's code from Masters 2022 MSS-431 has a VirtualConsole class suited to this purpose.? You can telnet in and even have it re-print the previous debug messages.? You can find it linked from his presentation in OLH 2015. On Fri, Oct 14, 2022 at 9:36 AM jeff via <jeff.mackie=[email protected]> wrote: Yes sorry... Program Instance. In our case we use a spare room license for debugging, and stop that program when we are done. You could actually do something similar by creating a program/cron that runs on the linux server. |
to navigate to use esc to dismiss