Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By gbafamily1
#64930
BobAGI wrote:Question1:
What will be the IP address of the connected client? Is SoftAP mode also implementing a DHCP server to set the client IP address? If so how is it configured?


Lots of answers here. https://github.com/esp8266/Arduino#documentation

Yes, softAP mode does DHCP server. I think the following line sets the AP IP, subnet, and net mask. DHCP assigns IP addresses from the subnet and net mask.

WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0));


BobAGI wrote:Question2:
I would like to know if the serial transfers using this mode is completely transparent to the data being transferred?

Yes, it uses the Arduino readBytes method which is documented online. But I have mostly use this program for ASCII data. But nothing leads me to think it will fail on binary data.

I am pretty sure esp-link works for binary data because it can Flash firmware into AVR and ARM processors. I use esp-link a lot. I used the sample Arduino code is when I had to add this functionality to a much larger Arduino program.

BobAGI wrote:Our device sends large data blocks in some modes and these are pure binary so any byte sequence can occur, like multiple 0x00 bytes (NULL) and also '+++Axyz' which must not escape the system into AT command handling!

When new firmware is loaded into the ESP, existing firmware is overwritten. This means the AT command firmware is erased after loading new firmware. I suggest getting hand on with an ESP8266 to see how it works.
User avatar
By splabber
#66344 [quote="gbafamily1"]Modification of the WiFiTelnetToSerial example program included with the ESP8266 board support package to use softAP mode. This has been used to connect a GPS receiver to the ESP UART port running at 9600. First, the client must connect to the SSID "TCPUARTBridge" with password "12345678". Next the client must open a TCP connection to 192.168.1.1 port 23. At this point, the TCP client receives NMEA output from the GPS receiver. There is nothing specific to GPS in this program so it can be used with other serial devices.]

I am new to ESP8266 and Arduino but your code looks like a solution to my problem. I have a device that transmits RS-232 data at 115200, with no receive channel. If I hook it directly to my PC running Putty I get a nice steady screen formatted as 80 characters wide and 25 high. Looking at the data line, these screens are sent about 3 times per second. I need to be able to see this data via Wi-Fi so I have modified your code with my ssid, ip, port, etc. It loads and runs and I can connect to it via telnet. The data is there but the screen formatting is scrambled with characters constantly appearing out of position. I can't see how this can be a speed issue and anyway, I can't change the baud rate on the transmitting device.
Do you have any ideas or suggestions that I could try?
Thanks in advance,
splabber