$5 WiFi modules!

Please add any feature requests for Flowcode version 6 here

Moderator: Benj

Forum rules
Only feature requests will be considered here. General questions should not be posted in this forum.
hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Has thanked: 49 times
Been thanked: 101 times
Contact:

$5 WiFi modules!

Post by hyperion007 »

Now this looks very interesting. Not a lot of information available yet but still, $5 for a SOC WiFi module!

http://hackaday.com/2014/08/26/new-chip ... ule-its-5/
https://nurdspace.nl/ESP8266

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: $5 WiFi modules!

Post by Benj »

Hello,

Wow those look pretty good. I'll see if I can get hold of one to make a component.

Edit. Managed to order 5 from here for £18 with shipping: http://www.electrodragon.com/product/es ... fi-module/

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Has thanked: 49 times
Been thanked: 101 times
Contact:

Re: $5 WiFi modules!

Post by hyperion007 »

Cool! I'll order some as well.

Do you think this Ethernet module is worth creating a component for?
http://www.electrodragon.com/product/ethernet-enc28j60/

Then I'll order some of those as well :)

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: $5 WiFi modules!

Post by Benj »

Wow another nice find! I'll get one of those too and do some investigation.

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Has thanked: 49 times
Been thanked: 101 times
Contact:

Re: $5 WiFi modules!

Post by hyperion007 »

I ordered 5 of each from the same place :) Let's hope that you'll find them easy to work with ;)

Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

Re: $5 WiFi modules!

Post by Rudi »

Hi guys,
fantastic!
here a smaller layout ..
http://www.aliexpress.com/item/ESP8266- ... 20903.html
;-)

i will try to get too
;-)
best wishes
rudi
;-)

Edit:
5 PCS Free Shipping ( 26,50 USD )
http://www.aliexpress.com/item/ESP8266- ... 72971.html

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Has thanked: 49 times
Been thanked: 101 times
Contact:

Re: $5 WiFi modules!

Post by hyperion007 »

I actually bought those smaller ones already :) So I have 5 of each ;)

Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

Re: $5 WiFi modules!

Post by Rudi »

wow wow wow

Code: Select all


Characteristics
802.11 b / g / n 
Wi-Fi Direct (P2P), soft-AP 
Built-in TCP / IP protocol stack 
Built-in TR switch, balun, LNA, power amplifier and matching network 
Built-in PLL, voltage regulator and power management components 
802.11b mode + 19.5dBm output power 

>>>   Built-in temperature sensor   <<<

Support antenna diversity 
off leakage current is less than 10uA 

>>> Built-in low-power 32-bit CPU: can double as an application processor  <<<

SDIO 2.0, SPI, UART 
STBC, 1x1 MIMO, 2x1 MIMO 
A-MPDU, A-MSDU aggregation and the 0.4 Within wake 
2ms, connect and transfer data packets 
standby power consumption of less than 1.0mW (DTIM3) 
thanks for the found!
Best wishes
Rudi
;-)

Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

Re: $5 WiFi modules!

Post by Rudi »

hi guys,
sorry for the push:
http://seeedstudio.com/depot/WiFi-Seria ... -1994.html
there is a SDK online too " ESP8266 IoT SDK "
edit:
under IoT demo\driver ..
-> i2c_master.c
-> pwm.c
-> uart.c

best wishes
rudi
;-)

Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

Re: $5 WiFi modules!

Post by Rudi »

Sorry again for the push guys,

this modules are very explosive tip.
<2ms wake up --- > DECT ULE Killer!
------------------------------------------
Fine Fine Fine!

i make with wifi shield from shuncom ( PIC32 and MRF24WB0MB )
a fine Microcontroller WIFI OTG ;-) ... for the handy.

http://www.mikrocontroller.net/attachme ... G_2002.JPG

http://www.mikrocontroller.net/topic/331208


Android Handy without OTG Function but WIFI..BT..

Wifi OTG Rev1
https://www.youtube.com/watch?v=JaikEB2kGzo


Wifi OTG Rev2
https://www.youtube.com/watch?v=MaIDlXOOt4o


Wifi Dect ULE ;-)
https://www.youtube.com/watch?v=e6mP4ouYJCY


My Android Handy do not support OTG but have WIFI.
I build a bridge from Handy with WIFI ( Wifi Shield as Server and transparent RS232 ) to the Microcontroller that swicth a Relais Port.

The Wifi Module is 12-25 USD ( variation prices from Shuncom )


With the 5 USD Tip - it is very cheap to play with this to a prof. Adapter for Android Devices without OTG / USB...
in combinied with the Arduino MINI ( under 3.80 USD )
http://www.electrodragon.com/product/ar ... 8-5v16mhz/

this will be a perfect Adapter!

Jordy plays with the Vinculum USB Device .. this can include for a perfect USB Stick / USb Device support over this cheap wifi ;-)
http://www.matrixtsl.com/mmforums/viewt ... 58&t=14200

Is anyone here that have functionally 3d printer ? and make a funny case for all ;-)
This will be a nice Adapter for all...

Lets go on in combinied and make together a fine ICON "OTG" for all ;-)
;-)

Fine!
Txs for the Wifi Shield Tip!

Best wishes!
Rudi
;-)


ps:
I could have can change my Order with Honkkong Post to DHL - i think i will get this after the weekend ;-)..

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: $5 WiFi modules!

Post by Benj »

Hello,
Is anyone here that have functionally 3d printer ? and make a funny case for all ;-)
Yes I have a 3D printer from RepRapPro setup in my home office, very good little machine.

I got my modules on royal mail 5-8 day delivery so hopefully they should arrive soonish and I can crack on with a component and maybe a blog type project. We are currently planning two internet of things type blogs and then a further internet based control type application. These are currently pencilled in for October.

Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

Re: $5 WiFi modules!

Post by Rudi »

If you saw my grin ...
Benj .. just the right away! ( the right way ... the right doing .. )
great!

bzw:
What you are thinking about this Benj:

RepRapPro Ormerod Full 3D Printer Kit

http://www.pollin.de/shop/suchergebnis. ... g=internal

buy ?
i search a 3D Printer, this is a thing that i not have ;-)

BW
Rudi
;-)

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: $5 WiFi modules!

Post by Benj »

Hi Rudi,

The Ormerod at 499 Euros sounds ok, UK price from the supplier is £450.

I have the tricolour mendel so can't really comment on the ormerod design but it looks quite good. In practise I have only used multi colour prints a couple of times and one was for my wedding :D

Here is the supplier website with links to the documentation which is always good to see and read through before you buy.
https://reprappro.com/product-category/reprap-kits/

Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

Re: $5 WiFi modules!

Post by Rudi »

Hi Guys..

only update

have see that the module can both, Standard, AP and both at same time..

Code: Select all

AT+CWMODE  wifi mode  wifi  AT+CWMODE=<mode> AT+CWMODE?  AT+CWMODE=?  1= Sta, 2= AP, 3=both  

ESP8266 manufacturer:
http://espressif.com/en/products/esp8266/

all form factors ;-)...
esp_iot_sdk_v0.6.zip .. SDK & PDF & PCB ect...
http://pan.baidu.com/share/link?shareid ... 1900861665

and here the smaller stamp version with connector without OnBoardAntenna:

http://www.aliexpress.com/item/ESP8266- ... 76105.html
4.50 USD ;-)

a look to the SDK Tools...( 57.6kBit UART is fix ) ..

Code: Select all

Xtensa_Info HW_CONFIGID0=0xc28cdafa
HW_CONFIGID1=0x1082b6f6
BUILD_UNIQUE_ID=0x0002b6f6
ABI=1
USE_ABSOLUTE_LITERALS=0
HW_VERSION="LX3.0.1"
HW_MIN_VERSION_MAJOR=2300
HW_MIN_VERSION_MINOR=1
HW_MAX_VERSION_MAJOR=2300
HW_MAX_VERSION_MINOR=1
RELEASE_NAME="RC-2010.1"
RELEASE_VERSION="8.0.1"
RELEASE_MAJOR=8000
RELEASE_MINOR=1
CORE_NAME="lx106"
..

