I am trying to set up my Wiz550s2e to connect to a server using a client static IP. Basically on the uart side I want to connect a device that supports HTTP and obviously on the Ethernet side to the network.
My client Static IP is 192.168.1.251
Server IP is 192.168.1.250
HTTP port 80
In my case the client has to have a Static IP 192.168.1.251 and the web server is 192.168.1.250 on port 80.
I want the wiznet to act as a bridge from the network side to the UART side. Do I use
AT+NSET=S,192.168.1.251,255.255.255.0,192.168.1.250
AT+NOPEN=C,192.168.1.250,80
My configuration is an ESP8266 configured as a WiFi Access Point. I have a second serial port SWSerial that is connected to the Wiznet550s2e serial port UART. I am able to send AT commands to the Wiznet and configure the IP, etc. I then issue the AT+MDATA command to go into data transmission mode.
I have the Ethernet port of the Wiznet connected to a web server via direct Ethernet cable(crossover type).
I then use my smartphone to access the ESP8266 AP and point my browser to the AP IP for the ESP8266 (192.168.4.1) default. I am using the ESP8266WiFi libraries in the Arduino IDE to run a simple program running a WiFi client. I can see the HTML request coming from my phones browser, but I don’t get any response from the web server connected to the Wiznet.
Is there something else I am missing? Is there a simple way to make this work? Seems simple enough, any help appreciated…
Have you checked whether your web server is communicating with WIZ550S2E?
First of all, except for ESP8266, check whether you can communicate with Webserver through WIZ550S2E serial.
(Whether they are in the same network, etc.)
I think it would be nice to check that the WIZ550S2E’s network configuration exists on the same network as your Webserver.
Since WIZ550S2E acts as a simple serial to Ethernet converter, regardless of whether you are using the ESP8266 or not, your data will be sent to the Webserver via Ethernet if you send to WIZ550S2E’s serial data that the webserver understands.
In my case there is just a point to point connection from the Wiznet module to the web server device that is the reason I am using the cross-over cable.
The configuration is like you had except the cross-over cable:
[Smartphone Accessing 192.168.4.1] --(wifi)-- [ESP8266] --(serial)-- [WIZ550S2E Static IP 192.168.1.251] --(Cross-Over Cable)-- [Webserver IP 192.168.1.250]
I am actually using the WEMOS D1 Mini (Esp8266) which has a built-in USB to Serial on the default Serial port of the device. In addition, I have set up a Software Serial port on the D1 Mini that is connected to the Wiznet UART (115200 baud). I can send the +++ to enter command mode and then the other AT commands to set the static IP and to open the port 80, etc… That works fine. Lastly I send AT+MDATA to switch to data mode. From the D1 Mini set as WiFi AP I use my phone to open the D1 Mini’s IP (192.168.4.1) and hopefully connect to the web server by Ethernet. I can see the HTTP request come through as I am using the default serial port as a monitor, but I get no response from the web server…Does this help any? Should I upload the code I am using on the D1 Mini?
As I said before, it is most accurate to communicate only with WIZ550S2E and Webserver.
However, if you want to use it easily through the library provided with ESP8266, the following method is recommended.
From your other topics, your webserver seems to work on your PC.
If your OS is macOS or windows, please use Wireshark to see if the Ethernet data is coming to your PC correctly.
(Whether data comes from the IP address of WIZ550S2E)
Please check this first and ask us any additional questions.
OK- Here is my code running on the Wemos D1 Mini (ESP8266) using Arduino IDE. See if this make sense or if I am doing something wronr. Reference the diagram I had posted earlier. Thanks…
In my opinion, the point to solve the problem is to ensure that the correct connection and data exchange between WIZ550S2E and Web Server is occurring.
You may want to test the devices by connecting them in the following configuration.
PC(serial terminal) <== Serial interface ==> WIZ550S2E <== Ethernet ==> Web Server
This test can help you check the response of an HTTP request sent via serial.
Are the intended data exchange between the devices in the above configuration properly done?
Notice
If the password of WIZ550S2E is set, please set it to no password and try again.
I tested as above, HTTP Get request was good, but got back random characters not a correct HTTP response.
I can connect my PC directly to the Web Server and I get the correct response.
Also, I blanked out the passwords and tried again, still no response from the web server.
Very frustrating as I think it has to do with the setup or configuration of the Wiznet module…
When you followed the diagram, did you mean that random characters were returned? When using WIZ550S2E?
Is not there a response, or is there a response but a strange character is returned?
I am concerned about the use of soft serial in your code and the baud rate.
Soft serial is unstable as fast as it controls GPIO unlike hardware serial.
I do not know about the ESP8266, but there have been many such issues in Arduino. Especially when using 115200, there are users who say that there is data loss.
So, in my opinion, do not connect WIZ550S2E to your server, but connect to your PC server and check if the HttpRequest you sent is transmitted without loss.
You can easily test using programs like PuTTY or Hercules.
Have you tested Serial to Ethernet, the most basic feature of the module?
With direct connection to a regular PC, did you check if the simple transfer of data is possible without problems using the above program?
If this basic function does not work, there is a problem with the module, but if it is not, it is not a problem with WIZ550S2E.
I swapped the serial ports on the ESP8266 so that the HW serial port is talking directly to the Wiznet serial port at 115200 and using the SW serial port for debug. This time when sending the HTTP request I get a response of 0xFF (255) that just keeps coming across the serial port. It just seems to send 0xFF continuously.
Again, if I use my PC, I get a correct response from my web server, just not with the Wiznet device.
SmartPhone --- ESP8266 --- WIZ550S2E --- PC (not WebServer)
First of all, I am wondering if the data sent to SmartPhone is properly transmitted to the ESP8266, and the data reaches the PC completely.
If you have a Serial to USB connector, please test it as below.
SmartPhone --- ESP8266 - (Serial to USB) - PC (or WebServer).
If the above works well, it will be quick to find out the problem of WIZ550S2E, otherwise it will be helpful to look at the serial side of ESP8266.
And can I see the Request Message you send and the message you need to respond to?
Exactly, I want to check the length of the messages.
I do not know what the ESP8266 is, but because of the very small size(64Byte) of the serial buffer in general Arduino codes, sending large amounts at once will cause data loss.