# ESP 8266 and Raspberry Pi communication without an Internet connection

I am currently working on a project which uses an ESP8266, accelerometer sensor and Raspberry Pi 4. The ESP module has to send the accelerometer data to the Raspberry Pi and the data has to be stored in the Raspberry Pi memory card in Excel or .csv format. I want the system to be portable so that there is no setting up process required when I take the system somewhere else. Just by switching on the Raspberry Pi and sensor, it automatically connects and starts sending data to the Raspberry Pi...

Is there a way to achieve this?

I am a beginner to Raspberry Pi and IoT, but I have basic knowledge in Arduino.

On the next level, I want multiple ESP modules to connect to a single Raspberry Pi (8). Is it possible?

• Ah yes, your post is confusing. First of all, ESP8266 is a WiFi controller, so it cannot earn a living without connected to the internet. Now Rpi can connect to the Internet through a (wireless) WiFi router or (wired) Ethernet. Now suppose your e 3-in-1 whole thing, ie Rpi + accelero + ESP8266 is moved outside, away from your, say, home, which has the home WiFi router and Ethernet connected to your ISP (Internet Service Provider). Then you can now only rely on the small guy ESP8266. Anyway, now fun begins: ESP8266 can now start its WiFi job (don't ask me how, I am only a ESP newbie!:). – tlfong01 Jan 24 '20 at 9:03
• @tlfong01: Nope. WiFi is a local network connection, doesn't require access to the Internet at all: the ESP8266 can operate as WiFi client, and a RPi can operate as a WiFi AP (hotspot). Direct link, no internet required. – Piskvor left the building Jan 24 '20 at 12:49
• @Piskvor left the building, many thanks for pointing out wrong concept. I think I need to google and read more before thinking deeper. – tlfong01 Jan 24 '20 at 13:15
• For a university robotics project, we once grabbed a cheap wi-fi router and hacked together a way to power it from our robot's battery. That would be a fun idea if the Pi couldn't already do it. – user253751 Jan 24 '20 at 18:14

You could have the Raspberry Pi behave like a WiFi access point (using hostapd and dnsmasq, introductory documentation from the Foundation is here) with a static IP and then have the ESP8266 join the hosted network and send the data to the Pi's IP address. The advantages are that you can also connect to the Pi from a PC or mobile device if you need to and it's relatively simple to add more ESP8266 modules with extra sensors if you needed to in the future (as far as the hardware is concerned anyway).