aprsdroid icon indicating copy to clipboard operation
aprsdroid copied to clipboard

PTT by RTS or CAT?

Open yeti7 opened this issue 2 years ago • 66 comments

Hi, I'm Denis (K0TX) - a ham behind digirig project. The interface's sound card works with APRSDrooid, but there is also a serial COM port that allows PTT by RTS signal or CAT with the capable radios. My question is if it would be possible to modify the code to allow these additional more reliable PTT methods?

yeti7 avatar May 24 '22 21:05 yeti7

A +1 from me as well... As far as I know, android has support at least for CDC ACM USB serial ports, but FTDI should work too!

skuep avatar Oct 03 '22 20:10 skuep

I would just like to +1 this as well. It would be great to use aprsdroid without VOX.

adamadam78 avatar Oct 14 '22 03:10 adamadam78

+1 As well. If we could be pointed in the right direction I would love to help make this a reality.

Fallenstedt avatar Oct 20 '22 03:10 Fallenstedt

+1 Just got my digirig and can now use my old Yaesu FT-60 as an APRS device with my Samsung Galaxy. Having to key the transmit manually is goofy when the digirig is exposing a COM port for PTT. Not sure if this is helpful, but the SoundModem software on Windows simply requires the PTT port to be selected and is able to key for APRS transmissions. Not sure if this is as simple to implement on Android but maybe it is?

dwalthermsft avatar Nov 12 '22 04:11 dwalthermsft

+1

sparkiesweden avatar Jan 05 '23 22:01 sparkiesweden

+1

barryshaffer avatar Jan 23 '23 04:01 barryshaffer

I would be very happy to try and actually make this change if someone can point me in the right direction.

charlieb avatar Mar 06 '23 01:03 charlieb

there 13 A pretty good write up in THE Read me file in the code repository. I've done some android dev work using the standard IDE but this app was written in SCALA which I haven't dug into.

barryshaffer avatar Mar 06 '23 02:03 barryshaffer

@barryshaffer Can you link me the write up you're talking about. I'm probably being dense but I can't find it.

My naive guess is that we'd want to inherit from this object https://github.com/ge0rg/aprsdroid/blob/master/src/backend/AfskUploader.scala#L66 and just wrap this one call in PTT on, PTT off. I'm sure there's a lot more housekeeping that would need to be done but in the spirit of ignorant hubris, it doesn't look that hard.

charlieb avatar Mar 06 '23 02:03 charlieb

Here’s the read me: https://github.com/ge0rg/aprsdroid#readme

I do tend to agree with you that the solution should be fairly straightforward. However, I don’t have a scala environment set up to give it a try.

barryshaffer avatar Mar 07 '23 02:03 barryshaffer

I compiled and ran it with android studio out of the box. Nothing external needed for adding scala.

charlieb avatar Mar 07 '23 03:03 charlieb

Denis kindly sent me a digirig adapter that's currently on its way. From a practical point of view, @charlieb you are right, except for the housekeeping:

  1. you need to know when to use USB RTS, probably based on the vendor+device ID of the adapter or based on a setting value
  2. you need to connect via USB serial, which means you have to follow Android's USB attachment callbacks in the beginning, like done in https://github.com/ge0rg/aprsdroid/blob/master/src/backend/UsbTnc.scala#L55
  3. you need to track when the async audio output starts and stops, and trigger RTS accordingly

All in all I think this will become an ugly frankensteined combo of USB and AFSK backends, but I'll keep you updated :)

ge0rg avatar Mar 07 '23 13:03 ge0rg

Thanks for all the effort. I kept thinking, maybe it would be easier to ditch PTT by RTS and settle on CM108-style PTT? It would involve sending USB HID Reports. That could be way more streamlined to implement, but I guess it's not compatible to the digirig?

skuep avatar Mar 07 '23 14:03 skuep

@ge0rg are we to take it that you're going to take this ticket on yourself before us amateurs start deluging you with poorly thought out, half working, unformatted pull requests?

charlieb avatar Mar 07 '23 14:03 charlieb

@charlieb I've been ultra-busy in the last *checks calendar* years, so I'm not going to promise an ETA on this feature. After all, I'm lagging behind fixing the OSM rendering since Android 12, and then some more. If you want to give it a try, or need advice, feel free to do so and to bug me with any issues you encounter. Fastest response times will happen on the APRSdroid xmpp room [email protected] (webchat) btw.

ge0rg avatar Mar 07 '23 14:03 ge0rg

@ge0rg Was never going to ask for a timeline, that's just rude. OK, so I'll take a stab at it. With you backing me up I feel a lot more optimistic about it. Thank you!

charlieb avatar Mar 07 '23 14:03 charlieb

I compiled and ran it with android studio out of the box. Nothing external needed for adding scala.

Well dang, that just highlights my pedestrian level coding ability lol. Maybe I can just help Beta test…

barryshaffer avatar Mar 08 '23 02:03 barryshaffer

Here is the src for a GPL licensed app that does RTS PTT for an example/ideas?? https://bitbucket.org/VK2ETA/radiomsg/downloads/ No idea if that would be remotely useful, but seeing as I'd also love to see PTT control in Aprsdroid, I'll risk it:)