The SOC can be a Xtensa LX, ..a "Configurable and extensible processor core".
For this is a special Compiler need ( hardware mod baudrate ect ) the XCC.
;-)
http://wiki.linux-xtensa.org/index.php/ ... tributions
;-)
..WLAN SSID, UDP Port, Destination-IP Adress. ;-)..

sdk IOT :
Webserver..

Code: Select all


#ifndef __USER_WEBSERVER_H__
#define __USER_WEBSERVER_H__

#define SERVER_PORT 80

#define URLSize 10

typedef enum Result_Resp {
    RespFail = 0,
    RespSuc,
} Result_Resp;

typedef enum ProtocolType {
    GET = 0,
    POST,
} ProtocolType;

typedef enum _ParmType {
    SWITCH_STATUS = 0,
    INFOMATION,
    WIFI,
    SCAN,
    REBOOT,
    LIGHT_STATUS,
} ParmType;

typedef struct URL_Frame {
    enum ProtocolType Type;
    char pSelect[URLSize];
    char pCommand[URLSize];
    char pFilename[URLSize];
} URL_Frame;

typedef struct _rst_parm {
    ParmType parmtype;
    struct espconn *pespconn;
} rst_parm;

void user_webserver_init(uint32 port);

#endif

"LIGHT_STATUS"

;-)

in the SDK is the linkerscript under ld/eagle.app.v6.ld:MEMORY

Code: Select all

{
  dport0_0_seg :                        org = 0x3FF00000, len = 0x10
  dram0_0_seg :                         org = 0x3FFE8000, len = 0x14000
  iram1_0_seg :                         org = 0x40100000, len = 0x8000
  irom0_0_seg :                         org = 0x40240000, len = 0x32000
}
...
Interest is, that exist dram and a "iram" ... (perhabs sram?)
Sizes are ca:

dram0: 82 kByte
iram1: 32 kByte
irom0: 204 kByte
On-Chip DRAM is not usually or? usually other Prozess?

( btw.. own linux kernel ... ;-) .. )

The size of ROM is big, there be so thinking - many function for the App.
In ld/eagle.rom.addr.v6.ld are Symboles with Addresses. Strange, that this Addresses not identify to ROM Base Adress
In lib are the libs for the consumerapp. ar -x can cut in all details.
Libphy is first work for the Wifi-device. ;-) crazzy , there are hints to a FPGA prototyping : phy_fpga_v5.o , sorry this is empty
The ELFs are with readelf -a better to read in detail. the cpu is little exotisch: Tensilica Xtensa Processor -
Own Firmware / Extendeds are little not family is thinking.
The SDK is fine structured, look to the libs...802.11 , SSL, JSON, .. is sensitive potential for remote exploits..
MMU thinks, i smissed at CPU .. so be careful for IoT that which may not be self-employed ;-)
.. but for less than 5 USD.. pah... this modules are fine!

my pcs are on way ;-)

benj have you the icon finnished ? ;-) ;-) :-) :-)

"ha ha ha rudi ..."

= ; ^ )

Best wishes
Rudi
;-)

Let's go :)

btw:
Have a look to this too,
http://www.aliexpress.com/item/MT7620N- ... 61403.html

Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

Re: $5 WiFi modules!

Post by Rudi »

Sorry for push,
hi Guys .

Arduino Sketch

Code: Select all

    #include <SoftwareSerial.h>
    #define SSID "xxxxxxxx"
    #define PASS "xxxxxxxx"
    #define DST_IP "220.181.111.85" //baidu.com
    SoftwareSerial dbgSerial(10, 11); // RX, TX
    void setup()
    {
    // Open serial communications and wait for port to open:
    Serial.begin(57600);
    Serial.setTimeout(5000);
    dbgSerial.begin(9600); //can't be faster than 19200 for softserial
    dbgSerial.println("ESP8266 Demo");
    //test if the module is ready
    Serial.println("AT+RST");
    delay(1000);
    if(Serial.find("ready"))
    {
    dbgSerial.println("Module is ready");
    }
    else
    {
    dbgSerial.println("Module have no response.");
    while(1);
    }
    delay(1000);
    //connect to the wifi
    boolean connected=false;
    for(int i=0;i<5;i++)
    {
    if(connectWiFi())
    {
    connected = true;
    break;
    }
    }
    if (!connected){while(1);}
    delay(5000);
    //print the ip addr
    /*Serial.println("AT+CIFSR");
    dbgSerial.println("ip address:");
    while (Serial.available())
    dbgSerial.write(Serial.read());*/
    //set the single connection mode
    Serial.println("AT+CIPMUX=0");
    }
    void loop()
    {
    String cmd = "AT+CIPSTART=\"TCP\",\"";
    cmd += DST_IP;
    cmd += "\",80";
    Serial.println(cmd);
    dbgSerial.println(cmd);
    if(Serial.find("Error")) return;
    cmd = "GET / HTTP/1.0\r\n\r\n";
    Serial.print("AT+CIPSEND=");
    Serial.println(cmd.length());
    if(Serial.find(">"))
    {
    dbgSerial.print(">");
    }else
    {
    Serial.println("AT+CIPCLOSE");
    dbgSerial.println("connect timeout");
    delay(1000);
    return;
    }
    Serial.print(cmd);
    delay(2000);
    //Serial.find("+IPD");
    while (Serial.available())
    {
    char c = Serial.read();
    dbgSerial.write(c);
    if(c=='\r') dbgSerial.print('\n');
    }
    dbgSerial.println("====");
    delay(1000);
    }
    boolean connectWiFi()
    {
    Serial.println("AT+CWMODE=1");
    String cmd="AT+CWJAP=\"";
    cmd+=SSID;
    cmd+="\",\"";
    cmd+=PASS;
    cmd+="\"";
    dbgSerial.println(cmd);
    Serial.println(cmd);
    delay(2000);
    if(Serial.find("OK"))
    {
    dbgSerial.println("OK, Connected to WiFi.");
    return true;
    }else
    {
    dbgSerial.println("Can not connect to the WiFi.");
    return false;
    }
    }



who need's the tutorial ;-)
can find a lot infos in

https://www.zybuluo.com/kfihihc/note/31135

so you can read in.
Best wishes
Rudi
;-)

EDIT:
A Module Manufacturer ..
nice webside :-)

Edit: Customer Firmware possible!

http://anxinke.taobao.com/

the shop search:

http://item.taobao.com/item.htm?id=40328222213

nice formfactores...
ESP-03 > SMT antenna on board, EXT-Ant and all GPIO/UART pins outside ;-)

..
look at the webside there are many pictures there..
one of this..

Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

Re: $5 WiFi modules!

Post by Rudi »

Sorry for the push,

hi guys,
followed this too at

http://www.esp8266.com/

the src 0.6 is puplic at ..

https://github.com/scottjgibson/esp8266


http://www.esp8266.com/viewtopic.php?f=5&t=8

The cross tools for x86 linux host can be obtained from:

https://www.kernel.org/pub/tools/crosst ... nux.tar.gz
https://www.kernel.org/pub/tools/crosst ... nux.tar.gz


The crosstool sources and patches for xtensa can be found on git

https://github.com/foss-xtensa

lets start us customers build too ;-)

where is jorgen ;-) :-)

=:^-)

best wishes
rudi
;-)

i hope this is ok for push- so allways inform thats are news here,
if better to do allways a edit - let me know .so i will edit the last post if comes news..


Edit:

It seems, that the modul can update over the UART.
The Tools in the VM will say "this can perhabs done.."
The Modul can boot with UART function, and one pin from chip must
connect at Reset.. then a flash loader would be flashed and the new
customer build firmware would be write in the flash
...
;-)

Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

