• @Gordon's 2nd approach is how to go about: I do not know in very detail how USB device type, id and relationship with driver goes. I just experience it when connecting what ever device, any (modern) operating system knows to pull a driver and install it and take it from there. Since a piece of software has to be installed on your host (being, for example the windows machine), security is a challenge when wanting Espruino to execute something. Kind of a pairing up as one has to do with Bluetooth has to happen - just a bit more secure.

    Since Espruino can act as a USB HID keyboard, you could try to become active and do something that almost all systems can do: start the desktop menu (shift/ctrl/...(?) F10(?) or a like in Windows - if not disabled or re-mapped - and go for execution a command.

    You can also high-jack the IDE, modify it, and use its abiity to communicate both ways. You still would have to launch the browser with the plug-in installed and execute a host initiated connect. It could be a starting point - and an easy one: the IDE is written in Javascript... ;-) To communicate, you still need some polling on the host side, but it could be against a file, because the IDE platform has ways to write Javascript controlled to files (see recording in testing feature). Pull down the plug-in, unpack it, and install it from local, and there you go.

About

Avatar for allObjects @allObjects started