luup.io.read and raw protocol

I’m writing a plugin for my Epson home cinema 1080UB projector. It is a serial communication device with a fairly simple command set. It works via a simple : returned from the projector stating that it’s ready for input. Commands are cr/lf terminated. The replies however seem to be only : terminated (from my hyperterm connection in to test). No matter what I try I never see any return commands from mi casa. I’ve tried the protocol as CR, CR/LF, and RAW.

Most recently I’ve tried with a RAW protocol, and tried on my startup to send the command to check the power status (“PWR?”, as part of the genericPoll function) and then do a read, however that does not appear to work (I get Luup error “Lua Engine Failed to Load”). If I use the incomming block, I get nothing ever returned.

Any ideas?

Here’s my implementation file.

[code]<?xml version="1.0"?>


raw

<functions>
    local buffer = ""
    local socket = require("socket")
    local THISDEVICE
    local mappingTable = {
    ["InputSelection1"] = {
        ["COMPONENT"] = "SOURCE 10",
        ["VGA"] = "SOURCE 20",
        ["HDMI1"] = "SOURCE 30",
        ["HDMI2"] = "SOURCE A0",
        ["VIDEO"] = "SOURCE 40",
        },
    ["InputSelection2"] = {
        ["SOURCE=10"] = "COMPONENT",
        ["SOURCE=20"] = "VGA",
        ["SOURCE=30"] = "HDMI1",
        ["SOURCE=A0"] = "HDMI2",
        ["SOURCE=40"] = "VIDEO",
        },
    }

    -- -------------------------------------------------------------------------
    -- Perform the startup for the receiver (i.e. open the telnet port)
    
    function doStartup(lul_device)
        luup.log("Starting Epson Projector",1)
        if( luup.io.is_connected(lul_device)==false ) then
            luup.log('No port for ProjectorScreen',1)
            luup.task('Choose the Serial Port for the Projector',2,'ProjectorScreen  Interface',-1)
            return false
        end
        genericPoll(lul_device, null)
    end
    
    function sendCode(code)
        local cmd = code
        luup.log("Epson Projector: " .. cmd .. string.char(13) .. string.char(10), 1)
        if (luup.io.write(cmd .. string.char(13) .. string.char(10)) == false) then
            luup.log("Cannot send command " .. code .. " communications error", 1)
            luup.set_failure(true)
            return false
        end

        return true
    end

    -- -------------------------------------------------------------------------
    -- Perform the appropriate action based on the mapping table for this action
    
    function doAction(deviceType, actionName)
        local code = mappingTable[deviceType][actionName];
        
        luup.log("Epson Projector action: " .. deviceType .. "-" .. actionName, 1)
        -- Do we have a code?
        if( code ~= "") then
            sendCode(code)
        else
            luup.log("Unimplemented action: " .. deviceType .. "-" .. actionName, 1)
            luup.set_failure(true)
            return false
        end
        return true            
    end

    
    function EpsonIncoming(data)
        luup.log("Epson Projector data: " .. data, 1)
    end 

    function toggleSwitch(lul_device, lul_settings)
        luup.log("Epson Projector Power: " .. lul_settings.newTargetValue, 1)
        if (lul_settings.newTargetValue=="1") then
            sendCode("PWR ON")
        else
            sendCode("PWR OFF")
        end
    end
    function doInputChange(lul_device, lul_settings)
        doAction("InputSelection1",lul_settings.InputTarget)
    end
    function genericPoll(lul_device, lul_settings)
        --sendCode("LAMP?")
        --sendCode("SOURCE?")
        luup.io.intercept
        luup.io.write("PWR?" .. string.char(13) .. string.char(10))
        luup.log("Epson Projector Raw Write: " .. "PWR?", 1)
        luup.log("Epson Projector Recieving Data on : " .. lul_device, 1)
        reply = luup.io.read(3, lul_device)
        luup.log("Epson Projector data waiting", 1)
        luup.log("Epson Projector data: " .. reply, 1)
    end


</functions>

-- -------------------------------------------------------------------------
<incoming>
    <lua>
        EpsonIncoming(lul_data)
    </lua>
</incoming>

<startup>doStartup</startup>

<actionList>
    <action>
        <serviceId>urn:micasaverde-com:serviceId:InputSelection1</serviceId>
        <name>ToggleInput</name>
        <run>
            doInputChange(lul_device, lul_settings)
        </run>
    </action>
    <action>
      <serviceId>urn:upnp-org:serviceId:SwitchPower1</serviceId>
      <name>SetTarget</name>
      <run>
          toggleSwitch(lul_device, lul_settings)	  
      </run>
    </action> 
<action>
    <serviceId>urn:micasaverde-com:serviceId:HaDevice1</serviceId>
    <name>Poll</name>
    <run>
	genericPoll(lul_device, lul_settings)
    </run>
 </action>
</actionList>
[/code]

luup.io.intercept(…) is a function and should have device number as an argument. In your routine genericPoll(), you have missed off the parentheses so it will raise an error - as you have seen.

Well, that fixed the general load failure. I’ve corrected that part of the code, but as with the general incoming block, I still never see any responses from the device. With the direct read, it sat for quite a while processing, then spat back nothing. The general input block method (removing the intercept and read requests) never fires.

New code:

[code]<?xml version="1.0"?>


raw

<functions>
    local buffer = ""
    local socket = require("socket")
    local THISDEVICE
    local mappingTable = {
    ["InputSelection1"] = {
        ["COMPONENT"] = "SOURCE 10",
        ["VGA"] = "SOURCE 20",
        ["HDMI1"] = "SOURCE 30",
        ["HDMI2"] = "SOURCE A0",
        ["VIDEO"] = "SOURCE 40",
        },
    ["InputSelection2"] = {
        ["SOURCE=10"] = "COMPONENT",
        ["SOURCE=20"] = "VGA",
        ["SOURCE=30"] = "HDMI1",
        ["SOURCE=A0"] = "HDMI2",
        ["SOURCE=40"] = "VIDEO",
        },
    }

    -- -------------------------------------------------------------------------
    -- Perform the startup for the receiver (i.e. open the telnet port)
    
    function doStartup(lul_device)
        luup.log("Starting Epson Projector",1)
        if( luup.io.is_connected(lul_device)==false ) then
            luup.log('No port for ProjectorScreen',1)
            luup.task('Choose the Serial Port for the Projector',2,'ProjectorScreen  Interface',-1)
            return false
        end
        genericPoll(lul_device, null)
    end
    
    function sendCode(code)
        local cmd = code
        luup.log("Epson Projector: " .. cmd .. string.char(13) .. string.char(10), 1)
        if (luup.io.write(cmd .. string.char(13) .. string.char(10)) == false) then
            luup.log("Cannot send command " .. code .. " communications error", 1)
            luup.set_failure(true)
            return false
        end

        return true
    end

    -- -------------------------------------------------------------------------
    -- Perform the appropriate action based on the mapping table for this action
    
    function doAction(deviceType, actionName)
        local code = mappingTable[deviceType][actionName];
        
        luup.log("Epson Projector action: " .. deviceType .. "-" .. actionName, 1)
        -- Do we have a code?
        if( code ~= "") then
            sendCode(code)
        else
            luup.log("Unimplemented action: " .. deviceType .. "-" .. actionName, 1)
            luup.set_failure(true)
            return false
        end
        return true            
    end

    
    function EpsonIncoming(data)
        luup.log("Epson Projector data: " .. data, 1)
    end 

    function toggleSwitch(lul_device, lul_settings)
        luup.log("Epson Projector Power: " .. lul_settings.newTargetValue, 1)
        if (lul_settings.newTargetValue=="1") then
            sendCode("PWR ON")
        else
            sendCode("PWR OFF")
        end
    end
    function doInputChange(lul_device, lul_settings)
        doAction("InputSelection1",lul_settings.InputTarget)
    end
    function genericPoll(lul_device, lul_settings)
        --sendCode("LAMP?")
        --sendCode("SOURCE?")
        --sendCode("PWR?")
        luup.io.intercept(lua_device)
        luup.io.write("PWR?" .. string.char(13) .. string.char(10))
        luup.log("Epson Projector Raw Write: " .. "PWR?", 1)
        reply = luup.io.read(3, lul_device)
        luup.log("Epson Projector data: " .. reply, 1)
    end


</functions>

-- -------------------------------------------------------------------------
<incoming>
    <lua>
        EpsonIncoming(lul_data)
    </lua>
</incoming>

<startup>doStartup</startup>

