title: uart.on("data", ... not firing withoug "\r\n" (0x0d 0x0a)
body: <p>I am currently writing drivers for indoor air quality sensors (CO2 and particulate matter) in lua for the NodeMCU firmware.</p>
  
  <p>The sensors are connected via the alternative UART pins GPIO13/15. On issuing a measure command, the ESP switches uart.alt(1) and registers a uart.on("data", 9, ...) function for firing after nine bytes are received. I have tested this with two ch340 connected to native and alternative UART pins.
  The reading of the values is fine if i manually enter the data and add \r\n (0d 0a).</p>
  
  <p>However my used sensors do not have \r\n at the end of their replies - how can I change my code to read out the UART buffer after 9 bytes received?</p>
  
  <pre><code>function MHZ19:measure(callback)
  -- timeout and restore UART
  tmr.alarm(self.timer, self.timeout*1000, 0,
  function()
      uart.alt(0)
      uart.setup(0, 115200, 8, uart.PARITY_NONE, uart.STOPBITS_1, 1)
      uart.on('data')
      print("Timed out. Restored UART.")
      callback(nil)
  end)
  
  uart.on('data', 9,
      function(data)
          -- unregister uart.on callback
          uart.on('data')
          tmr.stop(self.timer)
          uart.alt(0)
          uart.setup(0, 115200, 8, uart.PARITY_NONE, uart.STOPBITS_1, 1)
          -- First two bytes are control bytes 0xFF &amp;&amp; 0x86
          local a,b = string.byte(data,1,2)
          if (a==tonumber('FF',16)) and (b==tonumber('86',16)) then
              local high,low = string.byte(data,3,4)
              local co2value = high * 256 + low
              callback(co2value)
          else
              callback(nil)
          end
      end)
  
      uart.alt(self.altUart)
      uart.setup(0, 9600, 8, uart.PARITY_NONE, uart.STOPBITS_1, 0)
  
      -- Send request sequence to get value (refer to datasheet)
      -- send: FF 01 86 00 00 00 00 00 79
      -- receive: FF 86 02 E8 42 04 2B 1C 03
      uart.write(0, 0xff, 0x01, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x79)
  </code></pre>
  
  <p>end</p>