Chuckw97055 avatar Mar 10 '23 03:03 Chuckw97055

@charlieb thanks for taking a crack at this. This is exciting as it will open up a lot of devices that don't have VOX for use with both APRSDroid and digirig. This is the one thing holding me back from purchasing the digirig mobile from @yeti7.

Edit: looks like somebody may have started this already? Not sure if it's useful or not: https://github.com/Swissman1/aprsdroid

Thunter96 avatar Mar 14 '23 01:03 Thunter96

Thanks, those links may turn out to be useful. I'm still at the "this looks like something I might need, I'll copy it, change the name and see if it still builds" stage, otherwise known as flailing. I have forked and I'll probably make a commit tonight if I can get DigiRig to show up in the menus. https://github.com/charlieb/aprsdroid

charlieb avatar Mar 14 '23 02:03 charlieb

If RTS is problematic, a useful hack is to output a constant tone on one audio channel for PTT control, as implemented in FLDIGI for example. A circuit is required on the hardware side but it gets you real PTT control.

Chuckw97055 avatar Mar 18 '23 03:03 Chuckw97055

@charlieb I saw your fork, grabbed the code and put it in Android Studio to try an build an APK to test out. Ran into some errors trying that (Deprecated Gradle stuff). Admittedly I am way out of my lane with this stuff but wanted to give it a shot and see if it was functional enough to test. When it is ready, maybe I can help test since I am out of my depth with the rest.

kyleh928 avatar Mar 21 '23 21:03 kyleh928

Soo... sorry/not sorry for necroing this but would love to see this feature in a future release. (Not a coder so can't contribute that way but I have been told I give good shoulder massages!)

oSPANNERo avatar Jan 09 '24 17:01 oSPANNERo

I wrote a POC commit to enable PTT via RTS in a forked repo here:

https://github.com/bxlentpartyon/aprsdroid/tree/usbtnc-ptt-rts

This is definitely not "good code" yet, and shouldn't be merged even if it works, but I think it does the right thing to some degree. My Digirig will get here tomorrow, so hopefully I can get this properly tested and write a real commit then.

bxlentpartyon avatar Jan 26 '24 04:01 bxlentpartyon

As I review stuff here, I'm seeing that the audio output is probably asynchronous (decoupled from the packet send path), so my idea might be correct in spirit, but also might not actually work reliably/at all. The 50ms padding that I added might be enough to paper over my misunderstanding, but that doesn't make it correct.

Anyway, I'll look at this more when I can actually test it. Just wanted to point out my own mistake :)

bxlentpartyon avatar Jan 26 '24 05:01 bxlentpartyon

I got my Digirig today and tried this out. With one more small tweak, I was able to eliminate the the behavior where the radio is keyed contintuously after the Digirig is initialized, and I'm able to see it key the radio when packets are transmitted. However, my traffic doesn't seem to be making it to the nearby digipeater.

To be clear, I'm doing this on a Baofeng, so it's super hard to say if the radio is the problem. I can say that I had APRSDroid working quite well on VOX mode with the BTECH APRS cable, but yesterday when I was playing with it, it was barely hearing any packets off the digipeater, and transmission was spotty/not working at all. FYI I do have a fairly decent homemade half-wave antenna hooked up, which the guys on the local repeater say sounds fine.

I did a bit of troubleshooting here on my own, by plugging earbuds into the audio port on the Digirig, and I'm not getting any sound when packets are transmitted. However, I don't know if this is even a valid test. I did get sound during transmission when I plugged my earbuds into the serial jack, but, again, I have no idea if that is a valid test.

Anyway, I'm pretty confident I can get this working, but I think I need a little help with troubleshooting here. @yeti7 @ge0rg is it appropriate to have that conversation here, or should I maybe post on the Digirig forum?

bxlentpartyon avatar Jan 27 '24 02:01 bxlentpartyon

I'll add an additional note that when I tried hooking the radio up to the serial port jack on the Digirig (using the appropriate cable) the radio did key up during transmission, but it keyed off and on rapidly during transmission. If the serial jack/cable are the ones I should be using, then there might just be another layer of issues to debug here.

bxlentpartyon avatar Jan 27 '24 02:01 bxlentpartyon

I did some more testing today, and I think (unsurprisingly) that something has gone funky with the radio. It was transmitting packets reliably with the AFSK/VOX setup last week, and nothing is making it out now, even when sitting right next to a local digipeater. I'm going to upgrade to a new HT and continue working there. Hopefully more to come in a week or so.

bxlentpartyon avatar Jan 27 '24 19:01 bxlentpartyon

I got my new radio yesterday and got to work on this. It's ended up being a bit more complicated than I initially realized, but should be totally do-able. I worked on top of @charlieb's commit to produce this branch:

https://github.com/bxlentpartyon/aprsdroid/tree/digirig

I was able to get it to transmit packets, but RX isn't working yet. Probably partially because the code and branch are both super sloppy right now. Anyway, it's working to some degree. More soon.

bxlentpartyon avatar Feb 04 '24 08:02 bxlentpartyon