I wrote a plugin for Homeseer to control 8x VM140 I/O cards.
(Now i’m testing the plugin with 2 cards. The IO’s are not connected)
The plugin works great, but sometimes homeseer notify a valuechange at the Inputs. (random value change of 10% til 100%)
Also i get sometimes a crash. Then the IOcard stops working, the Digital Inputs 1-3 are high and 4-8 are low. The outputs won’t work anymore, and the RX/TX led is off. I reboot the IOcard by unplug and replug the power and USB, and let homeseer reconnect the cards.
Is it possible that the cards can’t handle a 24/7 using? Or getting a buffer overload?
Yes, i’m using the latest drivers downloaded from youre site. I was awair of the CD-driver-problem
My current OS is Windows XP Pro (SP3)
This problem is also happening on an other XP machine (where i developed the plugin) For that reason i tested on the current machine.
The plugin language is VB.NET.
I programmed it like:
Open device
Stop Timer 'ReadInputTimer
CloseDevice (becouse i want to rescan open devices without reboot homeseer)
For 0-7
Opendevice (loopnr)
end for
Start Timer 'ReadInputTimer
Read inputs (timer 50ms like sample)
If Timer elapse
Stop Timer
for 0 -7
if connected(loopnr) = true
Read inputs
End if
' next loopnr
End for
Start Timer
Set Output
Stop Timer 'ReadInputTimer
Set Output
Start Timer
This script will read ones and run til i closed it manualy, or homeseer turnd down
The only mayer diferents with the Velleman Sample is that i put a loop for card 0 to 7 in it.
The power supply are 2 seperated stable 12VDC.
The USB cables are the origional. (not extended)
I do not see any problem in your procedures.
As a test you may try with this newer Microchip’s MCHPUSB driver. This driver works in 64 bit OS too.
Here is a link to download the driver: box.net/shared/8ksvv3zl1o
You have to remove the old driver and install this one. You may check in the Device Manager the date of the driver should be 19/12/2007 and version 1.0.0.6.
Here you can download a demo program to test the operation of the card with this new driver: box.net/shared/lc0m52r8ey
You have to copy the K8061.DLL and the MPUSBAPI.DLL from this demo to the Windows’ System32 folder and maybe to your project folder. (E.g. in the \bin folder of the Visual Basic 2008 project.)
You cannot use the K8061.DLL in the Vistapack. You have to replace it with the K8061.DLL and the MPUSBAPI.DLL from this demo folder.
Here is a link to download a full project in VB 2008 Express. It is using this new driver and these new DLLs. box.net/shared/5n393f1ifs
I downloaded the new drivers and installed it with succes.
With the TEST program that i downloaded from the last post the cards working fine.
But my homeseer plugin won’t.
When i opend the “full project download”, i saw that the option connected(“cardnumber”) is gone. And i wrote my script with this option so that can explanse my bug. I also saw that this is not the layout like the TEST file. Also there are some unlogic floating buttons with a odd function (when Button0 press there comes a value of 199, Button1 function unknowed) Is this a relaiable script where i can copy funtions of, or is there a projectfile from the downloaded TEST file?
One or the other, i have to reprogram my script to test this option, so is’t shure that the new DLL is better (than it’s always better for my plugin to reprogram)? And is this the latest driver/DLL, or are ther newer ones?
Now the K8061 Visual Basic 2008 Express demo project is updated.
The following functions added:
Private Declare Function PowerGood Lib "k8061.dll" (ByVal CardAddress As Integer) As Boolean
Private Declare Function Connected Lib "k8061.dll" (ByVal CardAddress As Integer) As Boolean
Also the project files are renamed: some “K8055” replaced with “K8061”.
but ehhhhh,
I notest another problem in the new DLL.
Ones you connected the cards and you close the connection by calling CloseDevices(), The devices won’t reconnect when calling “While not OpenDevice() = -1 loop”
i need this so that i can expand my system without putting it down. And becouse i controlling my house with it…
(If not possible i can live with that)
Now also the VB 2008 Express demo project is updated.
Link: box.net/shared/5n393f1ifs
A button “Close” is added.
After the Close is pressed you can even disconnect the USB cable of the card.
When USB reconnected, just click “Connect” and you can continue communication with the card.
Unfortually i have to say that the problem is not 100% gone.
When the plugin runs for a day or so (Not a specified time) it happens that a card is disconnecting by himself.
It is not the funcion Disconnect() what is called becouse i didn’t get a log message and other cards working fine. When calling the script “Reconnect” it works 100% again (Til it’s running for a copple of hours / day)
Reconnect script:
[code]Dim i As Integer
Disconnect()
While not i < 0
i = Connect()
End While[/code]
I write a stand-alown EXE that reads the inputs from all the cards. (i wrote it like in my plugin)
So maybe it gets clear where the problem is.
Homeseer
My script
Velleman DLL
If i get a failer with this script also, i will upload it to the internet and i hope you (Velleman) want’s to look over it, and maybe have a test for them selve.
i let you know if it works fine now.
(p.s. if you have another idee for the problem, its always welkom )
Sorry, but i have still problems (I think the problem is hiding for use ).
i can specify it more, so here i go.
When i read the inputs there are no problems.
When i control outputs with a VB/windows program it runs all oke. (Control is 5 sec on 5 sec off loop)
When i control outputs with homeseer the card fails after a little while (+/- 10 min). (Control is 5 sec on 5 sec off loop)
When the card fails the
*** Run led is flashing
*** RX and TX led is off
*** With the command Connected(0) i get still True
*** No outputs will switch
*** Inputs stays at the latest situation
*** In the Device Manager of Windows there no problems
*** When i want to use OpenDevece() after a fail i get a -1 return
*** The only way to fix it is to disconnect and reconnect the USB cable
How is it possible that my script cause this error?
My script compares the wanted status with the current status so i don’t have unnessesary communication trafic.
i’m still working on the problem, but now i have accomplished something?!?
4 x K8061 cards are connected to the pc (addr. 0-3)
i let my pc turn digital output 1-8 from addr 0 turn every 5 sec on and off.
Without a powerfail, or USB disconnect is the Interfacecard with the jumpers set on addr 1 running on the commands of IOCard addr 0 and Card 0 won’t do anything, All statusleds are correct.
I’m think there is still a bug in the Velleman hardware / software, because i can’t manipulate the adress by software.