<actionList>
    <action>
        <serviceId>urn:micasaverde-com:serviceId:InputSelection1</serviceId>
        <name>ToggleInput</name>
        <run>
            doInputChange(lul_device, lul_settings)
        </run>
    </action>
    <action>
      <serviceId>urn:upnp-org:serviceId:SwitchPower1</serviceId>
      <name>SetTarget</name>
      <run>
          toggleSwitch(lul_device, lul_settings)	  
      </run>
    </action> 
<action>
    <serviceId>urn:micasaverde-com:serviceId:HaDevice1</serviceId>
    <name>Poll</name>
    <run>
	genericPoll(lul_device, lul_settings)
    </run>
 </action>
</actionList>

[/code]

Out of curiosity, do outgoing commands get processed properly? Does your “PWR ON” function work?

I would check a couple things:

  1. Check the device definition file and make sure you don’t have a conflicting protocol tag.
  2. If you’re using a serial / USB cable, is it compatible with Vera?
  3. Make sure your comm port settings are correct.

@ebolam,

Out of curiosity, do outgoing commands get processed properly? Does your "PWR ON" function work?

I would check a couple things:

  1. Check the device definition file and make sure you don’t have a conflicting protocol tag.
  2. If you’re using a serial / USB cable, is it compatible with Vera?
  3. Make sure your comm port settings are correct.

That is good advise!

luup.io.intercept does not require a DeviceId, it is optional, if not used the current device is assumed.

However, you shoud be careful to use luup.io.intercept.
Before starting coding you should decide whether you need luup.io.intercept or not.
Generally, if the replies from your target device are always terminated by CR/LF, or CR, or LF, or always have the same length, you do not want to use luup.io.intercept.
In that case just use the standard “incoming block” to handle the replies from your target device.
In that case also do not forget to change raw into CR/LF.
Now it will be easy to check whether you get response from your target device by just putting luup.log("Incoming: " … string.byte(lul_data)) into the incoming data block and look at the logs.

Mixing luup.io.intercept and also using the incomming data block, will get you some hard time.
In the end you might be successful, but I would not recomment.

If you still want to use luup.io.intercept, you have to use it before every write to your target device, and handle the incoming data yourself.

Hope this helps.

Thanks to everyone for all the quick responses. I really appreciate the ideas and checks that have been suggested thus far.

@JoeyD:

I would check a couple things: 1) Check the device definition file and make sure you don't have a conflicting protocol tag. 2) If you're using a serial / USB cable, is it compatible with Vera? 3) Make sure your comm port settings are correct.
  1. I did originally have a conflicting protocol before the first post :). I have corrected this without any effect (I removed the protocol tag in the definition file).
  2. I’m sure the cable is OK, as I’m able to send commands. The device does actually power on/off and switch inputs with the serial cable. I also switched this cable with another one I was using for Altsteon on the vera successfully…
  3. The com port settings match the documentation, and the send command works.

@Snotneus
I’ve been trying to get ANY data back out of the device. Originally I used the input block only, however it has never returned any data. I tried to eliminate that portion of the code and fire off in the startup block a known read by sending a command I knew would return a result. I think the problem is in that the data coming back is not CR or CR/LF. It is : terminated on the same line. As I understand it, if I turn my protocol to CR or CR/LF the vera will buffer until it receives a CR and then launches the function in the input block with the full line as the data variable. Without a CR, my only option is a raw read, which will fire with each character sent from the device… Only it never seems to fire or receive data even on io.read.

I’ve tried putting a function in my incoming block (seen in the code in the prior posts) that just posted the data value to the log. I have never seen any log entries for that function, although I do see other log entries when I send data, just nothing ever when receiving. What’s also odd, is when I use the interrupt, write, read, I get a Lua Failed error during or after the read. It takes ~2 minutes, where I have a timeout on the read of 3 seconds… Not sure if that’s related.

Well… The glaring error is in your dostartup function… it does not return any values…

the startup function MUSt return three parameters…

	return true, "Status message.", "Plugin Name"

If the startup function does not return these parameters, the LuaUPnP engine interprets it as a startup failure, and your code will never be called… because the your plugin code has been unloaded and no longer available.

Also, the Luup.io mechanism is not configured and will not process data until the initial startup code has completed. I have also found that the luup.io.intercept() and luup.io.read() functions do not work reliably until after the initial startup code has completed.

Keep in mind that If you use RAW, the data coming from your device is passed to your function one byte at a time… so you will need to have some sort of buffer in order to get complete responses for processing.

