Air quality sensing with arduino and imp...code problems

I am trying to get a serial input that is being recieved through the imp to a COSM node. However, with my code, even after I have declaered an output port in my code, it still says that I have no output ports when I try to connect the two nodes. In short, I can not get output ports in nodes to work with my code. Help! The code is below. Any suggestions?
hardware.uart12.configure(38400, 8, PARITY_NONE, 1, NO_CTSRTS);
local result = OutputPort(“air_quality”);
function readSerial() {
local result =;
if (result == -1) {“No data returned.”);
} else {;

imp.wakeup(300, readSerial);


imp.configure(“Serial RX”, [], []);


On the imp configure line, don’t you need to specify an output?

That will be it, yes.

imp.configure(“Serial TX”, [], [result]);

…should fix it. Note that only one result will be sent with the above code per run, but I suspect you know that!