CHEAP wifi modules, at last!


Closed Thread
Results 1 to 29 of 29

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,604

    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  

  2. #2
    Join Date
    Oct 2004
    Posts
    448

    Default Re: CHEAP wifi modules, at last!

    Henrik, thanks a lot for sharing your work. It looks very interesting indeed.

    I'm away from my base till mid next week. Cant wait to get back and give it a try.

    I'll report my experience soon as I get back.

    Regards.

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