Re: $5 WiFi modules!

Post by Rudi »

push
hi guys,

Sound is super..
here a answere to my questions...
best wishes
rudi
;-)

have a look to this too:
http://www.mikrocontroller.net/topic/342240
>
>
> Do you can offer the Version ESP-03 too
> SMT antenna on board, EXT-Ant and all GPIO/UART pins outside .
>
> Can you managed a Customer Firmware for change the Baudrate 57.6 - 115 or
>
> better can you managed this as a AT Command for selecting Baudrate
>
> example:
> AT+SetBaud=0 // 2400
> AT+SetBaud=1 // 9600
> AT+SetBaud=2 // 19200
> AT+SetBaud=3 // 31.250
> AT+SetBaud=4 // 38.400
> AT+SetBaud=5 // 57.600
> AT+SetBaud=6 // 115.200

...



.....

Hello Rudi,

The engineering is working on baud rate thing, it needs to store
something
in the EEPROM some it sounds complicate and not yet done, but it is on
planning.

Some of these version are running, but 02 03 is not available now, we
will
bring some other versions next week.

ESP-01 through the use of professional equipment matching PCB antenna
, the radiation effect is excellent , 8PIN -pin serial port and
upgrade leads to the mouth, and a reset

ESP-02 external antenna can penetrate the metal shield , better
external antenna , the proposed standard with 50 -ohm antenna

ESP-03 leads all available IO ports , and using high-gain antennas
shrink ceramics , suitable for development with the SDK friend

ESP-04 leads all the IO ports , antenna customers can design their own
freedom , more flexible

ESP-05 interface only leads to ease of use UART and VCC

.....

Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

Re: $5 WiFi modules! ( GCC Toolchain )

Post by Rudi »

Push
Seams like we get a gcc toolchain for it ;-)
http://www.esp8266.com/viewtopic.php?f=9&t=19
..
@jac i know you are perfect fit in linux, too ;-) perhaps this would be a nice goal!
;-)

Best wishes!
Rudi
;-)

Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

Re: $5 WiFi modules! Baudrate done! 115200

Post by Rudi »

push
New Firmware
PDF Side 7 : Baudrate 115200
Best wishes
Rudi
;-)


EDIT:

Usually Modules:
Have a exactly look to Modul, PCB and Functions!
Not all have GPIO or Antenna ..


ESP-01
The most common module with printed PCB antenna:

•2x4 2.54 mm pitch header
•built-in PCB-printed antenna
•3 GPIOs: GPOI0/2/16
•UART URXD/UTXD
•RESET and CH_PD (powerdown)
•VCC/GND
•14.2 mm W x 14.2 mm L


ESP-02
A less common module with antenna connector, that may be compatible with breadboards:

•Dual 1x4 2.54 mm pitch header in DIP form factor
•built-in U-FL connector for external antenna
•2 GPIOs: GPOI0/2
•UART URXD/UTXD
•RESET and CH_PD (powerdown)
•VCC/GND
•14.7 mm W x 14.2 mm L


ESP-03
A SMT (Sufrace Mount Technology) module with all pins broken out to castellated pads with built-in ceramic antenna:

•Dual 1x7 2 mm pitch castellated pads
•built-in ceramic antenna
•7 GPIOs: GPOI0/2/12/13/14/15/18
•UART URXD/UTXD
•RESET and CH_PD (powerdown)
•VCC/GND
•12.2 mm W x 17.4 mm L


ESP-04
Another SMT (Sufrace Mount Technology) module with all pins broken out to castellated pads without built-in antenna:

•Dual 1x7 2 mm pitch castellated pads
•external antenna on pad
•7 GPIOs: GPOI0/2/12/13/14/15/18
•UART URXD/UTXD
•RESET and CH_PD (powerdown)
•VCC/GND
•12.0 mm W x 15.0 mm L


ESP-05
A simple UART-only module with antenna connector:

•Single 1x4 2.54 mm pitch header
•built-in U-FL connector for external antenna
*]No GPIO•UART URXD/UTXD
•No RESET nor CH_PD (powerdown)
•VCC/GND
•14.2 mm W x 14.2 mm L

Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

Re: $5 WiFi modules! First ebay Offer 3.98 EUR

Post by Rudi »

Push
The first eBay Offer is online ;-)
http://www.ebay.de/itm/271596944559/
Best wishes!
Rudi
;-)

Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

Re: $5 WiFi modules! Funtionstest :-) and 2 Baudrates!

Post by Rudi »

Push ( this i will edit in future and not push again )
the first live functions steps ;-)...
AP Mode = OK
STA Mode = OK
AP + STA = ok ( it can be all two mode's same time! )
Modul in a Infrastructure eMbedded with WPA2 + SSID and Password that will get IP from a DHCP well
From Network ping then all Net Clients ok
Broadcast ping with nmap ok
GPIO's switched = ;-)


EDIT2:

PC = Server ( Linux example )
ESP8266 = Client , USB TTL Adapter example to PC

Little Linux Server for Test with a ESP8266 as client

Code: Select all


/* A simple server in the internet domain using TCP
   The port number is passed as an argument */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h> 
#include <sys/socket.h>
#include <netinet/in.h>

void error(const char *msg)
{
    perror(msg);
    exit(1);
}

int main(int argc, char *argv[])
{
     int sockfd, newsockfd, portno;
     socklen_t clilen;
     char buffer[256];
     struct sockaddr_in serv_addr, cli_addr;
     int n;
     if (argc < 2) {
         fprintf(stderr,"ERROR, no port provided\n");
         exit(1);
     }
     sockfd = socket(AF_INET, SOCK_STREAM, 0);
     if (sockfd < 0) 
        error("ERROR opening socket");
     bzero((char *) &serv_addr, sizeof(serv_addr));
     portno = atoi(argv[1]);
     serv_addr.sin_family = AF_INET;
     serv_addr.sin_addr.s_addr = INADDR_ANY;
     serv_addr.sin_port = htons(portno);
     if (bind(sockfd, (struct sockaddr *) &serv_addr,
              sizeof(serv_addr)) < 0) 
              error("ERROR on binding");
     
     listen(sockfd,5);
     clilen = sizeof(cli_addr);
     newsockfd = accept(sockfd, 
                 (struct sockaddr *) &cli_addr, 
                 &clilen);
     if (newsockfd < 0) 
          error("ERROR on accept");
     
     do {
       bzero(buffer,256);
       n = read(newsockfd,buffer,255);
       if (n < 0) error("ERROR reading from socket");
       printf("Here is the message: %s\n",buffer);
       n = write(newsockfd,"I got your message",18);
       if (n < 0) error("ERROR writing to socket");
     } while(1);

     close(newsockfd);
     close(sockfd);
     return 0; 
}

 





The AT Protokoll for the client ;-)

Code: Select all


reset and Info to Modul:
AT+RST

setting as Station:
AT+CWMODE=1

connect to Router:
AT+CWJAP="ssid","passwort"

get DHCP IP Adresse :
AT+CIFSR

start TCP-Server ( Linux Server Code Top ) in a console 
server <port>

multi conn:
AT+CIPMUX=1

connect with the Server:
AT+CIPSTART=4,"TCP","xxx.xxx.xxx.xxx",<port>

Send 10 chars:
AT+CIPSEND=4,10

send more chars - connection would be online ...
AT+CIPSEND=4,<counts>

;-)




Edit3:

PC = Client
ESP8266 = Server, USB TTL PC example

Code: Select all

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h> 

void error(const char *msg)
{
    perror(msg);
    exit(0);
}