I don’t think that’s true about the startup function requiring a return value, as I have another plugin I wrote for my pioneer reciever (modification of the existing plugin) to add two way communication. My startup function does not have a return command and I do get values passed in through the input command. But just in case I have modified my code to include this requirement (sounds like a best practice anyway)…

Unfortunately, it now does the exact same thing as before. I see my command go out, and then nothing. I ran the Poll action via the frontend button. It executes the poll function, I see the command being written out to the serial port, then the input function never gets triggered.

Here’s my revised code. I’ll also tried changing the poll function back to using the interrupt, write, read (the commented out lines). I got the similar result however. It runs through the write, puts the log message about going to read, then nothing. No message about read returning null, no message about return giving a character as the code should write to the log.

I also hooked up the serial port to a machine and listed out the hex output after the PWR? command. This was the result:

50 57 52 3d 30 31 0d 3a 

Which is

PWR=01<CR>:

I wonder if it’s waiting for another cr after the : if I use the CR and thus not getting anything to the input function.

[code]<?xml version="1.0"?>


RAW

<functions>
    local buffer = ""
    local socket = require("socket")
    local THISDEVICE
    local mappingTable = {
    ["InputSelection1"] = {
        ["COMPONENT"] = "SOURCE 10",
        ["VGA"] = "SOURCE 20",
        ["HDMI1"] = "SOURCE 30",
        ["HDMI2"] = "SOURCE A0",
        ["VIDEO"] = "SOURCE 40",
        },
    ["InputSelection2"] = {
        ["SOURCE=10"] = "COMPONENT",
        ["SOURCE=20"] = "VGA",
        ["SOURCE=30"] = "HDMI1",
        ["SOURCE=A0"] = "HDMI2",
        ["SOURCE=40"] = "VIDEO",
        },
    }

    -- -------------------------------------------------------------------------
    -- Perform the startup for the receiver (i.e. open the telnet port)
    
    function doStartup(lul_device)
        luup.log("Starting Epson Projector",1)
        if( luup.io.is_connected(lul_device)==false ) then
            luup.log('No port for ProjectorScreen',1)
            luup.task('Choose the Serial Port for the Projector',2,'ProjectorScreen  Interface',-1)
            return false
        end
        return true, "Epson Projector Started", "Epson Projector"
    end
    
    function sendCode(code)
        local cmd = code
        luup.log("Epson Projector: " .. cmd .. string.char(13) .. string.char(10), 1)
        if (luup.io.write(cmd .. string.char(13) .. string.char(10)) == false) then
            luup.log("Cannot send command " .. code .. " communications error", 1)
            luup.set_failure(true)
            return false
        end

        return true
    end

    -- -------------------------------------------------------------------------
    -- Perform the appropriate action based on the mapping table for this action
    
    function doAction(deviceType, actionName)
        local code = mappingTable[deviceType][actionName];
        
        luup.log("Epson Projector action: " .. deviceType .. "-" .. actionName, 1)
        -- Do we have a code?
        if( code ~= "") then
            sendCode(code)
        else
            luup.log("Unimplemented action: " .. deviceType .. "-" .. actionName, 1)
            luup.set_failure(true)
            return false
        end
        return true            
    end

    
    function EpsonIncoming(data)
        luup.log("Epson Projector data: " .. data, 1)
    end 

    function toggleSwitch(lul_device, lul_settings)
        luup.log("Epson Projector Power: " .. lul_settings.newTargetValue, 1)
        if (lul_settings.newTargetValue=="1") then
            sendCode("PWR ON")
        else
            sendCode("PWR OFF")
        end
    end
    function doInputChange(lul_device, lul_settings)
        doAction("InputSelection1",lul_settings.InputTarget)
    end
    function genericPoll(lul_device, lul_settings)
        --sendCode("LAMP?")
        --sendCode("SOURCE?")
        sendCode("PWR?")
        --luup.log("Epson Projector Raw Write: " .. "PWR?", 1)
        --luup.io.intercept(lul_device)
        --luup.io.write("PWR?" .. string.char(13) .. string.char(10))
        --luup.log("Epson Projector Raw Read", 1)
        --reply = luup.io.read(3, lul_device)
        --luup.log("Epson Projector Dummy Write", 1)
        --luup.io.write(string.char(10))
        --if (reply == nil) then
        --    log("Epson Projector data: NULL")
        --else
        --    luup.log("Epson Projector data: " .. reply, 1)
        --end
    end


</functions>

-- -------------------------------------------------------------------------
<incoming>
    <lua>
        EpsonIncoming(lul_data)
    </lua>
</incoming>

<startup>doStartup</startup>

<actionList>
    <action>
        <serviceId>urn:micasaverde-com:serviceId:InputSelection1</serviceId>
        <name>ToggleInput</name>
        <run>
            doInputChange(lul_device, lul_settings)
        </run>
    </action>
    <action>
      <serviceId>urn:upnp-org:serviceId:SwitchPower1</serviceId>
      <name>SetTarget</name>
      <run>
          toggleSwitch(lul_device, lul_settings)	  
      </run>
    </action> 
<action>
    <serviceId>urn:micasaverde-com:serviceId:HaDevice1</serviceId>
    <name>Poll</name>
    <run>
	genericPoll(lul_device, lul_settings)
    </run>
 </action>
</actionList>
[/code]

My next step would be to enable verbose logging and look at the log results.

Log levels 51 and 52 will show you the raw i/o over the serial port. You should be able to see what is coming in and out of the serial port…regardless of whether or not your incoming function gets called. So at least you’ll be able to tell if data in some form is making it to Vera.

If you’re looking for a tool to manage / filter the log (shamelss plug)… :wink:

@ebolam,

I also hooked up the serial port to a machine and listed out the hex output after the PWR? command. This was the result: Code: [Select] 50 57 52 3d 30 31 0d 3a Which is Code: [Select] PWR=01:

I think you used a PC, attached the USB Serial and sent out PWR? to your target device.
Then you recieved back: 50 57 52 3d 30 31 0d 3a (meaning PWR=01:).

Correct?

So, your hardware is OK, and I suppose the USB Serial is recognized OK by Vera.
I think the issue is not at Vera at all.

What software are you using on the PC to sent the command PWR? to the target device?
Look at the settings for the USB Serial in this software, especially if it is using some kind of flow control.
This could be RTS/CTS or DTR/DSR or even both.
If so, that would explain why Vera does not recieve any messages from your target device.

In that case it would be useful to shorten the RTS and CTS pins on the USB Serial, or if that does not help to shorten also DTR an DSR pins.

Give it a try!

Understanding it’s a work in development:

genericPoll() doesn’t poll; it gets called just once.

These are not used:
local buffer = “”
local socket = require(“socket”)
local THISDEVICE

and luup.io.write also returns nil. Not that that matters much.

mappingTable should be declared in doAction()

dostartup should return a result as stated above.

luup.io.intercept is a function and needs () after it with a device number

@Snotneus
You are correct about hooking up the serial port to another machine (my linux server next to it), sending the PWR? command, then spitting out the hex returned “PWR=01:”.

On the computer I used cuteterm (random serial terminal with the ability to give me hex back to see if I was getting a , , or something else). The projector only uses three pins on the serial port, gnd, tx, and rx. There is no flow control at all. Baud rate is 9600 with 8 bits and 1 stop. I’ve attached a screen shot of my serial settings in mi casa verde.

I went ahead and turned on 51 and 52 options in the log file and ran my poll function. I saw the following (not sure how to filter for data on a specific device/port, so I’m not sure if the second line is relevent or not)

51 01/29/15 6:14:58.374 0x50 0x57 0x52 0x3f 0xd 0xa (PWR?\r\n) <0x30805680> 52 01/29/15 6:15:04.474 0x52 (R) <0x2ffc4680>

So I’m seeing my device sending something, but not receiving anything (or if I am, it’s not what I expect. I am seeing lots of the second line, so I think it’s unrelated). I’m wondering if the lack of flow control is the cause of the problem. Does anyone know if Mi Casa Verde supports serial connections with no flow control?

@a-lurker
Thanks for the code check. I’ll go clean these items up. This is a copy paste from another plugin to have a semi-tested code used for the base while I got communication working. Some of those variables were used in other functions that this device didn’t need… I’ll get them cleaned up though. How do you setup a proper poll function? Right now I just have a button that runs the poll, which works for testing, but I’d love to get a real poll working on both of my devices.

[quote=“ebolam, post:12, topic:185603”]I went ahead and turned on 51 and 52 options in the log file and ran my poll function. I saw the following (not sure how to filter for data on a specific device/port, so I’m not sure if the second line is relevent or not)

51 01/29/15 6:14:58.374 0x50 0x57 0x52 0x3f 0xd 0xa (PWR?\r\n) <0x30805680> 52 01/29/15 6:15:04.474 0x52 (R) <0x2ffc4680>

So I’m seeing my device sending something, but not receiving anything (or if I am, it’s not what I expect. I am seeing lots of the second line, so I think it’s unrelated). I’m wondering if the lack of flow control is the cause of the problem. Does anyone know if Mi Casa Verde supports serial connections with no flow control?[/quote]

Log Level 51 is outgoing from Vera to the serial port.
Log Level 52 is incoming from the serial port to Vera.

If you are seeing lots of line 52s (each a single byte / character…I assume you are still in RAW protocal)…then data is coming across, and it’s probably part of the the raw feedback from an earlier command . The second line from your log snippet is showing single letter “R” coming over the serial port. That could very well be part of the “PWR=XX” response string being returned from an earlier PWR? command. Can you confirm? (Look at the string of Log Level 52 lines coming back, or better yet, put your code back to CR protocol and see if the entire string is coming back.)

If you can confirm that log level 52 lines are looking as expected, then we know for sure your hardware / cables / settings is not the issue, it’s something with your code that is breaking down and not allowing the incoming procedure to fire. Perhaps if you posted your entire set of device, service and implementation files (after the clean-up suggested by a-lurker) we can find it faster.

For the records, my serial device is similar to yours in that there is no flow control. Only pins 2 and 3 (transmit / receive) and pin 5 (ground 5) are used.

Ok, I got back onto this earlier (was setting up a new rack in my basement, and had a power supply blow on my server :()

I went ahead and looked more in-depth at my logs from vera. The R that is returned from something seams to be unrelated, as it is not consistently appearing after polls. What I did find is that I’m getting an error message when I get what I’m assuming is the response from the serial port that the epson projector is on…

First Example:

01 02/04/15 9:31:48.997 luup_log:107: Epson Projector: PWR? <0x3039a680> 51 02/04/15 9:31:48.997 0x50 0x57 0x52 0x3f 0xd 0xa (PWR?rn) <0x3039a680> 02 02/04/15 9:31:49.001 IOPort::Run RecvFailed 0 close 14 <0x2ff9a680>

Second Example:

01 02/04/15 9:37:25.776 luup_log:107: Epson Projector: PWR? <0x3039a680> 51 02/04/15 9:37:25.777 0x50 0x57 0x52 0x3f 0xd 0xa (PWR?rn) <0x3039a680> 02 02/04/15 9:37:25.781 IOPort::Run RecvFailed 0 close 12 <0x2ff9a680> 02 02/04/15 9:37:30.790 IOPort::Run RecvFailed 0 close 12 <0x2ff9a680>

Anyone know what the RecvFailed 0 close XX means? I get slightly different numbers after the close (12 and 14 so far in my tests). Note that this same cable works fine on a linux machine right next to it. I’ll try swapping it out this evening with my serial cable I’m using for altsteon.

I don’t specifically know what the message means, but I do suspect it is a USB dongle issue. Just because the cable works with a different linux machine doesn’t mean it works with Vera.

I didn’t even bother to mess with taking any chances…before I even started coding I purchased one that has been specifically verified to work…mostly to try and avoid going through what you appear to be be going through. :wink:

http://wiki.micasaverde.com/index.php/Serial_Supported_Hardware#USB-Serial_Devices

I bought the first one on the list from futureelectronics.com.

[quote=“ebolam, post:14, topic:185603”]01 02/04/15 9:37:25.776 luup_log:107: Epson Projector: PWR? <0x3039a680> 51 02/04/15 9:37:25.777 0x50 0x57 0x52 0x3f 0xd 0xa (PWR?rn) <0x3039a680> 02 02/04/15 9:37:25.781 IOPort::Run RecvFailed 0 close 12 <0x2ff9a680> 02 02/04/15 9:37:30.790 IOPort::Run RecvFailed 0 close 12 <0x2ff9a680>[/quote]

I don’t know specifically what it means in relation to serial ports, but I was getting the same error in one of my plugins that uses network sockets… The LuaUPnp engine would throw that eror when the remote device closed the connection… So it seems that it indicated that the IO thread for the plugin has stopped running…

As JoeyD mentioned, it is probably your serial dongle disconnecting from the USB bus due to an incompatibility of some sort. As previously recommended, save yourself the greif… get a confirmed compatible dongle.