This is a similar question to a previous question I have asked. Primarily I am looking to find out more about the capability of the Arduino. Here is the scenario. There is a PC that is connected to a database via local network or internet. Is it possible that by plugging an Arduino in the usb port of this PC the Arduino could read from this database by means of an SQL query? Given that the Arduino would have the correct credentials. I am not asking if the Arduino could Hack into the database. I am asking if it is capable of accessing the database at all. Also this must be done without installing any special program on the PC. If that isn't possible, what type of program is needed? I am not necessarily looking for a tutorial, but if you could point me in the right direction that's be great. Thank you.
-
What kind of Arduino?Majenko– Majenko2020年10月02日 14:10:46 +00:00Commented Oct 2, 2020 at 14:10
-
It's actually a Trinket M0. Not Arduino brand, but I can get a different Microcontroller if necessary.Vantiken000– Vantiken0002020年10月02日 14:30:37 +00:00Commented Oct 2, 2020 at 14:30
-
buy an Ethernet or WiFi shield. nobody reads the database over USB and PCJuraj– Juraj ♦2020年10月02日 14:39:41 +00:00Commented Oct 2, 2020 at 14:39
1 Answer 1
The M0 has a "native" USB interface. Because of that it can be programmed to appear as any kind of device you can image - as long as you can find (or write) the code to do that.
You could (though I have never tried and don't know what code is readily available for this) program the USB interface to be a USB Ethernet device. Your computer would then see it as a new Ethernet interface.
It would then be trivial to "share" your internet connection in Windows with that new Ethernet interface (nothing to install, but settings on the computer need changing), and your Arduino would then be on the network the same as your computer (just as if you'd given it a WiFi interface or something like that). Then it can connect to the database itself (or to a website that communicates with the database if that is simpler) and do whatever it needs to do.
Step one, of course, will be to find a library that will give you that USB Ethernet interface...
A much simpler option, if you're willing to change your M0 for something else, is to use a chip with a built in WiFi interface, such as the ESP32. There's no need for your computer at all then.
-
TCP/IP over UART is simpler. as null modem connection. there is a library but I don't know if somebody uses it2020年10月02日 14:43:38 +00:00Commented Oct 2, 2020 at 14:43
-
Thank you for the responseVantiken000– Vantiken0002020年10月02日 14:45:34 +00:00Commented Oct 2, 2020 at 14:45
-
@Juraj You mean SLIP, or PPP? Simpler to program on the Arduino - harder to set up on the PC end.Majenko– Majenko2020年10月02日 14:47:15 +00:00Commented Oct 2, 2020 at 14:47
-
-
@Juraj I rest my case: the Windows instructions (a PDF) no longer exist (good job I speak Swedish...). And there's no DUNS in home versions of windows any more. So a nightmare to set up...Majenko– Majenko2020年10月02日 14:59:44 +00:00Commented Oct 2, 2020 at 14:59