title: C - How to receive from the serial port for the device side (z1 mote)
body: <p>I am trying to communicate with a z1 mote that is connected to my PC directly by using <code>pyserial</code>. What I am looking to do is to write to the mote, and upon receiving the command, the mote should reply the current reading for temperature, for example. </p>
  
  <p>Python side can be something like this (iinm)</p>
  
  <pre><code>import serial
  ser = serial.Serial(0)  
  ser.write("hello")      # the mote will receive the message and do something 
  </code></pre>
  
  <p>but  I have no clue how to receive the message in the z1 mote side that uses C. Is there a special method to receive the commands or do I have to create my own?</p>
  
  <p>Any tips and hints are a greatly appreciated.</p>