Telnet Console

This is probably the wrong place to ask this question. I am sorry for that but can’t find a better place.

My python script is printing information to the screen that is useful for debugging purposes. When I start the python script by telnetting into the X4 and saying “python dia.py” it prints to my telnet window. Often I get disconnected from telnet for whatever reason, but the script continues to run (I think). Is there any way to get access to the information that is being printed after this happens? I suppose I could generate a log file, but that is a new can of worms I would avoid if I could.

Thanks,

Mike

Good and Bad news :slight_smile:

Bad: There is no way to re-tap into the print stream after you manually start your Python. When you disconnect, the STDOUT gets redirected to a null-device/bit-bucket.

Good: But if you set up your python to auto-run, then using telnet you can run the command “set trace state=on mask=printf:*” at any time to see what is being traced. This means you can come to a unit which has been runing for weeks (years) and tap into the trace info again.

That’s one of the strange design decisions that Digi made when designing the DIA.

To work around (part of) this issue, I used the logging module for my code, and combined with a TCP logger I can connect to the stream to see my debug output after a device reboot.

I only wish Digi had used the logging module as well so I could get the main debug output too, but hey, nothing is perfect :wink:

See this thread for information on how to add the logging module:
http://www.digi.com/support/forum/viewthread_thread,8630#25861

Good to know, thanks Lynn!