Windows 10 problems

General HouseBot discussion. Any issues that don't fit into any of the other topics belong here.
Post Reply
jaaasgoed
Member
Posts: 16
Joined: Thu Oct 04, 2012 10:56 am

Windows 10 problems

Post by jaaasgoed »

Hi,

I just installed Housebot on windows 10 and it is not working. The problem seems to be in the serial interface. I use a USB->serial converter that is working fine with housebot on a windows XP machine.

When I start housebot, all checks out and the serial interface is found and initialized (I can also see this on the interface since it has a green light that stops blinking and turn solid green when the interface is found, same on the XP machine). First error I see in the "recent errors"box is: Unable to start IPC server Error = Only one usage of each socket address (protocol/network address port) is normally permitted.

When I try to execute a task, I get the following errors:

Error reading COM port. error = Insufficient data in read buffer.
Due to an error, Device [Switch C1] Property [Power State DID NOT change.

Here you can find a copy of the log cvs from a couple of tries:

8/31/2017 05:55:05 PM CM11 interface Debug Responding to power fail poll.
8/31/2017 05:55:05 PM CM11 interface Debug --> Read NOT Pending... WriteData. 8 bytes
8/31/2017 05:55:05 PM CM11 interface Debug Writing [8] bytes [9b 07 6b 05 56 20 60 00]
8/31/2017 05:55:07 PM CM11 interface Debug CSerialPort::ReadData() is requesting 1 bytes and there are only 0 bytes [] in the [Unsolicited] read buffer. Waited 1 seconds.
8/31/2017 05:55:07 PM CM11 interface Debug The [Solicited] Buffer contains 0 bytes [].
8/31/2017 05:55:07 PM CM11 interface Debug --> Read Pending... WriteData. 1 bytes
8/31/2017 05:55:07 PM CM11 interface Debug Writing [1] bytes [8b]
8/31/2017 05:55:21 PM CM11 interface Debug CSerialPort::ReadData() is requesting 14 bytes and there are only 0 bytes [] in the [Solicited] read buffer. Waited 10 seconds.
8/31/2017 05:55:21 PM CM11 interface Debug The [Unsolicited] Buffer contains 0 bytes [].
8/31/2017 05:55:21 PM CM11 interface Debug CM11A Firmware version [0]
8/31/2017 06:03:45 PM CM11 interface Debug Sending X10 Command - Begin
8/31/2017 06:03:45 PM CM11 interface Debug Sending X10 Command Part 1
8/31/2017 06:03:45 PM CM11 interface Debug --> Read Pending... WriteData. 2 bytes
8/31/2017 06:03:45 PM CM11 interface Debug Writing [2] bytes [04 2a]
8/31/2017 06:03:57 PM CM11 interface Debug CSerialPort::ReadData() is requesting 1 bytes and there are only 0 bytes [] in the [Solicited] read buffer. Waited 10 seconds.
8/31/2017 06:03:57 PM CM11 interface Debug The [Unsolicited] Buffer contains 0 bytes [].
8/31/2017 06:03:57 PM CM11 interface Error Error reading COM port. Error = Insufficient data in read buffer
8/31/2017 06:07:14 PM CM11 interface Debug Sending X10 Command - Begin
8/31/2017 06:07:14 PM CM11 interface Debug Sending X10 Command Part 1
8/31/2017 06:07:14 PM CM11 interface Debug --> Read Pending... WriteData. 2 bytes
8/31/2017 06:07:14 PM CM11 interface Debug Writing [2] bytes [04 66]
8/31/2017 06:07:25 PM CM11 interface Debug CSerialPort::ReadData() is requesting 1 bytes and there are only 0 bytes [] in the [Solicited] read buffer. Waited 10 seconds.
8/31/2017 06:07:25 PM CM11 interface Debug The [Unsolicited] Buffer contains 0 bytes [].
8/31/2017 06:07:25 PM CM11 interface Error Error reading COM port. Error = Insufficient data in read buffer

I tried several compatibility modes including XP SP2 what is running on the PC that is working. I start housebot as admin.

Like I said, I know the converter and CM11 work, since I can test them on the XP machine. The converter also works fine on windows 10 with other software (tested it with a serial terminal)

I hope you can help me with this.

EDIT: It also seems that I am unable to stop the HouseBotServer.exe. I get an Access denied error so I need to restart my PC every time I want to restart housebot, quite annoying. Also tested it on a windows 8 machine and get the same problem/errors.

Thanks,

Roel
ScottBot
Site Admin
Posts: 2786
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Re: Windows 10 problems

Post by ScottBot »

Roel,

For the "Unable to start IPC server", check to make sure you don't have multiple external control devices that are sharing the same port number. It's probably something like that, but it points to something trying to open a socket on a port that is already in use.

For the serial issue, it appears as though HouseBot isn't receiving any data back from the cm11. I would first check to make sure the flow control for the usb->serial driver is setup right. While you are in there, double-check the other port parameters setup for the driver. If not that, it could be the cable, but I would suspect the driver first.
Scott
jaaasgoed
Member
Posts: 16
Joined: Thu Oct 04, 2012 10:56 am

Re: Windows 10 problems

Post by jaaasgoed »

Hi Scott,

The IPC error pops up in a freshly install of housebot, so download->install->run for first time->IPC error. But I assume that has nothing to do with the serial issue, so I will let that go for now.

Regarding the driver settings, I'm not sure what you mean. In windows hardware manager I can set flow control to hardware or Xon/Xoff. I tried both, no change. But I assume housebot sets the correct serial parameters when it loads the serial driver? The hardware is working ok. Here is what I do (with cm11 connected to the serial output of course):

1: Plug USB cable of USB to serial converter in win XP machine -> start housebot -> run task -> cm11 and lights respond as expected -> close housebot -> unplug USB cable.

2: Plug USB cable of USB to serial converter in win 10 machine -> start housebot -> run task -> error as described.

As said before, it seems like housebot is able to open the port judging by the status LED on the converter, but there is no indication of data being sent in the first place, something that I do see in the win XP setup even with the cm11 unplugged from the serial port.

I tried both the standard windows drivers and the device drivers of the manufacturer and it makes no difference.

Also, I managed to find and download the original active home pro software from Marmitec, and it has no trouble controlling the CM11 module on the windows 10 setup. It is most definitely a housebot issue.

Lastly, the fact that HouseBotServer.exe does not close is a result of the serial problems. When I close housebot, the UI closes, but housebotserver.exe keeps running with ~30% cpu usage and keeps hogging the serial port.

Is there any way we can solve this? I like housebot a lot, but I need it to work on newer machines.If it's an option, I am willing to test with you if that is of any help.

Please let me know if there is anything I can do to help resolve this.

Roel.
ScottBot
Site Admin
Posts: 2786
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Re: Windows 10 problems

Post by ScottBot »

In doing a quick bit of research, I do see others complaining about USB->serial converters not working well with the CM11. However, if you were able to get home pro working through the converter, it seems like it should be possible somehow.

There are a few flow control parameters that we could play with to see if it makes any difference. I'm not sure what to suggest for the settings, since it works fine with the defaults without the converter. However, it's very possible that the converter driver will look at the parameters differently.

I've attached a new CM11 plugin DLL that allows you to set different DTR and RTS flow parameters from the registry. They get read each time you try and enable the hardware interface (you don't have to stop housebot each time). To install the DLL, stop housebot and copy the DLL in the zip to the HouseBot\Plugins\Interfaces directory over the old one (you might want to save the old one first).

You will need to create two new DWORD registry keys.
HKEY_CURRENT_USER\Software\CeBotics\HouseBot\CM11 Port Settings\Modem DTR Flow
HKEY_CURRENT_USER\Software\CeBotics\HouseBot\CM11 Port Settings\Modem RTS Flow

For starters, I would set them both to 0. Then try values (numbers) from here. If you don't want to read it all, just try 0, 1, 2, & 3.
Attachments
CM11A.zip
(32.52 KiB) Downloaded 475 times
Scott
jaaasgoed
Member
Posts: 16
Joined: Thu Oct 04, 2012 10:56 am

Re: Windows 10 problems

Post by jaaasgoed »

Hi Scott,

Back after some testing. I added the data to the registry and copied the new dll to the plugin folder, but nothing really changed. Here is what I get:

Copy dll.

Add DWORDS with value X (tried different valus) to registry -> reboot -> run housebot -> Set Enabled to Yes (defaults to No every time I start housebot) -> serial port is opened (light on converter turns steady green -> run task -> same error.

Now when I set Enabled to No again, the serial port is not closed (LED stays lit). When I then change the values in the registry and try to set it to Yes again, housebot goes into "Not Responding" with ~30 CPU usage and that is it. Reboot is needed.

I have attached 2 screenshots. One shows what I added to the registry, just in case I did something wrong there. The other shows what happens after I try to set the interface to Enabled again after changing the registry values.

Image

Image

Just downloaded a packet sniffer, so I will give a new reply shortly with my findings on that.
jaaasgoed
Member
Posts: 16
Joined: Thu Oct 04, 2012 10:56 am

Re: Windows 10 problems

Post by jaaasgoed »

Back with some results from the rs232 packet sniffer. I'll see if I can also find a way to monitor the signal lines, but for now, here is the TX/RX data:

First from activehome when I set switch C4 to on:

Image

This seems to be correct, as the switch responds by turning on.

Now housebot. When housebot is started the folowing string is sent:

Image

And that is it. No more serial data is sent or received.

I have to add that this is probably only internal data between housebot and the driver. I see no evidence on the converter itself that the data is actually being transmitted to the CM11 over the serial line.


EDIT:

This is what activehome sends the to CM11 @ startup. This data IS actually sent over the serial line according to the converter:

Image
ScottBot
Site Admin
Posts: 2786
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Re: Windows 10 problems

Post by ScottBot »

Lots of great info, thanks.

I forget about HouseBot hanging, so my advice that you just need to re-enable the hardware interface to get the new registry settings was probably not accurate. I'm guessing it's hanging in the OS kernel or driver somewhere, since it never really goes into a read/write loop anywhere in the code.

The difference in the initialization data between housebot and active home is that I send a clock set command just to initialize the cm11 first. In the attached plugin, I removed that call to more closely match the activehome sequence.

I really doubt the data that is being sent is causing a problem. I really think it's the control lines (DTR/RTS) that are causing the problem. The fact that you see some data being sent looks to me like the send data is either not being relayed from the converter to the cm11 or the receive data isn't being received back. Either way, that's exactly what the control lines are designed for (not sending data over the TX/RX lines until the end is ready). I don't think the CM11 even uses the control lines, but the converter/driver may.

I'm not sure if there's a method with software to see the control line states and compare, but I think thats where the answer lies.
Attachments
CM11A.zip
(32.51 KiB) Downloaded 487 times
Scott
jaaasgoed
Member
Posts: 16
Joined: Thu Oct 04, 2012 10:56 am

Re: Windows 10 problems

Post by jaaasgoed »

Well, down the rabit hole we go.

The new ddl did not work, so I drove to my office to get another USB-> RS232 converter. This time a bog standard FTDI one. The idea was to null-modem it to the other one to see what was actually sent over the RS232 line. As expected, nothing was sent, not even the string that showed up in en packet sniffer. Somewhere between housebot and the driver, the data is lost somehow.

Then I got the genius (cries a little inside) idea to see if housebot would actually work with the FTDI converter. And what do you know? It does! With the standard ddl no less. Here is a screenshot of what housebot sends during startup with the original dll (this is data that is actually going over the cable, picked up at the other end at the CM11):


Image

And this is what is being sent when I send the command to turn C4 on:

Image

Same as with ActiveHome. Nice.

So it just comes down to what kind of USB->serial converter you are using. Somehow, housebot does not like the (keyspan in this case) converter's driver, while the FTDI ones will do just fine. Also note that this converter worked fine under win XP, so it must be a win 10 thing.

So, as for me, my setup works just fine for now. But if you like, we can look further into why it doesn't work with the other converter. The thing itself works just fine, since I used it to pick up the data at the other end of the cable. The terminal software doesn't seem to be having any problems with it.

Thanks for your help thus far!
ScottBot
Site Admin
Posts: 2786
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Re: Windows 10 problems

Post by ScottBot »

Awesome! I think if you're happy with it now, I'm happy with it. If I had an idea of what to try next, maybe I'd want to try and resolve this fully, but I don't.

Just glad you got it working.
Scott
yaccri
HouseBot Special Member
Posts: 304
Joined: Wed May 07, 2003 2:19 pm
Location: Tel-Aviv, Israel
Contact:

Re: Windows 10 problems

Post by yaccri »

I work a lot with USB->RS232 converters.
From my experience, Windows versions higher then XP are not very friendly with RS232 converters.
Some devices that worked fine under XP don't work under higher versions.
I found that FTDI converters solved these issues.
Steve Horn
HouseBot Guru
Posts: 747
Joined: Wed Apr 02, 2003 8:10 pm
Location: Pelham AL

Re: Windows 10 problems

Post by Steve Horn »

yaccri,
Good to know, as I am in the very early stage of considering "upgrading" the HB server from WIn7 to Win10. I don't currently have any USB/RS232 converters in use but I am eat up with USB and RS232 serial devices and am about out of both port types. And every time I add a serial device nothing but headaches accompany it, especially if its RS232. Hence, I am not looking forward to the Windows upgrade. No good will come from it.
Steve
jaaasgoed
Member
Posts: 16
Joined: Thu Oct 04, 2012 10:56 am

Re: Windows 10 problems

Post by jaaasgoed »

Hi everyone,

Hope you're all doing well.

Been a while but just thought I'd report that the FTDI interface also works with Windows 8.1. My old HB PC crashed (no backup of course) so I had to start from scratch. Did the new install on an old Windows 8.1 laptop and it works like a charm. I can also add that you only need TX/RX for the people who are interested. The 4th signal is connected to DRT, but apparently it's not used.
Post Reply