int main(int argc, char *argv[])
{
    int sockfd, portno, n;
    struct sockaddr_in serv_addr;
    struct hostent *server;

    char buffer[256];
    if (argc < 3) {
       fprintf(stderr,"usage %s hostname port\n", argv[0]);
       exit(0);
    }
    portno = atoi(argv[2]);
    sockfd = socket(AF_INET, SOCK_STREAM, 0);
    if (sockfd < 0) 
        error("ERROR opening socket");
    server = gethostbyname(argv[1]);
    if (server == NULL) {
        fprintf(stderr,"ERROR, no such host\n");
        exit(0);
    }
    bzero((char *) &serv_addr, sizeof(serv_addr));
    serv_addr.sin_family = AF_INET;
    bcopy((char *)server->h_addr, 
         (char *)&serv_addr.sin_addr.s_addr,
         server->h_length);
    serv_addr.sin_port = htons(portno);
    if (connect(sockfd,(struct sockaddr *) &serv_addr,sizeof(serv_addr)) < 0) 
        error("ERROR connecting");
    
    do {
    printf("Please enter the message: ");
    bzero(buffer,256);
    fgets(buffer,255,stdin);
    n = write(sockfd,buffer,strlen(buffer));
    } while (1);
    if (n < 0) 
         error("ERROR writing to socket");
    bzero(buffer,256);
    n = read(sockfd,buffer,255);
    if (n < 0) 
         error("ERROR reading from socket");
    printf("%s\n",buffer);
    
    close(sockfd);
    return 0;
}

Protokoll

Code: Select all


ESP8266 Modul now Server:

reset and Info to Modul:
AT+RST

Set as Station:
AT+CWMODE=1

Connect with Router :
AT+CWJAP="ssid","password"

Get IP over DHCP:
AT+CIFSR

multi conn:
AT+CIPMUX=1

Start ESP8266 Modul as Server:
AT+CIPSERVER=1,8888

at console , start the client and write Text..
echo at Modul over UART
If client closed, Server waits for new connection.
;-)

Without Client - Telent can used too.
/~telnet <modul-ip> <port>



Update support for two Baudraten 57.6 & 115.200

src= http://www.electrodragon.com/w/index.ph ... oldid=6957

from mail..

new version 091
Our engineers are working on the new version, it has a slightly different layout with the image we posted on store, if you receive this one, please note:

Connect all the four pins (or only CH_PD) in between to VCC, not necessary to connect 10K resistor, CH_PD ensure the module start from flash, and low mode will enter into updating firmware mode, pin RST can restart the module.

There are two leds on the board, one is power led, another one is status LED, when power up, pwr led keeps on and status led will blink once.
baud rate may work at 115200 or 57600

Best wishes
Rudi
;-)


btw:
next future ;-)
http://detail.1688.com/offer/4025819424 ... gsda_offer

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Has thanked: 49 times
Been thanked: 101 times
Contact:

Re: $5 WiFi modules!

Post by hyperion007 »

Got 5 of these wifi modules today. The ones with 8 pins and PCB trace antenna.
Hopefully Ben will have it done as fast as the Ethernet module so I can start testing it out. Can't wait.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: $5 WiFi modules!

Post by Benj »

Hello,

Yes mine have arrived now too :D just wanted the wired one out the way first as this has been pending for a long time.

I've already had a quick look at some example code and it looks fairly easy. Anyway we will see, hopefully should get onto this later this week.

Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

Re: $5 WiFi modules!

Post by Rudi »

^grrrrrrrr
my are in Germany ( Leipzig ) too ( Saturday ) but i must wait for

"A DHL representative shall attempt to contact the importer for further clarification or proof of valuation if required by Customs."

i phone today and they need like every time the payments ect.. for calculate the tax - they do not trust dealers invoice ;-)

but this is wunderfull - i am sure - benj is sitting at the moduls and make the flowchart like ENC28J60 just in Time ;-) ;-) ;-)

;-)

best wishes
;-)
rudi

Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

Re: $5 WiFi modules!

Post by Rudi »

Hi guys,
i am sitting here and waiting for the big parcel ;-(
i think i will get today or morning.

btw:
https://www.youtube.com/watch?v=cdBC79jvHkw

absolutly the first YouTube about ESP8266 - i am sure..


;-)

he he he
Best wishes
Rudi
;-)

Post Reply