We need to establish a wireless communication between two arduinos where one arduino will request information from another and the other one will send data in the format of 'colour-number' and the receiver will open and close an electrical circuit after reading both color and number. how manycomponents are necessary to do so?? and can anyone help with a basic code??
Get the 8266, install the library and look at the examples - remember this is a WiFi device and needs to connect to a network, it can’t send direct from one 8266 to the other .
hammy:
remember this is a WiFi device and needs to connect to a network, it can’t send direct from one 8266 to the other.
Actually, it can, and perfectly well. ![]()
There are two ways of doing this, one is to set up an access point on one to which the second can connect. Since the ESP8266 can do both these things (and I believe, both simultaneously if needed), that is quite straightforward. ![]()
The second is a protocol called "ESP-NOW".
How much are you willing to pay for the code? ![]()
Just kidding.
I haven't the code to hand, but if you know what you are searching for, it should be quite accessible, in particular the link I gave.
Another solution is the RF24 radios with regular Arduinos (meaning Uno, Nano, Mega, ...). The simple nrf24l01 tutorial shows how to use those radios.
Robin2 wrote a tutorial that has some basic code for ESP-NOW.
Meant to mention - you use an ESP8266 to replace an Arduino, not add to one. ![]()
Nisarg_Tolia:
We need to establish a wireless communication between two arduinos
That needs an Arduino and a wireless communication radio. Or a pair of ESP8266s. That's the parts you need.
But we don't know if this has a chance of working for you! This as you forgot to provide essential information such as the distance you want to transmit over, and the general environment the radios are in...
The best fastest cheapest ways have been mentioned
Not mentioned are
Zigbee
LoRa
Optical laser
Optical Infrared
Not mentioned because of expense, range difficulty, speed, absurdum etc.
Paul__B:
Actually, it can, and perfectlyThe second is a protocol called "ESP-NOW".
.
Esp now example gets you 90% of what you are looking for.
In the examplexample one sends the other responds.
You would have to put in what you want to be included
Thanks for correcting me Paul__B .
wvmarle:
That needs an Arduino and a wireless communication radio. Or a pair of ESP8266s. That's the parts you need.But we don't know if this has a chance of working for you! This as you forgot to provide essential information such as the distance you want to transmit over, and the general environment the radios are in...
the environment is pretty clear and it doesn't matter cause the communication that it will do is close ranged and won't depend on environment much
if you have two ESP8266, that is all you need.
you could add a simple sensor, switch, pot, temperature, etc
then have one send to the other and get a reply.
in your case, the one that send, really is sending. 'hello, tell me what you got"
the other one should send the data you are looking for.