0

I want two NodeMCU ESP8266s to communicate to each other, but I don't want them in a network. I was thinking about the transmitter could broadcast packets all the time and the reciever could use the promiscuous mode to capture and read the packets. How to do this?

EDIT: If this is not possible using the ESP8266 is there a chip which could do this(maybe a Raspberry PI and a NodeMCU or something).

  • 2
    If there is no network then there is no medium for broadcasting or receiving packets. Please explain what you’re trying to say or accomplish with “I don’t want them in a network”. – romkey Aug 24 '20 at 14:26

3 Answers3

2

If you solely want to communicate among ESP8266 devices I suggest you give ESP-NOW a go.

Espressif says

ESP-NOW is yet another protocol developed by Espressif, which enables multiple devices to communicate with one another without using Wi-Fi. The protocol is similar to the low-power 2.4GHz wireless connectivity that is often deployed in wireless mouses. So, the pairing between devices is needed prior to their communication. After the pairing is done, the connection is safe and peer-to-peer, with no handshake being required.

Here is a tutorial to get you started https://randomnerdtutorials.com/esp-now-esp8266-nodemcu-arduino-ide/

Marcel Stör
  • 22,695
  • 19
  • 92
  • 198
  • That's an interesting idea. Do you know if there is a way to "broadcast" in a way that does not require knowing the target's MAC address? Or maybe acquire a remote MAC address programatically? – Kingsley Aug 25 '20 at 06:09
1

ESP is a Wi-Fi device. Wi-Fi needs a network in order to establish link-level connectivity.

But you can easily create an ad-hoc network between two nodes: start one in AP mode and another in client mode, connecting to that AP.

For example:

// "Server"
#include <ESP8266WiFi.h>
void setup() {
  Serial.begin(115200);
  WiFi.mode(WIFI_AP);
  WiFi.softAPConfig(IPAddress(192,168,4,1), IPAddress(192,168,4,1), IPAddress(255,255,255,0));
  WiFi.softAP("my_ssid", "password");
}
// "Client"
#include <ESP8266WiFi.h>
void setup() {
  Serial.begin(115200);
  WiFi.begin("my_ssid", "password");
}

Then use your favorite protocol (UDP, MQTT, ...) to broadcast messages (UDP example). You can broadcast with UDP by sending to IP 255.255.255.255.

Note that there is a dedicated site for Arduino-related questions: https://arduino.stackexchange.com/

rustyx
  • 80,671
  • 25
  • 200
  • 267
  • OK, if WiFi is not the solution to my problem. I really do not want to create networks. What chip I could use to accomplish this? – Harold Trotter Aug 24 '20 at 12:35
  • For ad-hoc WiFi ESP-NOW would probably be a better alternative -> my answer. – Marcel Stör Aug 25 '20 at 06:00
  • @HaroldTrotter WiFi is by far the easiest DIY solution and recommendations are off-topic on SO. But there are many wireless options for IoT, e.g. CC1101, NRF24, Si4432, RFM95 (LoRa), ZigBee, LTE-M, etc., which you can combine with a microcontroller like Arduino or Pi. – rustyx Aug 25 '20 at 09:54
0

Nordic nRF24 Series allow easy point to point wireless transfering.

https://www.nordicsemi.com/Products/Low-power-short-range-wireless/nRF24-series

Zongru Zhan
  • 546
  • 2
  • 8