1

I'm using a Raspberry pi and it has to behave differently when connected to Linux or Windows system using the USB Port. I tried to find a solution using linux USB Gadget but it does not come with such a distinction feature. So I need to know whether it's a Windows or whether a Linux OS after connecting it.

How can I possibly catch this event?

I would very much appreciate any help or guidance regarding this. Thank You.

Dinesh.hmn
  • 713
  • 7
  • 21
Funator
  • 11
  • 1
  • 1
    The easiest way I can think of is writing a code that executes when the Pi gets connected using a usb. When that happens, run the code and detect the OS. It could be a small python code like this http://stackoverflow.com/questions/1854/how-to-check-what-os-am-i-running-on-in-python – Dinesh.hmn Dec 17 '16 at 20:17
  • Thank you Dinesh, this is a good idea but i dont want to know on which the PI runs. i want to know on which the computer runs im connected to. assuming that i dont know the mashine and have no power over it. – Funator Dec 17 '16 at 22:43

0 Answers0