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

USB serial TNC support #105

Closed
darrellenns opened this Issue Jul 14, 2015 · 25 comments

Comments

Projects
None yet
8 participants
@darrellenns

darrellenns commented Jul 14, 2015

It would be awesome to support USB TNCS. This would even allow users to build their own TNC with an arduino, a few passive components, and the mobilinkd code. This library does USB serial without requiring root access. Alternatively, I believe the Android kernel does usually provide the /dev entries (but would require root permissions to access them).

@airikka

This comment has been minimized.

Show comment
Hide comment
@airikka

airikka Jul 25, 2015

+1 for this one!
Would be really nice to use my MicroAPRS device (KISS compatible) through USB with my rooted Android device and aprsdroid!

airikka commented Jul 25, 2015

+1 for this one!
Would be really nice to use my MicroAPRS device (KISS compatible) through USB with my rooted Android device and aprsdroid!

@darrellenns

This comment has been minimized.

Show comment
Hide comment
@darrellenns

darrellenns Jul 29, 2015

With the library I linked above, you wouldn't even need root access to do it. It uses the Android USB host API to allow the app to access the USB port directly (rather than through kernel serial drivers).

darrellenns commented Jul 29, 2015

With the library I linked above, you wouldn't even need root access to do it. It uses the Android USB host API to allow the app to access the USB port directly (rather than through kernel serial drivers).

@ge0rg

This comment has been minimized.

Show comment
Hide comment
@ge0rg

ge0rg Jul 30, 2015

Owner

There is already some discussion of the USB library in #12, but I think I will keep this ticket separate as a pure USB-TNC support request. When I checked the available Android USB codebases back then (wow, already three years ago), there were multiple USB libraries supporting different chipsets, partially even libraries from USB serial device vendors.

A quick glance at usb-serial-for-android shows that it still focuses on FT232, so my dream of a single library with support for most available devices hasn't come true yet. To be honest, I don't know how to proceed from here. To really make the feature useful, I would need to add support for the major brands of USB-serial adapters (which are they?).

Therefore my options are:

  • buy the slickdev library and use that (besides of the 99$ cost point it would prevent third-party developers from compiling APRSdroid)
  • stick to a single USB library and disgruntle most of my users
  • integrate multiple different serial libraries, at a significant effort.

There is a USB serial library wrapper created by the basic4android community. My hope three years ago was that somebody would write a wrapper library that provides a single interface for the developer, and internally uses whatever is appropriate. This hasn't come true yet on Android, it seems to me.

Owner

ge0rg commented Jul 30, 2015

There is already some discussion of the USB library in #12, but I think I will keep this ticket separate as a pure USB-TNC support request. When I checked the available Android USB codebases back then (wow, already three years ago), there were multiple USB libraries supporting different chipsets, partially even libraries from USB serial device vendors.

A quick glance at usb-serial-for-android shows that it still focuses on FT232, so my dream of a single library with support for most available devices hasn't come true yet. To be honest, I don't know how to proceed from here. To really make the feature useful, I would need to add support for the major brands of USB-serial adapters (which are they?).

Therefore my options are:

  • buy the slickdev library and use that (besides of the 99$ cost point it would prevent third-party developers from compiling APRSdroid)
  • stick to a single USB library and disgruntle most of my users
  • integrate multiple different serial libraries, at a significant effort.

There is a USB serial library wrapper created by the basic4android community. My hope three years ago was that somebody would write a wrapper library that provides a single interface for the developer, and internally uses whatever is appropriate. This hasn't come true yet on Android, it seems to me.

@ge0rg

This comment has been minimized.

Show comment
Hide comment
@ge0rg

ge0rg Jul 30, 2015

Owner

Update: there seems to be yet another USB serial library that claims support for the most relevant chips and is open source. I think I will try this one first.

Owner

ge0rg commented Jul 30, 2015

Update: there seems to be yet another USB serial library that claims support for the most relevant chips and is open source. I think I will try this one first.

@darrellenns

This comment has been minimized.

Show comment
Hide comment
@darrellenns

darrellenns Jul 31, 2015

The one I linked supports FTDI, most Arduinos, SiLABS CP21xx, and Prolific. There's also a a couple of pull requests in the queue for adding other devices. I've personally tested the CH340 driver (from the pull request), and it seems to work fine. The one you linked already supports CH340 in the main branch, so that's a nice bonus. It seems like it may be a little more frequently updated as well.

darrellenns commented Jul 31, 2015

The one I linked supports FTDI, most Arduinos, SiLABS CP21xx, and Prolific. There's also a a couple of pull requests in the queue for adding other devices. I've personally tested the CH340 driver (from the pull request), and it seems to work fine. The one you linked already supports CH340 in the main branch, so that's a nice bonus. It seems like it may be a little more frequently updated as well.

@ge0rg

This comment has been minimized.

Show comment
Hide comment
@ge0rg

ge0rg Aug 27, 2015

Owner

I've had some time to play around with the UsbSerial library, finally.

Please try this very alpha APK - if you attach your serial device, it should automatically switch APRSdroid to USB mode (default 115200 baud, 8N1; you can change the baudrate in the preferences), and start the service.

I've had one negative report so far (TX not working), but I need more datapoints. Please test and report back! :)

Owner

ge0rg commented Aug 27, 2015

I've had some time to play around with the UsbSerial library, finally.

Please try this very alpha APK - if you attach your serial device, it should automatically switch APRSdroid to USB mode (default 115200 baud, 8N1; you can change the baudrate in the preferences), and start the service.

I've had one negative report so far (TX not working), but I need more datapoints. Please test and report back! :)

@airikka

This comment has been minimized.

Show comment
Hide comment
@airikka

airikka Sep 1, 2015

"You Ass Be!"-mode (funny spelling ;-) ) with MicroAPRS using 9600 8n1 KISS is both sending and
receiving!

Thumbs up from me! :-)

Br,
Tommi
On Sep 1, 2015 12:27, "Tommi Airikka" tommi@airikka.net wrote:

Sorry, I have been very busy lately, but I will try it out today or
tomorrow :)

/Tommi
On Aug 27, 2015 7:47 PM, "Georg Lukas" notifications@github.com wrote:

I've had some time to play around with the UsbSerial library, finally.

Please try this very alpha APK
http://aprsdroid.org/download/builds/APRSdroid-gl-2015-08-27_usb2.apk

  • if you attach your serial device, it should automatically switch
    APRSdroid to USB mode (default 115200 baud, 8N1; you can change the
    baudrate in the preferences), and start the service.

I've had one negative report so far (TX not working), but I need more
datapoints. Please test and report back! :)


Reply to this email directly or view it on GitHub
#105 (comment).

airikka commented Sep 1, 2015

"You Ass Be!"-mode (funny spelling ;-) ) with MicroAPRS using 9600 8n1 KISS is both sending and
receiving!

Thumbs up from me! :-)

Br,
Tommi
On Sep 1, 2015 12:27, "Tommi Airikka" tommi@airikka.net wrote:

Sorry, I have been very busy lately, but I will try it out today or
tomorrow :)

/Tommi
On Aug 27, 2015 7:47 PM, "Georg Lukas" notifications@github.com wrote:

I've had some time to play around with the UsbSerial library, finally.

Please try this very alpha APK
http://aprsdroid.org/download/builds/APRSdroid-gl-2015-08-27_usb2.apk

  • if you attach your serial device, it should automatically switch
    APRSdroid to USB mode (default 115200 baud, 8N1; you can change the
    baudrate in the preferences), and start the service.

I've had one negative report so far (TX not working), but I need more
datapoints. Please test and report back! :)


Reply to this email directly or view it on GitHub
#105 (comment).

@mobilinkd

This comment has been minimized.

Show comment
Hide comment
@mobilinkd

mobilinkd Jan 4, 2016

👍

Awesome! Works with the Mobilinkd Arduino KISS TNC project. @ 38400. My only request is to support higher baud rates. My STM Nucleo based TNC is running at 230400. (But as it is, plugging the Nucleo board into the Android OTG does really bad things. I have to reflash every time.)

mobilinkd commented Jan 4, 2016

👍

Awesome! Works with the Mobilinkd Arduino KISS TNC project. @ 38400. My only request is to support higher baud rates. My STM Nucleo based TNC is running at 230400. (But as it is, plugging the Nucleo board into the Android OTG does really bad things. I have to reflash every time.)

@mobilinkd

This comment has been minimized.

Show comment
Hide comment
@mobilinkd

mobilinkd Jan 8, 2016

I have played with this a little more with my STM Nucleo board. The Nucleo presents 4 USB devices, only one of which is a CDC. So far, only one of the many USB terminal programs I tried is able to connect to the device. I also have APRSdroid communicating with it as well! TX & RX work.

So, really, job well done.

The only issue I have is that both the serial app and APRSdroid require that the firmware be changed to run at 9600 baud. Neither app appears to be able to change the baud rate of the CDC device.

mobilinkd commented Jan 8, 2016

I have played with this a little more with my STM Nucleo board. The Nucleo presents 4 USB devices, only one of which is a CDC. So far, only one of the many USB terminal programs I tried is able to connect to the device. I also have APRSdroid communicating with it as well! TX & RX work.

So, really, job well done.

The only issue I have is that both the serial app and APRSdroid require that the firmware be changed to run at 9600 baud. Neither app appears to be able to change the baud rate of the CDC device.

@Padgett

This comment has been minimized.

Show comment
Hide comment
@Padgett

Padgett Jan 27, 2016

I have an Argent Data OpenTracker USB which supports KISS (but has to be switched via a serial command), I will give the Alpha a try this week.

Padgett commented Jan 27, 2016

I have an Argent Data OpenTracker USB which supports KISS (but has to be switched via a serial command), I will give the Alpha a try this week.

@mobilinkd

This comment has been minimized.

Show comment
Hide comment
@mobilinkd

mobilinkd Mar 12, 2016

It appears that DTR is asserted on connection and then toggled on each TX. It stays low after each odd numbered TX and high after each even numbered TX. DTR low can be interpreted by some USB CDC devices as a "disconnect" from the application (the data terminal is no longer ready/connected). The behavior of toggling DTR in this manner seems a bit odd.

Once I removed my dependence on DTR, the You Ass Be code works well for TX and RX.

img_20160311_6x4

mobilinkd commented Mar 12, 2016

It appears that DTR is asserted on connection and then toggled on each TX. It stays low after each odd numbered TX and high after each even numbered TX. DTR low can be interpreted by some USB CDC devices as a "disconnect" from the application (the data terminal is no longer ready/connected). The behavior of toggling DTR in this manner seems a bit odd.

Once I removed my dependence on DTR, the You Ass Be code works well for TX and RX.

img_20160311_6x4

@mobilinkd

This comment has been minimized.

Show comment
Hide comment
@mobilinkd

mobilinkd Mar 12, 2016

It appears that the CDC code has had a number of updates recently that may address many of the issues that I have run into. Georg, any chance you could produce an updated APK?

mobilinkd commented Mar 12, 2016

It appears that the CDC code has had a number of updates recently that may address many of the issues that I have run into. Georg, any chance you could produce an updated APK?

@unixro

This comment has been minimized.

Show comment
Hide comment
@unixro

unixro Apr 18, 2016

Hi,

I have a Kenwood TH-D72 and Samsung Tab 4 connected via usb ( installed on Samsung is APRSdroid-gl-2016-02-24_usb.apk ), i have setup the Baud Rate to 9600 on aprsdroid and also on my TH but i do not receive nothing on the AprsDroid Hub list.

Do I have to do other settings on aprsdroid?

Thank you,
Aurel.

unixro commented Apr 18, 2016

Hi,

I have a Kenwood TH-D72 and Samsung Tab 4 connected via usb ( installed on Samsung is APRSdroid-gl-2016-02-24_usb.apk ), i have setup the Baud Rate to 9600 on aprsdroid and also on my TH but i do not receive nothing on the AprsDroid Hub list.

Do I have to do other settings on aprsdroid?

Thank you,
Aurel.

@kf7rcs

This comment has been minimized.

Show comment
Hide comment
@kf7rcs

kf7rcs May 11, 2016

I have this working with mobilinkd arduino. Any chance you could provide this version with offline maps? or provide source code so i can attempt to make my own?

kf7rcs commented May 11, 2016

I have this working with mobilinkd arduino. Any chance you could provide this version with offline maps? or provide source code so i can attempt to make my own?

@ge0rg

This comment has been minimized.

Show comment
Hide comment
@ge0rg

ge0rg Sep 17, 2016

Owner

The OSM builds created after Feb 23rd should have basic USB support, and I've just built a new OSM and regular APK based on UsbSerial 4.4: OSM APK.

Before, there was a nasty and dumb bug that prevented auto-detection of USB serial devices.

Owner

ge0rg commented Sep 17, 2016

The OSM builds created after Feb 23rd should have basic USB support, and I've just built a new OSM and regular APK based on UsbSerial 4.4: OSM APK.

Before, there was a nasty and dumb bug that prevented auto-detection of USB serial devices.

@ge0rg

This comment has been minimized.

Show comment
Hide comment
@ge0rg

ge0rg Sep 21, 2016

Owner

Hello again,

I've finally had the time to do a major refactoring of the backend code. Now you can have not only KISS over USB, TCP and Bluetooth, but also use these link types for Kenwood GPS waypoint mode.

I've also added faster baud rates to the app, no idea if they actually work in real life.

Please test and let me know: http://aprsdroid.org/download/builds/APRSdroid-gl-2016-09-21.apk

Owner

ge0rg commented Sep 21, 2016

Hello again,

I've finally had the time to do a major refactoring of the backend code. Now you can have not only KISS over USB, TCP and Bluetooth, but also use these link types for Kenwood GPS waypoint mode.

I've also added faster baud rates to the app, no idea if they actually work in real life.

Please test and let me know: http://aprsdroid.org/download/builds/APRSdroid-gl-2016-09-21.apk

@ge0rg ge0rg added this to the 1.4.0 milestone Sep 21, 2016

@kf7rcs

This comment has been minimized.

Show comment
Hide comment
@kf7rcs

kf7rcs Sep 21, 2016

Great,. I will have some time this weekend to test this out in my use case.
Thank you

On Sep 21, 2016 6:18 AM, "Georg Lukas" notifications@github.com wrote:

Hello again,

I've finally had the time to do a major refactoring of the backend code.
Now you can have not only KISS over USB, TCP and Bluetooth, but also use
these link types for Kenwood GPS waypoint mode.

I've also added faster baud rates to the app, no idea if they actually
work in real life.

Please test and let me know: http://aprsdroid.org/download/
builds/APRSdroid-gl-2016-09-21.apk


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#105 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AR1uRJfnc_xvqXcBevVSlEGp1mFF82vCks5qsS6_gaJpZM4FYTQj
.

kf7rcs commented Sep 21, 2016

Great,. I will have some time this weekend to test this out in my use case.
Thank you

On Sep 21, 2016 6:18 AM, "Georg Lukas" notifications@github.com wrote:

Hello again,

I've finally had the time to do a major refactoring of the backend code.
Now you can have not only KISS over USB, TCP and Bluetooth, but also use
these link types for Kenwood GPS waypoint mode.

I've also added faster baud rates to the app, no idea if they actually
work in real life.

Please test and let me know: http://aprsdroid.org/download/
builds/APRSdroid-gl-2016-09-21.apk


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#105 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AR1uRJfnc_xvqXcBevVSlEGp1mFF82vCks5qsS6_gaJpZM4FYTQj
.

@kf7rcs

This comment has been minimized.

Show comment
Hide comment
@kf7rcs

kf7rcs Sep 23, 2016

I had a chance to test it today, i was able to link to my tnc device and
receive3 APRS packets, but was not able to transmit for some reason. the
TNC works ok in recieve and transmit with xastir. it appears to be the
kiss tnc style. the major improvement i noticed was aprs droid would
connect with the usb serial device every time now. prior to this version
it would only connect every so often, not enough to make it worth while. I
am not sure why the transmit isnt working though. I will try the same apk
link on my tablet vs the car android device and see if i have better luck.

Casey

On Wed, Sep 21, 2016 at 6:18 AM, Georg Lukas notifications@github.com
wrote:

Hello again,

I've finally had the time to do a major refactoring of the backend code.
Now you can have not only KISS over USB, TCP and Bluetooth, but also use
these link types for Kenwood GPS waypoint mode.

I've also added faster baud rates to the app, no idea if they actually
work in real life.

Please test and let me know: http://aprsdroid.org/download/
builds/APRSdroid-gl-2016-09-21.apk


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#105 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AR1uRJfnc_xvqXcBevVSlEGp1mFF82vCks5qsS6_gaJpZM4FYTQj
.

kf7rcs commented Sep 23, 2016

I had a chance to test it today, i was able to link to my tnc device and
receive3 APRS packets, but was not able to transmit for some reason. the
TNC works ok in recieve and transmit with xastir. it appears to be the
kiss tnc style. the major improvement i noticed was aprs droid would
connect with the usb serial device every time now. prior to this version
it would only connect every so often, not enough to make it worth while. I
am not sure why the transmit isnt working though. I will try the same apk
link on my tablet vs the car android device and see if i have better luck.

Casey

On Wed, Sep 21, 2016 at 6:18 AM, Georg Lukas notifications@github.com
wrote:

Hello again,

I've finally had the time to do a major refactoring of the backend code.
Now you can have not only KISS over USB, TCP and Bluetooth, but also use
these link types for Kenwood GPS waypoint mode.

I've also added faster baud rates to the app, no idea if they actually
work in real life.

Please test and let me know: http://aprsdroid.org/download/
builds/APRSdroid-gl-2016-09-21.apk


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#105 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AR1uRJfnc_xvqXcBevVSlEGp1mFF82vCks5qsS6_gaJpZM4FYTQj
.

@kf7rcs

This comment has been minimized.

Show comment
Hide comment
@kf7rcs

kf7rcs Sep 23, 2016

Update.....

SW appears to function,. TX problem was with using wide1. I switched to
widr2-2 and bingo. Working g great,. Good job thanks!!!!!!

Is there a version of this that has offline maps?

On Sep 17, 2016 10:07 AM, "Georg Lukas" notifications@github.com wrote:

The OSM builds created after Feb 23rd should have basic USB support, and
I've just built a new OSM and regular APK based on UsbSerial 4.4: OSM APK
http://aprsdroid.org/download/builds/APRSdroid-gl-2016-09-17_osm.apk.

Before, there was a nasty and dumb bug that prevented auto-detection of
USB serial devices.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#105 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AR1uRNcm4vLG5WUidOPNXkjmAzrXUz79ks5qrB5FgaJpZM4FYTQj
.

kf7rcs commented Sep 23, 2016

Update.....

SW appears to function,. TX problem was with using wide1. I switched to
widr2-2 and bingo. Working g great,. Good job thanks!!!!!!

Is there a version of this that has offline maps?

On Sep 17, 2016 10:07 AM, "Georg Lukas" notifications@github.com wrote:

The OSM builds created after Feb 23rd should have basic USB support, and
I've just built a new OSM and regular APK based on UsbSerial 4.4: OSM APK
http://aprsdroid.org/download/builds/APRSdroid-gl-2016-09-17_osm.apk.

Before, there was a nasty and dumb bug that prevented auto-detection of
USB serial devices.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#105 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AR1uRNcm4vLG5WUidOPNXkjmAzrXUz79ks5qrB5FgaJpZM4FYTQj
.

@N7KFD

This comment has been minimized.

Show comment
Hide comment
@N7KFD

N7KFD Sep 24, 2016

I'm having the same issue of not transmitting, I tried the wide2-2 trick but it didn't work for me. Receive works great as does plotting the map with packets from other station but no transmit.

N7KFD commented Sep 24, 2016

I'm having the same issue of not transmitting, I tried the wide2-2 trick but it didn't work for me. Receive works great as does plotting the map with packets from other station but no transmit.

@ge0rg

This comment has been minimized.

Show comment
Hide comment
@ge0rg

ge0rg Oct 3, 2016

Owner

@kf7rcs the latest osm build should have the same features and fixes.

@N7KFD I can't see how changing the digi path changes the TX ability. Can you double check with a PC application like xastir to see if TX works there?

Owner

ge0rg commented Oct 3, 2016

@kf7rcs the latest osm build should have the same features and fixes.

@N7KFD I can't see how changing the digi path changes the TX ability. Can you double check with a PC application like xastir to see if TX works there?

@kf7rcs

This comment has been minimized.

Show comment
Hide comment
@kf7rcs

kf7rcs Oct 3, 2016

Just a theory, since the Digi path input is free text and leta say you type
something invalid how does SW handle that?

On Oct 3, 2016 4:37 AM, "Georg Lukas" notifications@github.com wrote:

@kf7rcs https://github.com/kf7rcs the latest osm build should have the
same features and fixes.

@N7KFD https://github.com/n7kfd I can't see how changing the digi path
changes the TX ability. Can you double check with a PC application like
xastir to see if TX works there?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#105 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AR1uRLXM3_QFoLPTc8l4SVK0R7C-LlOMks5qwOjsgaJpZM4FYTQj
.

kf7rcs commented Oct 3, 2016

Just a theory, since the Digi path input is free text and leta say you type
something invalid how does SW handle that?

On Oct 3, 2016 4:37 AM, "Georg Lukas" notifications@github.com wrote:

@kf7rcs https://github.com/kf7rcs the latest osm build should have the
same features and fixes.

@N7KFD https://github.com/n7kfd I can't see how changing the digi path
changes the TX ability. Can you double check with a PC application like
xastir to see if TX works there?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#105 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AR1uRLXM3_QFoLPTc8l4SVK0R7C-LlOMks5qwOjsgaJpZM4FYTQj
.

@ge0rg

This comment has been minimized.

Show comment
Hide comment
@ge0rg

ge0rg Oct 6, 2016

Owner

I've restricted the characters allowed in the digi path entry field now. Also changed some USB/TNC initialization settings, please test if everything works with this APK.

APK: http://aprsdroid.org/download/builds/APRSdroid-gl-2016-10-06.apk

Owner

ge0rg commented Oct 6, 2016

I've restricted the characters allowed in the digi path entry field now. Also changed some USB/TNC initialization settings, please test if everything works with this APK.

APK: http://aprsdroid.org/download/builds/APRSdroid-gl-2016-10-06.apk

@N7KFD

This comment has been minimized.

Show comment
Hide comment
@N7KFD

N7KFD Jan 29, 2017

N7KFD commented Jan 29, 2017

@ge0rg

This comment has been minimized.

Show comment
Hide comment
@ge0rg

ge0rg Jul 28, 2017

Owner

APRSdroid 1.4 is officially available now.

Owner

ge0rg commented Jul 28, 2017

APRSdroid 1.4 is officially available now.

@ge0rg ge0rg closed this Jul 28, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment