Can I communicate between two arduionos using an ESP8266 on each one without having to go through a router?
Yes, the ESP8266 can be configured as an "access point" (like a router), as a "station", or as both.
In your case you will have one node configured as a station and one set as an access point to form a two node stand alone system.
Excellent, Thanks
Additional question.
Years ago I wrote a VB program that used the Internet to communicate between two computers.
As I recall, I used "socket" programming. I would merely use a function like connect along with the IP address to connect to another computer that had socket to receive.
Once I got a "connected" response I could send data back and forth as I would using a serial connection.
Is something like this available for this wi-fi device?
Read this guide, and start experimenting with two stand-alone ESP8266 based boards like the NodeMCU or WeMosD1 mini.
Leo..
barryjo:
Can I communicate between two Arduinos using an ESP8266 on each one without having to go through a router?
Yes, except ...
If you have ESP8266s, which have massively more computing power than ATmega328s, why would you be using the Arduinos?
barryjo:
Additional question.Years ago I wrote a VB program that used the Internet to communicate between two computers.
As I recall, I used "socket" programming. I would merely use a function like connect along with the IP address to connect to another computer that had socket to receive.
Once I got a "connected" response I could send data back and forth as I would using a serial connection.
Is something like this available for this wi-fi device?
There are many different paradigms for using the ESP8266. In your original post you refer to using it as peripheral communications device which probably implies using the "AT command" mode. In this case the ESP8266 is a serial device which is configured by sending it instructions via "AT commands" (an old modem protocol) and once configured it behaves, from the Arduino's perspective as a serial port. Internal to the ESP8266 there are socket transactions being performed but they aren't visible to the Arduino.
The most basic ESP devices (e.g. ESP-01, ESP-07, ESP-12, . . .) are usually sold flashed as AT devices.
At some point developers recognized that ESP8266 devices could be programmed directly rather merely operating as a pre-programmed peripheral to a primary microcontroller and a wealth of ecosystems have been developed to do so. These include an Arduino (C++) environment, NodeLua (Lua interpreter), and microPython interpreter. These environments have libraries allowing WiFi device programming at various levels including at the socket level.
There have been a number of boards introduced that break out GPIO and provide USB interfaces that are intended to be used with these environments including NodeMCU, Sparkfun Esp Thing, etc. These may come pre-flashed with Lua (most often) or microPython interpreters but it is a simple matter to re-flash to any of the above.
The Arduino environment is described in detail at the link in post #4 above. MicroPython is well documented by the development team here. NodeLua is documented here.
Most of my own work with ESP8266 recently has been with microPython on NodeMCU boards (LoLin "V3" and WeMos), but there are advantages and disadvantages to each.
barryjo:
Can I communicate between two arduionos using an ESP8266 on each one without having to go through a router?
If that is all you want to do you may wish to consider using the ESP-NOW feature
...R