[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

solved! Upgrade to Buster and perl Device::SerialPort



	After making an utter ass of myself on this group and
another list, something somebody suggested helped me solve the
problem and the news is good for all.

	I thought it was odd that a serial program I am running
on one buster system was running like the proverbial house on
fire, no trouble at all while that same code blew sky high on
another buster system that I had had to replace the boot drive on
after it crashed.

	We need to be careful when diagnosing trouble not to
think about esoteric issues and be sure the power plug is in the
outlet and the ON/OFF switch is in the On position.

	Well, it wasn't quite that stupid on my part but darn
close.

	For as long as I can remember, debian Linux defaults to
disallowing non-root users in general from accessing the serial
ports.  To access /dev/ttyXx, non-root users need to be added to
the group "dialout" and an upgrade doesn't remove anybody who is
there now from dialout so one doesn't even have to give it a
second thought.

	In this case, this was more like starting from bare metal
and I simply forgot to add me to dialout which is done by

sudo usermod -a -G dialout martin

	One must then log out and back in for the change to take
effect.

	A person on a perl discussion group reminded me that I
should always test for issues like this which is absolutely
correct.  Perl will tell you about the error and kill the program
as it should but you need to be smart enough to put the test in
or you get what I got which is utter confusion because the
program blows right through the bash: /dev/ttyS1: Permission denied
condition and tries to grind on which is impossible since the
port won't work.  There is no reason to continue after that
point.

	The function in perl is called die and it has the ability
to print a string stating what error caused the death but it
doesn't just appear by magic.

	I added the dialout group and that program now also runs
like the blazing house.  Nothing's wrong with buster and serial
ports after all.

	I use the die("cause of death\n") function all the time
but forgot to put it in to a test to see if one could access
/dev/ttyXx and it bit me.

Thanks to all who responded with good suggestions.

Martin McCormick WB5AGZ


Reply to: