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()

Changes

RevisionDateWhoCommit message
32:67402fe56150 2015-04-09 mbedAustin Basic TCP Client working with murata wifi chip default tip
31:c42d189364b4 2015-04-09 mbedAustin Initial rev of murata demo, all API's are used and broken out.
30:de5a32932408 2015-04-02 mbedAustin got all API's working, need to cleanup
29:9f08c7152c7a 2015-04-01 mbedAustin got some initial stuff working
28:174412ff9671 2015-04-01 mbedAustin got documentation working, stripped out extra fluff
27:6949291ca38d 2014-11-25 kishino Add the definition of serial for debugging output.
26:b666d1b66f62 2014-11-14 kishino Updated SNICInterface.lib.
25:39099b3b173f 2014-09-19 kishino It was supported to the FRDM-KL46Z platform.
24:3d150ff59276 2014-09-12 kishino Default value of SSID and PassPhrase in source code was changed.
23:39cf9f03b076 2014-07-15 kishino Modified the module name of Copyright.
22:e567f0d4b05d 2014-07-15 kishino The platform-dependent code was modified to implemented in ifdef.; The process of debug log output was changed to macro.;
21:25b85cbbdd82 2014-07-15 kishino The pointing out of in-house reviews was modified.
20:f0c7f5ca7e8a 2014-06-25 kishino Fixed a variable name of pointer type.
19:4e2900daad59 2014-06-19 kishino Supported a new command format of SNIC UART.
18:62daece493a9 2014-06-11 kishino Update SNIC xively demo
17:0bf3c49a83d5 2014-06-11 kishino Update SNIC xively jumpstart-demo
16:ed9b9c28f860 2014-05-30 kishino Xively demo
15:abc12b228291 2014-05-27 kishino Adjusted of parameters for Xively demo for using SNIC UART.
14:6d58d3855feb 2014-05-26 kishino Created demo application for Xively using the SNIC with TypeYD.
13:d4a21765a203 2013-11-08 Ilya Dmitrichenko Add TODO note...
12:27471bb09274 2013-11-08 errordeveloper First prototype
11:bdf601a405fc 2013-10-14 errordeveloper Improve a few things about the LCD output:; ; * don't output debug logs; * show Xively logo on boot;
10:86ffba646df1 2013-10-14 errordeveloper Updated all dependencies and fixed issue with mixing C and C++
9:c5dc85d192e2 2013-10-14 Ilya Dmitrichenko Add user config header as it's now required
8:81743e1228a7 2013-10-11 xively Merged r6 with r7
7:0eff5db44b8b 2013-10-11 xively Update to use latest version of libxively (in sync with git)
6:9e4f4a8c1829 2013-09-20 Ilya Dmitrichenko Add missing `)` in a comment
5:04b5c5242bbf 2013-06-26 xively Added temperature datastream and sleep of 15.0 seconds
4:e7ca62a11595 2013-06-26 xively Added temperature datastream and sleep of 15.0
3:7ad3f6543b6e 2013-06-26 xively Added:; - pause to avoid Xively API rate limits; - reading of temperature sensor available on the application board;
2:51b141cc909a 2013-06-26 xively Updated to use mbed-libxively-34c8b32
1:0a61d7ab702c 2013-05-13 xively Indicate that XI_FEED_ID and XI_API_KEY need to be set by the user
0:efdea27c3b81 2013-05-13 xively Xively Jumpstart Demo (v1)