demo of Murata wifi chip as TCP client.

Dependencies:   SNICInterface mbed-rtos mbed

Fork of murataDemo by Austin Blackstone

Intro

this program demonstrates how to use TCP on the Murata Wifi chip. It will connect to a server and send a message, the server will then send a reply. The reply will be printed out to the terminal on the microcontroller.

Instructions

  1. Make sure you have both the wifi device and the computer running the server on the same network / wifi router.
  2. Change the hard coded IP in the microcontroller code to match that of the laptop running the python server.
  3. Run the python2 script below on the computer
  4. Have a console hooked up to the microcontroller and watch as messages are sent back and forth between the server (python) and the client (murata).
  5. Run the microcontroller code on the device.

For ease of use numbers have been appended to the end of the messages being sent back and forth.

Python Server

Please run this python2.7 code on your computer. Make sure to change the IP Address in the microcontroller code to match the IP of your computer.

import socket
 
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('', 7))
s.listen(1)
 
x = 0
while True:
    conn, addr = s.accept()
    print 'Connected b'TCP data from server: 'y', addr
    while True:
        # receive data from board
        data = conn.recv(1024)
        
        # check received data
        if not data: 
            break
        
        # print received data 
        print("TCP data from microcontroller: '"+data+"'")
        
        # send data to board with counter to differentiate messages
        conn.sendall("HelloFromPython!: "+str(x)+"\n\r")
        x+=1

    # close the port
    conn.close()

History

Basic TCP Client working with murata wifi chip default tip

2015-04-09, by mbedAustin [Thu, 09 Apr 2015 22:03:34 +0000] rev 32

Basic TCP Client working with murata wifi chip


Initial rev of murata demo, all API's are used and broken out.

2015-04-09, by mbedAustin [Thu, 09 Apr 2015 01:28:01 +0000] rev 31

Initial rev of murata demo, all API's are used and broken out.


got all API's working, need to cleanup

2015-04-02, by mbedAustin [Thu, 02 Apr 2015 06:03:05 +0000] rev 30

got all API's working, need to cleanup


got some initial stuff working

2015-04-01, by mbedAustin [Wed, 01 Apr 2015 23:05:11 +0000] rev 29

got some initial stuff working


got documentation working, stripped out extra fluff

2015-04-01, by mbedAustin [Wed, 01 Apr 2015 22:37:22 +0000] rev 28

got documentation working, stripped out extra fluff


Add the definition of serial for debugging output.

2014-11-25, by kishino [Tue, 25 Nov 2014 00:33:30 +0000] rev 27

Add the definition of serial for debugging output.


Updated SNICInterface.lib.

2014-11-14, by kishino [Fri, 14 Nov 2014 00:56:25 +0000] rev 26

Updated SNICInterface.lib.


It was supported to the FRDM-KL46Z platform.

2014-09-19, by kishino [Fri, 19 Sep 2014 01:46:21 +0000] rev 25

It was supported to the FRDM-KL46Z platform.


Default value of SSID and PassPhrase in source code was changed.

2014-09-12, by kishino [Fri, 12 Sep 2014 00:28:16 +0000] rev 24

Default value of SSID and PassPhrase in source code was changed.


Modified the module name of Copyright.

2014-07-15, by kishino [Tue, 15 Jul 2014 10:13:57 +0000] rev 23

Modified the module name of Copyright.