Firstly apologies for the large numbers of emails I've sent to the group =
this weekend, I was hoping to finish a project but I guess it was not to =
I have two serial ports set up in MH one at 9600 on com 1 for my weeder =
boards and one at 2400 on comm 2 for some RF stuff I'm working on.
if I use the following;
$test_s =3D new Serial_Item('NOP', 'up','serial2');
$test_s -> add ('zapp', 'output', 'serial2');
then every thing is fine when sending out data, but it does not respond =
to data coming in. After checking things I unplugged my weeder boards =
from com1 and sent the data into com1. Everything worked fine.=20
Even though the items are set up for serial2 the data i/p has to come =
from serial1 for it to work, all output works fine and goes to the =
Just to add even more confusion if I use
$serial_out =3D new Serial_Item(undef,undef,'serial2');
Then I can read data from $serial_out from the correct com port, but =
still non of the items function for data in on comm2?
Any help on finding this problem would be greatly appreciated.
From: Bruce Winter <bruce@mi...> - 2001-03-25 18:22:35
> Firstly apologies for the large numbers of emails I've sent to the group
this weekend, I was hoping to finish a project but I guess it was not to be
No harm in asking questions. What is the project you are working on anyway?
Sounds like maybe a custom pic based LCD keypad??
So, to review your problem, for this code:
$test_s = new Serial_Item('NOP', 'up','serial2');
$test_s-> add ('zapp', 'output', 'serial2');
print "incoming=$state" if $state = said $test_s;
You can do "set $test_s 'up'" ok to send data out, but you never see
anything via the print incoming event? I'm not sure what the problem there
might be. This is exactly what we do elsewhere (e.g.
mh/code/bruce/tracking_aprs.pl and phone_modem.pl).
Or is the problem that you get the above print ok, but your want to have
Serial_Item object states set according to the incoming serial2 data? If
so, I think something like this would work:
&process_serial_data($state) if $state = said $test_s;