As the title says, is it possible to launch an exe or run a command when I plug my raspberry pi into my computer so that the program launches ON THE PC/MAC. I know you can auto boot something when you plug in a usb drive but I’m not sure how you would achieve the same thing with the pi.
-
1What do you mean by plugging the raspberry pi into computer? Pls be specific. How you are connecting your raspberry pi to the computer?– theashwanisinglaNov 23, 2019 at 11:53
-
My apologies! Just a simple 3.0 USB cord– user2544427Nov 23, 2019 at 14:37
-
@user2544427, to launch a program on the PC/MAC, you'd have to run something on that computer. I reccomend a Python script for that, Mac already has Python2 preinstalled. Of course, the RPi could emulate some sort of media device (which would be complicated) but would only allow a default dialog.– user96931Nov 23, 2019 at 18:37
-
Welcome to Raspberry Pi :-) But running programs on a PC/MAC is off-topic here on Raspberry Pi. Please take the short Tour and visit the Help Center to get an idea how things work here. You should ask in an appropriate forum.– IngoNov 23, 2019 at 18:53
1 Answer
I don't have an answer but I do have an alternative I'm probably going to try myself.
At the end of the day the goal is to plug in a device and require little to no setup correct?
My idea is to connect the raspberry pi in gadget mode using the gadget_cdrom
library.
Then you can write a program in python or something to make it cross platform, provide an exe for windows and add an autoplay.inf
see how to here.
I'm pretty sure most pc's don't allow for autorun anymore but at least it'll allow anyone to just click the drive icon and start the program on windows.
Then in your python app you can just ssh to raspberrypi.local
or something like that. And on the raspi side create a user that can only run one ssh command for the python program.