Hi gang! I have a project idea that would suit well to Arduino, but before I buy in, I want to make sure it works.
I want to have a network stream, where I can controll the Arduino board via websockets, or something.
It can be TCP (Ethernet - Arduino Reference). I prefer Serverside to be JavaScript on long term, but anything will do.
So questions:
to recieve network stream and act upon, I'll need Ethernet or Wifi shield? (one of the libs i'll later need metnions ATmega32u4, Leonardo or Micro.
Do you know any computer side libraries that will do that, or I have to write my own?
You can connect an Arduino to a PC using USB, so that can be done.
You can get Ethernet and WiFi shields for Arduino Uno, Mega etc so that can be done.
If you use an ethernet shield then you need to have a physical network connection, if you use a WiFi shield then the connection is wireless so you do not need a physical connection. Both connection types have limitations on the physical distances they can operate over and the environments that they can operate in. So you need to think about which suits your application.
The choice of Uno/Mega etc. also depends on what you want to do with it, and you have given no details about that.
The main constraints are the amount of memory and the amount of I/O that you need. So you need to get a rough idea of your requirements to decide the best card.
In principle you can have an arduino talking to one PC via USB and another PC via a network, but you need to flesh out the details.
As soon as you say WiFi, the advice is to swap to an ESP8266 or ESP32, not strictly an Arduino. Using a hybrid with Arduino plus ESP8266 is generally only complicating the matter of communication between processors. The ESP is a much more powerful processor and you can increase its I/O using expander boards with SPI or I2C.
A good one to start with as it is fully provisioned and really cheap, is the WeMOS D1 Mini.
Might be helpful if you just say what the end product is to do. If the end product is pc1 >.....> pc2, what does the arduino do? It is hard to give any info that comes from reverse engineering some thoughts about the project.
Thanks all for the answers. Let me detail my idea a bit
More on idea:
So I want to build a 'self driving car' project, that would run on a pc game, lets say f1. So PC2 would run the game, display on monitor. The game also provides telemetry data over the network, so PC1 would read that, and also the visuals from monitor (either via webcam, or screenshare prog, i didn't test them yet). PC1 would then calculate suggested input, and send it to Arduino, so it would send correct 'wheel' and 'pedals' input to PC1 and the game.
why i need Arduino
Main reason to need the Arduino is cause I'm not strong in C++ to do it solely on PC, and I haven't found any good libraries to emulate it properly. If I do it with Arduino, PC will also think its a real input device, what is a pro. That referenced Arduino gamepad library seems to work really nice. The arduino part is really just a 'pipeline', I wouldn't spend too much time on it.
dataflow
So I/O ops around 60fps, with 16 bit on a few axis, shouldn't be more than 6000 baud, but even with more I don't feel like it'll be bottleneck.