Controlling a windows PC from a PIC chip - Page 1
Forum section: electronics / projects

author: picitup
author_rank: Regular Contributor
timestamp: March 08, 2015, 09:10:03 pm
content: Hi AllThis is my first post and I hope I'm in the right section. I'd like to control my Vista laptop from a PIC chip in the same way you can open a command shell using a UNIX terminal server.I'd like to be able to access the command prompt via the RS232 port and send commands to it. I've spent much of the day searching and the only thing that is close is the windows EMS/BCDEdit system, but I'm not sure if this will work with a USB/RS232 adapter as it starts up at boot time and the drivers for the adapter will be loaded much later. Being a laptop, I can't add a physical RS232 card.Am I the only one bonkers enough to want to do this? I've found a gazillion terminal emulators (clients) but need an ASCII based terminal server which will allow me access to the command prompt.I'd be grateful for any pointer as I'm starting to lose the will to live :-)Thanks for reading....Steve

author: DrGeoff
author_rank: Frequent Contributor
timestamp: March 08, 2015, 09:37:48 pm
content: You will probably have to write a program (service) that runs on the Win machine to listen to the serial port and perform various tasks in the background according to the instructions received. I don't think there is a getty equivalent in Windows, since it is a graphical UI, not terminal based like Unix.

author: mariush
author_rank: Super Contributor
timestamp: March 08, 2015, 09:45:10 pm
content: IF the computer is not used by people, it would probably be somewhat easier to use a PIC microcontroller with USB built in, and simulate a usb keyboard with the pic. you'd just open a command prompt and leave it open, windows would detect pic transmissions as key presses and everything works smoothly.Otherwise, yes, you would have to code a small monitoring app that connects to rs232 and reconnects on timeout and depending on what it receives, it does crap.May be useful, may be not so much : do some searches for WinLIRC (http://winlirc.sourceforge.net/) , which is some software implementation of something for remote controls - i'm thinking you connect an infrared sensor to pc using rs232 or usb and such software monitors for remote control button presses and then converts the infrared messages to hotkeys and buttons which are caught by various programs.Could be useful to have a peek at the source code, or make your PIC send data to the rs232 port as if it's a remote control stream of bits (what the infrared led would catch from the remote control) and use already written WinLIRC on the computer.

author: Alex Eisenhut
author_rank: Super Contributor
timestamp: March 08, 2015, 11:44:03 pm
content: Try opening a command prompt and typeMODEdoes a serial port appear?Because redirection works like thisecho hello >com1if you have a com1 presentI wonder if <com1 would wait for characters to appear on the com port?

author: ggchab
author_rank: Frequent Contributor
timestamp: March 09, 2015, 08:59:25 am
content: You could try CMD < COM1And with SRVANY.EXE, this could even run as a service without having to write a special application.

author: Jeroen3
author_rank: Super Contributor
timestamp: March 09, 2015, 10:25:42 am
content: Windows is supposed to have a Telnet server. You can use third party applications to tunnel the Telnet server to a physical serial port.I'm sure Windows Server supports a shell over a physical serial port. But I do not know if that would work.Maybe such feature is dormant in normal Windows versions.

author: macboy
author_rank: Super Contributor
timestamp: March 09, 2015, 03:12:32 pm
content: I googled "Windows serial administrative console" and good lots of good information in the first few hits. You already found EMS, and I think this is the way to go.http://msdn.microsoft.com/en-us/library/ff542282(v=vs.85).aspxandhttps://technet.microsoft.com/en-us/library/cc786105%28v=ws.10%29.aspxThat seems to be the closest thing you will get to an old-school UNIX serial console. The fly in your ointment may be the use of a USB-serial solution. You could try using a PC card or expresscard serial port card; these will add a "real" hardware UART serial port, which should be usable by EMS (though lack of BIOS support may get you too...).If you want only a command prompt from a properly up-and-running Windows box, then you can also research setting up telnet or a ssh shell. Yes, it can be done. Yes, it is built into Windows, you just need to turn it on.

author: dexters_lab
author_rank: Unknown
timestamp: March 09, 2015, 05:58:39 pm
content: i used to use windows terminal server a while agoyou still need to login, if your using RS232 then it'll be sent cleartext, if this is just for your own home use then fine, but if not you might want to think about security a bitCreate a separate user account just for the serial login with appropriate permissions.