Go Down

Topic: WiFi Modul ESP8266 ESP-12-E and Arduino Due (SPI Communication) (Read 4718 times) previous topic - next topic

DrDooom

Hello everybody,

I 'm stuck again. Yesterday I have been involved to operate my WiFi module ESP8266 ESP-12-E (standard firmware).
I soldered a few wires and plugged everything onto a breadboard.
I'm ready to configure the WiFi Chip with the TX / RX pins and AT commands.
To get feedback from the chip, I returned the feedback of the chip via TX / RX pins (Serial1) to the Arduino Monitor (Serial):
Code: [Select]
while (Serial1.available ()> 0) {Serial.write (Serial1.read ()); }
This also works very well.
I have configured an Access Point and I can connect with my Win PC and my smartphone. The WiFi module is also accessible by Ping.

I have configured my ESP8266 WiFi Chip with this AT Commands:
Code: [Select]
AT+CWMODE=3
AT+CWSAP="Skynet","********",13,4
AT+CIPAP="192.168.255.1"


##### My problem #####
As a next step I wanted to implement an Ethernet server on the Arduino Due to share data (commands / images / videos) between Arduino and client.

I read in the Arduino reference that the class "ETHERNET" works with the pins 50-53 (SCK, MOSI, MISO and SS):
https://www.arduino.cc/en/Reference/Ethernet

So I have connected the Chip pins SCLK, MOSI, MISO and CS0 to the Arduino. I have not made any changes to the program code.

Having thus connected the pins with the Arduino, I can no longer connect via WIFI and I get strange messages via TX / RX (Serial1). See image. By the way my LCD Display weaves too.

Here is the Pin Layout:
VCC      ->   3.3V
GND     ->   Ground
EN         ->   3.3V
TXD0     ->   Arduino RX1 (Pin 19)
RXD0     ->   Arduino TX1 (Pin 18)
GPIO0   ->   3.3V (Boot Mode Selection)
GPIO2   ->   3.3V (Boot Mode Selection)
GPIO15   ->   Ground (Boot Mode Selection)
SCLK    ->   Arduino Pin 52 (SPI)
MOSI   ->   Arduino Pin 51 (SPI)
MISO   ->   Arduino Pin 50 (SPI)
CS0      ->   Arduino Pin 53 (SPI)

Does anyone knows why i have this problems after connecting the 4 SPI Pins???

rw950431

The ethernet module uses SPI for communications with the Arduino, the ESP8266 uses serial so you will have to undo all your rewiring..  you will have to revert to the original wiring which worked. The ESP8266 can be configured as a basic webserver but you will have to re-flash the firmware to nodeMCU or similar (I dont think it can be done with AT commands)

Its unclear exactly what you hope to achieve with your web-server.  The arduino or ESP8266 is not really suited to running a real website. You can find lots of examples how to serve a web-page if you search "esp8266 webserver", perhaps one of those will get you started.



DrDooom

Oh no. This is disappointing. Thank you anyway! I checked the internet for Information about the ESP8266 ESP-12-E and SPI Communication.

On Adafruit.com they tells:
Quote
As of Sept 3rd, we are shipping the ESP-12E version which has the SPI flash pads brought out on the bottom row. Note that you cannot use them for GPIOs or anything, they're there so you can program the FLASH chip only.
Ahhhh. So ur right. I cant use them for Ehternet Communication. So i can ignore them.

I will explain my goal here. Maybe u can help me out with another way:

I have written C# Win Sockets and Network Streams before. I know the Network OSI Model. I was sure that it is no matter whether I use an ehternet shild or wifi module, as long as the SPI communication is identically. And I can use an fast stream to transfer data (no serial connection).

I need to transmit image data from two cameras via wifi and i need to tx/rx commands.

So does u or any other know how to communicate with the wifi modul without serial (tx/rx pins)?


(sorry for my english)

Whandall

If you are one a Due, why don't you use one of the additional Serials for the ESP communication?
Ah, this is obviously some strange usage of the word 'safe' that I wasn't previously aware of. (D.Adams)

DrDooom

Hey Whandall,

i am currently using Serial1 to communicate with the Chip. See Information above. But i have to transmit Images eg. Thats the Problem.

So if i am right, the TX Bandwitch for Serial Communication with 115200 Baud has a maximum of 14,06 KB/s (115200 / 8 / 1024). So it is not enough bandwitch for the ESP8266 ESP-12-E with Wifi b/g/n.

I have written an eMail to AI Thinker to get more Information about an fast way to communicate with the Chip. There are "8 unused GPIO Pins".

Whandall

So it is not enough bandwitch for the ESP8266 ESP-12-E with Wifi b/g/n.
I do not understand why you think this would be a problem.

The ESP buffers the data you send to it anyway, because it has to send packets.
I have seen some problems being discussed about sending big objects over the ESP.
Ah, this is obviously some strange usage of the word 'safe' that I wasn't previously aware of. (D.Adams)

DrDooom

The Answer: "bottleneck"

It doesnt matter how fast or big the ESP8266 Ram is, it is important how fast the Arduino can fill it (give data to ESP). And here we have the limitation of a max ~14 KB/sec via Serial (115200 Baud).

The data flows like that:
[VGA Cam / FiFo RAM] -> [GPIO] -> [Arduino / RAM] -> [Serial] -> [ESP8266 / RAM] -> [WiFi 'n'] -> [NetworkClient]

If u want to send "1x" VGA Image, it is very simple to calculate the duration:
[Arduino / RAM] holds 640x480xRGB bytes = 921600 bytes total raw image data without compression
[Serial] transports 14400 bytes / sec -> needs 64 sec to transport data to [ESP8266/RAM]
[ESP8266/RAM] transports the cached 921600 bytes via WiFi n (20mhz, ~75mbit netto) -> needs <0,1 sec to transport data to network client

U can read about the VNA (Von Neumann Architekture) or Bus Systems, Bottlenecks on the Internet.

And that meens, the fast Arduino Due cant do anything (Stepper Motors are stopped, no commands are processed, etc) for 64 sec although the WiFi Chip can give the data to client in <0,1 sec.

Whandall

It is only important for the total transmission time (one of the factors).

You have to transfer it to the ESP if you keep the data in the Due,
alternatively attach a sd card directly to the ESP and drop the whole Due.

That the serial communication is the bottleneck of a file transmission is proofed by what measurement?

And that meens, the fast Arduino Due cant do anything (Stepper Motors are stopped, no commands are processed, etc) for 64 sec although the WiFi Chip can give the data to client in <0,1 sec.
This is not true.

Don't block on serial and all is fine.
Ah, this is obviously some strange usage of the word 'safe' that I wasn't previously aware of. (D.Adams)

DrDooom

You dont (want to) understand the goal of my Thread?

Whandall

The initial goal of your thread was

"how to get a SPI connection to an ESP work with the library that uses a different chip".

Most of the rest of the thread was justification why you feel you have to do that.

IMHO
Ah, this is obviously some strange usage of the word 'safe' that I wasn't previously aware of. (D.Adams)

Go Up