CHEAP wifi modules, at last!


Closed Thread
Results 1 to 29 of 29

Hybrid View

  1. #1
    Join Date
    Oct 2004
    Posts
    448

    Default Re: CHEAP wifi modules, at last!

    Henrik, I'm trying to connect the module to a terminal emulator. I have a true serial port on my PC (not a USB-to-serial).

    I understand I'll have to use a level shifter. But, would I also need to invert the signals? Or just resistor(s) in the Tx/Rx lines?

  2. #2
    Join Date
    Sep 2009
    Posts
    755

    Default Re: CHEAP wifi modules, at last!

    You need MAX3232.

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,617

    Default Re: CHEAP wifi modules, at last!

    Hi,
    You'd need to invert and level shift them.
    I'd recommend using something like this. (Many many alternatives available of course but make sure it's designed to work at 3.3V).

    I'd like to clarify that the dongle I used isn't a "USB to RS232" one but a "USB to UART", this one to be precise.

    /Henrik.

    EDIT: Oops, pedja089 posted while I was typing and getting distracted with other things....

  4. #4
    Join Date
    Oct 2004
    Posts
    448

    Default Re: CHEAP wifi modules, at last!

    Thanks, guys! Got the chap running. Extra thanks to Henrik for pointing out that Ch_PD I/O needs to be pulled high. I had missed that.

    Serial comms with terminal work ok.

    Can see the module on my Android.

    COULD see the routers (mine, and ones in the vicinity) with the AT+CWLAP.

    Could connect with my router after specifying SSID and the password.

    BUT, after that, AT+CWLAP no more lists the routers around; module seems to hang with a "busy now' response to any query.

    All other AT commands still work.

    Wonder what is happenning? (Module is connected to my router, confirmed that using AT+CWJAP?)

    Wonder how to erase my router from the module's eeprom? That might make the AT+CWLAP start listing the routers around again.

    Perhaps time to enlist on the ESP82666 forum.

  5. #5
    Join Date
    Oct 2004
    Posts
    448

    Default Re: CHEAP wifi modules, at last!

    Okay, problem solved.

    I had inadvertently given a wrong password for my router, and the module would keep on trying to log on continuously.

    Used the AT+CWQAP, re-defined my SSID and password, and it works as it should.

  6. #6
    Join Date
    Oct 2004
    Posts
    448

    Default Re: CHEAP wifi modules, at last!

    Not trying to be pushy, but I wonder if you have had any success, Henrik?

    I ran into a wall after getting the basic comms working (connecting to my router). Of course, the fact that I know nothing about TCP or HTML doesnt help, either.

    Although, the module is now connected to the router (i can ping it remotely), I cant see it thru the browser.

  7. #7
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,617

    Default Re: CHEAP wifi modules, at last!

    Hi,
    No, I haven't worked on it, don't know what to do with them.... :-)
    Simply getting them connected to your Wifi doesn't mean you can "browse to them" - there's a little more to it than that (but not much really). Unfortunatley I don't remember off the top of my head and I don't have access to my notes right now.

    What exactly is it you want to do?

    I'll see if I can get something simple cobbled together tonight perhaps.

  8. #8
    Join Date
    Oct 2004
    Posts
    448

    Default Re: CHEAP wifi modules, at last!

    Well, for starters, I would like to connect a pic to the 8266's UART outputting some data, and expect it to be seen in the browser. And then, perhaps, feed in data into the browser, to be read by the pic?

  9. #9
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,617

    Default Re: CHEAP wifi modules, at last!

    Hi,
    OK, this was and is a bit frustrating, trying to get this going on a PIC with only one USART. Anyway, this seems to work OK but it's meant ONLY as a startingpoint, I do NOT claim this to be the proper way of doing it.
    Initially I did have HSERIN type stuff instead of the PAUSE statments but sometimes it just locked up and without any means of seeing what actually happened it got a bit a frustrating and I'm running out of time right now. So again, this does seem to work but it's not very robust nor elegant. When I get more time I'll rig something up with another PIC or get a bitbanged UART going for debugging purposes.

    Oh, and since there is no connection back to the PC there's no way to see what IP the module gets assigned by the accesspoint so I used my accesspoints web interface to find that out. I found that if I did a "manual test run" first, ie using a serial terminal, it usually gets assigned the same IP number after that.

    As I said, not elegant....

    Code:
    dummy VAR BYTE
    Hits VAR BYTE
    
    Main:
        ' Issue a module reset
        HSEROUT["AT+RST", 13, 10]
        ' Module should respond with a bunch of data and finally 'ready'
        HSERIN[WAIT ("ready"), dummy]
    
        ' Set the mode, module may respond differently depending on if it's
        ' already IN the current mode so we simply delay (not good practise).
        HSEROUT["AT+CWMODE=3", 13, 10]
        PAUSE 100
    
        ' Join the accesspoint, module should respond with 'OK'
        ' Replave mynetwork and password with actual SSID and password
        HSEROUT["AT+CWJAP=", 34, "mynetwork", 34, "," ,34, "password", 34, 13, 10]
        HSERIN[WAIT ("OK"), Dummy]
    
        ' Allow multiple connections, module should respond with 'OK'
        HSEROUT["AT+CIPMUX=1", 13, 10]
        HSERIN[WAIT ("OK"), Dummy]
    
        ' Open port 80 (normal port for HTTP), module should respond with 'OK'
        HSEROUT["AT+CIPSERVER=1,80", 13, 10]
        HSERIN[WAIT ("OK"), Dummy]
    
        ' Here we need to wait for a client to connect and request data.
        ' When that happens the module will outout the HTTP header on the
        ' UART, we'll trig on the GET keyword.
        HSERIN[WAIT("GET"), Dummy]
        Hits = Hits + 1
    
        ' Prepare to send 33 bytes
        HSEROUT["AT+CIPSEND=0,33", 13, 10]          
        PAUSE 100
        ' Send the actual data
        HSEROUT["<TITLE>PBP ESP8266 demo</TITLE>", 13, 10]
        PAUSE 100
    
        ' Prepare to send 30 bytes
        HSEROUT["AT+CIPSEND=0,30", 13, 10]
        PAUSE 100
        ' Send the actual data
        HSEROUT["<H1>Testing the ESP8266</H1>", 13, 10]
        PAUSE 100
    
        ' Prepare to send 22 bytes
        HSEROUT["AT+CIPSEND=0,22", 13, 10]
        PAUSE 100
        ' Send the actual data
        HSEROUT["<H3>Cool stuff!</H3>", 13, 10]
        PAUSE 100
        
        ' Prepare to send 18 bytes
        HSEROUT["AT+CIPSEND=0,18", 13, 10]
        PAUSE 100
        ' Send the actual data
        HSEROUT["Page visits: ",DEC3 Hits, 13, 10]
        PAUSE 100
    
        ' Now disconnect
        HSEROUT["AT+CIPCLOSE=0", 13, 10]
        PAUSE 1000
    
    Goto Main
    Attached Images Attached Images  

Similar Threads

  1. 2.4 ghz WiFi ID
    By tazntex in forum Ethernet
    Replies: 30
    Last Post: - 16th January 2013, 17:01
  2. Replies: 0
    Last Post: - 20th September 2011, 03:31
  3. cheap gsm modules
    By isaac in forum GSM
    Replies: 2
    Last Post: - 15th June 2007, 09:18
  4. supply FSK COB modules and FSK modules
    By Elsa zhang in forum Adverts
    Replies: 0
    Last Post: - 8th August 2006, 06:40

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts