-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PTT by RTS or CAT? #324
Comments
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! |
I would just like to +1 this as well. It would be great to use aprsdroid without VOX. |
+1 As well. If we could be pointed in the right direction I would love to help make this a reality. |
+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? |
+1 |
1 similar comment
+1 |
I would be very happy to try and actually make this change if someone can point me in the right direction. |
|
@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 |
Here’s the read me: 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. |
I compiled and ran it with android studio out of the box. Nothing external needed for adding scala. |
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:
All in all I think this will become an ugly frankensteined combo of USB and AFSK backends, but I'll keep you updated :) |
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? |
@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 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 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! |
Well dang, that just highlights my pedestrian level coding ability lol. Maybe I can just help Beta test… |
Here is the src for a GPL licensed app that does RTS PTT for an example/ideas?? |
@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 |
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. |
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. |
@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. |
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!) |
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. |
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 :) |
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? |
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. |
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. |
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. |
Briefly looking through the USB Serial library from felHR85 that is used by APRSdroid, I don't see any mention of ACM support which is the interface that the CM108 uses for AIOC. It's possible I missed it or am misunderstanding how it works, but that might explain why my earlier test of the pre-release APK published above was not able to control the RTS signal on my AIOC adapter. I took a look at the USB Serial Terminal app from the Play Store that I've confirmed does work with it and can toggle the PTT switch on my radio and it uses a different USB serial library at mik3y/usb-serial-for-android which clearly calls out CDC/ACM support in the README and driver source. Also the current library hasn't had a release for 5 years and only a small handful of unreleased changes since then. I might try swapping libraries and see if that improves support or not. |
The AIOC supports either RTS&DTR or CM108 for PTT. ACM is the USB class for a serial adapter and on its own has nothing to do with CM108 (which is HID and not ACM). |
Yes, I am aware that the HID interface can be used to control the PTT on the AIOC, but so can the RTS&DTR signals and those are provided by the ACM interface. That offers two different ways to control the PTT, but there is zero support for HID in APRSdroid and there is support for RTS&DTR being added to APRSdroid, it makes more sense to go for the latter in supporting for the control interface for PTT. CM108 actually has 4 different USB interfaces that it presents, USB Audio, HID, DFU for firmware updates, and ACM for serial port control. Finally, ACM is a standard interface used by a number of other serial adapters besides the mainstream FTDI and Prolific chips so this will increase the number of devices supportable than just the CM108 which using a unique HID interface as an alternative and not supported by anything else. |
I was just trying to clear up some confusion in your earlier post:
I have no experience with Android but given it is based on a Linux kernel, it shouldn't be hard to implement HID control. But that is beside the point here.
I am pretty sure that the CM108 has neither DFU not ACM. Are you confusing this with my AIOC project?
I am pretty sure that FTDI serial devices have their own kernel driver and don't use the ACM kernel driver, thus I don't expect them to be supported by this. Correct me if i am wrong. Btw, In terms of breadth of support, it would be wiser to implement CM108 style PTT via HID, because a lot of people are using this solution with the actual CMedia devices. And best part is, the AIOC would be supported as well, because it implements the same interface. (Other than the differing USB VID:PID of course). |
The Linux kernel has support for HID but that doesn't mean that it's exposed in a way Android Apps can just use. I did not see anything in the Android API that would offer access to HID Raw devices, which is what would be needed here. That leaves implementing HID in userspace and using the barebones USB interfaces to control the device. While HID is pretty simple, it's not dead simple with the complexity of the HID Report parser that's needed and adds a bit of complexity over just extending RTS/DTR to one more device, in my perhaps not-so-humble opinion. :-) As for the CM108, maybe I am confusing things. I thought the AIOC board is based on the CM108 chip. Maybe it's just implementing the interface that was created by the CM108, but in all my comments, I am referring to the AIOC board which is what I am trying to get working with this. The AIOC does implement all those interfaces I mentioned whether the CM108 does or not. If the goal is to just add AIOC support to this request, then implementing ACM seems to be the most straight-forward to me so it's just another serial port interface. I have already confirmed that I can control my radio via the AIOC using the RTS with a different USB Serial library that was developed for Android. In my last comment, I was say to support ACM in addition to the main stream serial adapters that implement their own proprietary interfaces like FTDI and Prolific. I am well-aware that the USB-IF was slow on getting a standard out and we ended up with a bunch of common proprietary interfaces along with a vendor-neutral standard to deal with. The current USB Serial library in APRSdroid only seems to include support for these earlier, but well-established proprietary interfaces at the moment. I have never heard of CMedia devices or CM108 prior to discovering the AIOC. But, I can imagine others implementing other devices that require ACM. There are a number of Arduino board with native USB (not FTDI) and therefore implement ACM so support for ACM, regardless of whether the AIOC uses HID or ACM, could be useful. Also, even if not for Audio+PTT control, the TNC interfaces can benefit from ACM support and be used with a full Arduino TNC. |
The AIOC is much different than Digirig devices. Digirig offers the Digirig Mobile with a CM108 chip alongside a Serial Chip that are combined into one USB port. It's a great tool offering soundcard and Cat/Rig control over one USB port. There is also the digirig lite wich is only a cm108 chip with reliance on GPIO 3 for ptt. I have both as well as a homebrew of the digirig lite(basically a bare PCB with a transistor connected to gpio 3 and the ptt circuit of my radio) both work well with this cli utility on Linux (https://github.com/twilly/cm108) AIOC is an STM chip the emulates the hidraw support of gpio 3 that many other software supports. This means that if your software supports cm108 sound cards for ptt than the AIOC will work identically. It's a really smart way to bake in additional support for a new hardware standard by emulating a common homebrew/commercial product with more support. |
II was so excited to see this as I have tried to get APRSDroid to work with my Alinco DR-735T and digirig. I was always able to RX packets on APRSDroid but never TX using AFSK. If I tried USB than it would just get stuck on PTT until I clicked off tracking. I downloaded your release and when I go to start tracking after choosing AFSK and Digirig or send position it crashes the app. Any suggestions? |
@skteagle Any chance you are able to attach to your phone with ADB and get a logcat debug log while it is crashing? |
Hello,
I reset my phone and reinstalled the version and now it seems to be working
fine without crashing.
Thanks for developing this, so happy.
…On Sat, Oct 19, 2024 at 12:29 AM Loren M. Lang ***@***.***> wrote:
@skteagle <https://github.com/skteagle> Any chance you are able to attach
to your phone with ADB and get a logcat debug log while it is crashing?
—
Reply to this email directly, view it on GitHub
<#324 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BAXAGIZC7AUDBRBQH2PQTF3Z4H35ZAVCNFSM5W25ANRKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TENBSGM3DCOBTHAYQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I installed the original test version of this, my tablet running android 14 won’t let me install any of the updated versions, I can transmit without any issues but I can’t get it to decode anything. Any advice? |
Uninstall and reinstall. Does it install then? |
I can’t get the digirig version to work with offline map files. I have been able to do it with the standard apk on other devices but not in my tablet with the digirig version. Not sure if it is an issue with my tablet or with the build |
If you're talking about the official version of APRSdroid, it does NOT do offline maps. It's broken. If you're referring to my build, it does do offline maps, but I have yet to implement the DigiRig commit into it. So if you're using an extremely old version of APRSdroid, it will do offline maps, but doesn't play well with newer Android versions. |
I guess the APRSdroid version I’m running on my old tablet is an older version since it’s an older tablet. Do you plan on adding the digirig functionality to your build? Is there an apk for your build? Thanks Scott |
Yes and yes. I'm currently making some major additions to APRSdroid. Here's my latest public release. Google Maps is not included. Use OSM! I will add DigiRig and BLE support soon. But I need some feedback on these as I don't have anything to test it against. |
I installed the latest release, the one from today 12/18, on my phone and it seems to be working perfectly connected to my BTech uv-pro. Offline maps are working properly as well. You might want to add to offline mapping instructions to run and update and upgrade on a new install of termux. I was able to figure out the issue from the error message when your script didn’t run the first time but someone who has no experience with Linux might not be able to figure it out. Anyway, thanks for your work on this, these are all much needed improvements to APRSdroid. I’m looking forward to you adding the digirig functionality so I can test with my tablet and my mobile rig. Thanks again Scott |
I will be adding digirig support by this weekend or sooner. Possibly tomorrow. I do have a guide for offline setup. It's not great but will get most folks going. |
Digirig support added. https://na7q.com/wp-content/uploads/2024/12/aprsdroid-release-noapi.apk |
Thanks NA7Q, very cool. Tried RTS ptt on my Digirig and a generic FTDI board.. both work. |
Thanks for the confirmation. Big update coming! Stay tuned! |
So where we at with AIOC support? |
Non-existent for PTT. Should work otherwise in theory. Since Android supports CM108 sound cards. |
AIOC can be setup to trigger PTT when audio is in the buffer. I use an AIOC
with modified firmware, but the standard firmware was updated so you should
be able to set it up easier.
…On Sun, Jan 5, 2025, 6:54 AM Mike ***@***.***> wrote:
So where we at with AIOC support?
Non-existent for PTT. Should work otherwise in theory. Since Android
supports CM108 sound cards.
—
Reply to this email directly, view it on GitHub
<#324 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A4BI3H42Y6EEFZG6WASLUJT2JFBSXAVCNFSM5W25ANRKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TENJXGE3DKMRYGQ3Q>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
The AIOC supports RTS/DTR as well. I guess the question is rather if the AIOC with it's VID/PID will be detected by aprsdroid. Or does it accept any serial interface? (ttyACM in this case).
That is possible although not a straightforward solution and it has its own quirks (eg regarding preamble timing and such) that need to be dealt with. Would be nice if you could just connect it to the android device and it just works in aprsdroid. |
I'll look more into it. But no guarantees from me. I don't have a device, like I don't have a DigiRig, but I have lots of CM108 devices. Of which I have used to receive with on APRSdroid. But I'm heading back to work. So I can't work on things like I have the last 2 weeks during vacation. I got a lot of crap done! |
I have my AIOC flashed with the latest firmware and have used the script to
adjust the settings. I've tried almost all variants. I can't get an
aprsdroid setup working in any way. Whether I use normal vox or the rapid
auto-vox, PTT line always seems to get stuck open and aprsdroid never
reports anything. Also, even when I have the audio out set to music I will
often hear the audio out of the speaker. I can't seem to tell if my issues
are android/aprsdroid related or the AIOC settings or something else.
…On Sun, Jan 5, 2025 at 5:03 PM Simon Küppers ***@***.***> wrote:
So where we at with AIOC support?
Non-existent for PTT. Should work otherwise in theory. Since Android
supports CM108 sound cards.
The AIOC supports RTS/DTR as well. I guess the question is rather if the
AIOC with it's VID/PID will be detected by aprsdroid. Or does it accept any
serial interface? (ttyACM in this case).
AIOC can be setup to trigger PTT when audio is in the buffer. I use an
AIOC with modified firmware, but the standard firmware was updated so you
should be able to set it up easier.
That is possible although not a straightforward solution and it has its
own quirks (eg regarding preamble timing and such) that need to be dealt
with. Would be nice if you could just connect it to the android device and
it just works in aprsdroid.
—
Reply to this email directly, view it on GitHub
<#324 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABCNTN2VMWC6A3OPFU776T2JGTZXAVCNFSM5W25ANRKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TENJXGE3TMNBYGMZQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
If PTT gets stuck open, I'd make the assumption you're using a baofeng with the stock antenna, or with a non-resonant antenna. I would also assume you have no ferrite on the USB cable? All these things will typically cause that. Does android detect your audio card at all? It will tell you if it does, and it's usually obvious. |
Yes to the cheap radios with stock antennas. I have some better antennae
coming but snow delayed their arrivals. I have had varying levels of
success depending on the usb cables but using one with a built in
conditioner doesn't seem to eliminate the issues. I ordered some ferrite
rings to see if they help as well.
…On Sun, Jan 5, 2025 at 5:29 PM Mike ***@***.***> wrote:
If PTT gets stuck open, I'd make the assumption you're using a baofeng
with the stock antenna, or with a non-resonant antenna. I would also assume
you have no ferrite on the USB cable? All these things will typically cause
that.
Does android detect your audio card at all? It will tell you if it does,
and it's usually obvious.
—
Reply to this email directly, view it on GitHub
<#324 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABCNTK5M3PMM7AWWD4BUPT2JGW5ZAVCNFSM5W25ANRKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TENJXGE3TOMJYGU3Q>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
The problem with Baofengs is the RF gets into everything. You WILL need good ferrites and good antennas to prevent it completely. Some circuitry work can be done to help prevent that problem as well. |
I just looked up the schematic. Oofta is all I can say. They are using a BJT for the PTT. These are bad in my experience because if a tiny bit of RF hits them, they always lock up the PTT. This was why when I made TNCs, I used a MOSFET. 2n7002 surface mount type. Add a couple capacitors on the line and a resistor, and that resolved all the RF problems I ever had. So my suggestion is that they move away from the BJT or similar transistors, as they are bad in RF environments. Just my opinion of course. |
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?
The text was updated successfully, but these errors were encountered: