Ok,
I will post the original files when i'm at home
I will comment the files in english, so you can follow the programm.
regards,
Thorsten Weiss.
David Norwood wrote:
>=20
> Sorry, I didn't understand how your script was working. Would you send m=
e=20
> your misterhouse script and the stand-alone script off list, and I'll tak=
e
> a=20
> look?
>=20
> David
>=20
> ----- Original Message -----=20
> From: "Thorsten Weiss" <thoweiss@...>
> To: <misterhouse-users@...>
> Sent: Tuesday, March 20, 2007 11:37 PM
> Subject: Re: [mh] Problems creating USB-Serial Port
>=20
>=20
>>
>> Hello David,
>>
>> the unpack function is only for log the data whis was send.
>> my $send_data =3D unpack ('H*',$hexstr);
>>> print_log "$send_data";
>> I't makes any sense, it's only for me....
>>
>> i put it in so i can see that the string is correctly converted.
>>
>> The data which i send to the interface is processed by the pack function=
s
>>> my $on_hexstr =3D pack('C*',@on_bytes);
>>> my $off_hexstr =3D pack('C*',@off_bytes);
>>
>> The interface expects the raw bytes i think.... it works only when i sen=
d
>> the data after processing with
>>
>> pack('C*',@on_bytes);
>>
>> Regards
>> Thorsten Weiss.
>>
>>
>> David Norwood wrote:
>>>
>>> I don't understand why you are using the "unpack" function on the data
>>> before you send it. This converts a byte string into a an ascii
>>> representation of that string. Does the device expect 5 raw bytes
>>> (0xFE,
>>> 0x04, 0x01, 0xBE, 0xD2) or 10 ascii characters "fe0401bed2"?
>>>
>>> David
>>>
>>> ----- Original Message -----=20
>>> From: "Thorsten Weiss" <thoweiss@...>
>>> To: <misterhouse-users@...>
>>> Sent: Sunday, March 18, 2007 10:01 AM
>>> Subject: Re: [mh] Problems creating USB-Serial Port
>>>
>>>
>>>>
>>>> me again...
>>>> I've tried sending data with this short code:
>>>>
>>>> my @bytes =3D (0xFE, 0x04, 0x01, 0xBE, 0xD2);
>>>> my $hexstr =3D pack('C*',@bytes);
>>>>
>>>> my @on_bytes =3D (0xFD, 0x00, 0x00, 0x0E, 0x30, 0x98, 0x00, 0x00,
>>>> 0x00, 0x00, 0x06, 0x73, 0x00, 0x03, 0x01, 0x14, 0x86);
>>>> my @off_bytes =3D (0xFD, 0x00, 0x00, 0x0E, 0x30, 0x98, 0x00, 0x00,
>>>> 0x00, 0x00, 0x06, 0x73, 0x00, 0x03, 0x00, 0x04, 0x84);
>>>> my $on_hexstr =3D pack('C*',@on_bytes);
>>>> my $off_hexstr =3D pack('C*',@off_bytes);
>>>>
>>>> if ($Startup or $Reload) {
>>>> my $send_data =3D unpack ('H*',$hexstr);
>>>> print_log "$send_data";
>>>> }
>>>>
>>>> i#ve put this in mh.ini:
>>>>
>>>> @ Parameter f=C3=BCr HS485PCI
>>>> hs485pci_interface_module =3D hs485pci_interface
>>>> hs485pci_interface_port =3D/dev/ttyUSB1
>>>> hs485pci_interface_baudrate =3D19200
>>>> hs485pci_interface_datatype =3Draw
>>>> hs485pci_interface_parity =3Deven
>>>> hs485pci_interface_handshake=3Drts
>>>>
>>>> then i restartet mh, but i'm not been able to send the data i get no
>>>> respose
>>>> from my interface....
>>>>
>>>> I wrote a stand alone test-programm where i defined the following
>>>> serial
>>>> interface:
>>>>
>>>> my $device =3D Device::SerialPort->new ($port) or die " Konnte $port
>>>> nicht
>>>> =C3=B6ffnen!\n";
>>>>
>>>> $device->error_msg(1); # use built-in error messages
>>>> $device->user_msg(0);
>>>> $device->databits(8);
>>>> $device->baudrate(19200);
>>>> $device->parity("even");
>>>> $device->stopbits(1);
>>>> $device->dtr_active(0);
>>>> $device->handshake("rts");
>>>> $device->write_settings || die "Konnte Einstellungen f=C3=BCr $port ni=
cht
>>>> setzen\n";
>>>>
>>>> after running my test-programm, i could send my commands also from MH=
=20
>>>> but
>>>> the receiving with the said method won't work.
>>>>
>>>> It seems to me that MH din't set the PORT parameters correctly...
>>>>
>>>> Does anybody has a solution for that problem?
>>>>
>>>> Regards,
>>>> thorsten.
>>>>
>>>>
>>>>
>>>> --=20
>>>> View this message in context:
>>>> http://www.nabble.com/Problems-creating-USB-Serial-Port-tf3398171.html=
#a9540515
>>>> Sent from the Misterhouse - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>> ----------------------------------------------------------------------=
---
>>>> Take Surveys. Earn Cash. Influence the Future of IT
>>>> Join SourceForge.net's Techsay panel and you'll get the chance to shar=
e
>>>> your
>>>> opinions on IT & business topics through brief surveys-and earn cash
>>>> http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=
=3DDEVDEV
>>>> ________________________________________________________
>>>> To unsubscribe from this list, go to:
>>>> http://sourceforge.net/mail/?group_id=3D1365
>>>>
>>>>
>>>
>>>
>>> -----------------------------------------------------------------------=
--
>>> Take Surveys. Earn Cash. Influence the Future of IT
>>> Join SourceForge.net's Techsay panel and you'll get the chance to share
>>> your
>>> opinions on IT & business topics through brief surveys-and earn cash
>>> http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=
=3DDEVDEV
>>> ________________________________________________________
>>> To unsubscribe from this list, go to:
>>> http://sourceforge.net/mail/?group_id=3D1365
>>>
>>>
>>>
>>
>> --=20
>> View this message in context:=20
>> http://www.nabble.com/Problems-creating-USB-Serial-Port-tf3398171.html#a=
9588267
>> Sent from the Misterhouse - User mailing list archive at Nabble.com.
>>
>>
>> ------------------------------------------------------------------------=
-
>> Take Surveys. Earn Cash. Influence the Future of IT
>> Join SourceForge.net's Techsay panel and you'll get the chance to share=
=20
>> your
>> opinions on IT & business topics through brief surveys-and earn cash
>> http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=
=3DDEVDEV
>> ________________________________________________________
>> To unsubscribe from this list, go to:=20
>> http://sourceforge.net/mail/?group_id=3D1365
>>
>>=20
>=20
>=20
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D=
DEVDEV
> ________________________________________________________
> To unsubscribe from this list, go to:
> http://sourceforge.net/mail/?group_id=3D1365
>=20
>=20
>=20
--=20
View this message in context: http://www.nabble.com/Problems-creating-USB-S=
erial-Port-tf3398171.html#a9589596
Sent from the Misterhouse - User mailing list archive at Nabble.com.
|