Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: Cannot write to, or read from, the SerialPort

by Marshall (Canon)
on Jun 20, 2022 at 22:01 UTC ( [id://11144884]=note: print w/replies, xml ) Need Help??


in reply to Re: Cannot write to, or read from, the SerialPort
in thread Cannot write to, or read from, the SerialPort

I am also glad that you got this thing working to your satisfaction! Normally, I would think that these extra delays would not be necessary. I suggested that to simplify the situation (which is always a good idea for debugging). The delay that you have gives enough time for the command to be sent and for the radio to have already decided on its response. I suspect that there is something wrong with the hardware flow control handshake. What exactly is wrong is very configuration specific - could even be a hardware defect in your USB-Serial adaptor gizmo.

I run the CAT I/F at 38400 baud to talk to a K3. A normal contest logger will keep a steady stream of commands: what freq and mode are you on? to the radio - multiple times per second. This is "background polling noise" that is continuous. When I have the spectrum display attached, I get what is called a "waterfall" display of signal strengths over a range of frequencies. With one logger, I have macros like "100" or "20" that I type in. The logger sequences my macro's radio commands in between the normal polling so that there are not conflicts. With say the "100" command, normally the frequency display will be set up with my current frequency in the middle and I will see 50 KHz on either side. However, if say I am near the lower band edge, the display will show the lower band edge on the left and show 100 KHz up from that edge with my frequency shown wherever it happens to be. Some loggers do not allow me to write my own radio macros and those commands would come from a distinct, separate application. Therefore the need for this "man-in-the-middle" box to do the command sequencing to the radio. If my friend really wants this, I may have to write it in C. Or I suppose I could build a separate hardware box with an Arduino processor as a hardware solution.

In general, using fixed delays after some hardware (or software) command is a bad idea. However, your situation is simple enough that I wouldn't worry about it.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11144884]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-03-29 15:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found