Author Topic: Controlling a windows PC from a PIC chip  (Read 3640 times)

0 Members and 1 Guest are viewing this topic.

Offline picitupTopic starter

  • Regular Contributor
  • *
  • Posts: 240
  • Country: gb
Controlling a windows PC from a PIC chip
« on: March 08, 2015, 09:10:03 pm »
Hi All

This 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
If you know what you're doing, then you're not learning anything.
 

Offline DrGeoff

  • Frequent Contributor
  • **
  • Posts: 794
  • Country: au
    • AXT Systems
Re: Controlling a windows PC from a PIC chip
« Reply #1 on: March 08, 2015, 09:37:48 pm »
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.
Was it really supposed to do that?
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5140
  • Country: ro
  • .
Re: Controlling a windows PC from a PIC chip
« Reply #2 on: March 08, 2015, 09:45:10 pm »
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.
 

Online Alex Eisenhut

  • Super Contributor
  • ***
  • Posts: 3483
  • Country: ca
  • Place text here.
Re: Controlling a windows PC from a PIC chip
« Reply #3 on: March 08, 2015, 11:44:03 pm »
Try opening a command prompt and type
MODE
does a serial port appear?

Because redirection works like this

echo hello >com1

if you have a com1 present

I wonder if <com1 would wait for characters to appear on the com port?
Hoarder of 8-bit Commodore relics and 1960s Tektronix 500-series stuff. Unconventional interior decorator.
 

Offline ggchab

  • Frequent Contributor
  • **
  • Posts: 281
  • Country: be
Re: Controlling a windows PC from a PIC chip
« Reply #4 on: March 09, 2015, 08:59:25 am »
You could try CMD < COM1
And with SRVANY.EXE, this could even run as a service without having to write a special application.
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4193
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Controlling a windows PC from a PIC chip
« Reply #5 on: March 09, 2015, 10:25:42 am »
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.
 

Offline macboy

  • Super Contributor
  • ***
  • Posts: 2288
  • Country: ca
Re: Controlling a windows PC from a PIC chip
« Reply #6 on: March 09, 2015, 03:12:32 pm »
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).aspx
and
https://technet.microsoft.com/en-us/library/cc786105%28v=ws.10%29.aspx

That 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.
« Last Edit: March 09, 2015, 03:16:28 pm by macboy »
 

Offline dexters_lab

  • Supporter
  • ****
  • Posts: 1890
  • Country: gb
Re: Controlling a windows PC from a PIC chip
« Reply #7 on: March 09, 2015, 05:58:39 pm »
i used to use windows terminal server a while ago

you 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 bit

Create a separate user account just for the serial login with appropriate permissions.


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf