[Xastir] Sharing serial port with Xastir

Jason KG4WSV kg4wsv at gmail.com
Fri Jan 1 10:58:04 EST 2016




-Jason
> On Jan 1, 2016, at 1:42 AM, Danny <mynixmail at gmail.com> wrote:
> 
> I have written an elaborate script trying to get gtkterm and Xastir sharing
> /dev/ttyS1 ...
> 
> This is what I attempted to do:
> .xinitrc
> --------
> - start Xastir
> - get contents of /var/lock/LCK..ttyS1 (store it in a BASH variable)
> - clear /var/lock/LCK..ttyS1 (not deleting the lock, just clear it)
> - start GTKterm
> - get GTKterm's PID (store it in a BASH variable)
> - pipe GTKterm's PID into /var/lock/LCK..ttyS1
> - do what I need to do with GTKterm and /dev/ttyS1
> - clear /var/lock/LCK..ttyS1
> - write Xastir's PID back into /var/lock/LCK..ttyS1 (from BASH variable)
> - and repeat whenever necessary ...


Sorry dude, this is a total waste of time.  You don't "clear but not delete" a lock - there's no such thing. Serial ports are not shareable. Xastir is not designed for external control of ports. Even if you press on and seem to get some results, your approach  Will. Not. Work. 

These locks are known as advisory locks.  The idea is that everyone agrees to play nice and honor the lock. You are violating this principle. The presence of the PID inside the lock file is purely informational, so one can find which process locked the resource (this is mostly a troubleshooting tool for humans). 

Your likely choices for a correct solution are, in no particular order:

- learn Linux ax.25 networking, reconfigure xastir to use ax.25, and write your script to beacon using ax.25.

-  configure xastir to igate your beacons, then write a script to talk to xastir's server port and let xastir do the work of talking to the TNC.  IMO this is your best bet. 

Technically there are other choices, like buy another radio/TNC, write some incredibly complicated serial mux code, etc, but they probably aren't practical. 

-j



More information about the Xastir mailing list