-
Notifications
You must be signed in to change notification settings - Fork 6
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
[Request] Add support for Serial Comm protocols like Gemini PR or TX Bolt #24
Comments
I started a branch several years ago with serial support. From what I remember it was working but I wasn't able to do all the testing I wanted to. It also needed a bit of clean up. I'll try and make time to clean it up and make the branch public at least. |
Oh ok that's great to hear. I can at least test it with my steno board. |
Sorry it took a while, to get back to this, but here is the crash log on permission accept. Crash part:
|
If you try the library felHr (there should be a selection box where you configure the machine) it might work. Otherwise I need the details for the chip the machine uses. The issue is Dotterel doesn't know what driver to use so it just throws an exception (I should change it to show an error instead). |
Oh, it looks like I didn't put it in the settings. Change this line from The serial machine settings only appear after the device has been plugged in as they're specific to that machine. Do they show up if you reject the permission? |
My apology for the issue necromancy... I built the project with the library change called out above to include felHr library. The app launches and even detects the Uni v3 when it is attached. Initially I had no luck getting a response out of the phone, but after manually setting the serial parameters (9600 8N2, no flow control, Gemini PR protocol), when i switch to the Dotterel keyboard and attach the Uni, it throws an error message which is partially displayed on screen. My apology for not knowing enough of android to provide better log output, I will gladly provide more data if instructed how to do so. |
I added a share log button in the top-right of the main settings page on the feature/serial-support branch. You can use that access the full log. |
Will this be merged to the mainline soon? What is the gap to merge it? |
Unlikely to be merged soon as I haven't been working on it. I think it's mainly bug testing that needs to be done. |
On my Samsung S22, Dotterel just goes into a crashloop whenever my Uni v3 is plugged in and the application is configured to speak to it via GeminiPR protocol. As soon as I am prompted to allow Dotterel access to the Uni, it goes into a crash loop. I would like to provide logs to you, but I do not see a means to get to the logs. When I plug in the keyboard, it shows up, and I am permitted to configure the Serial parameters. It isn't until I attempt to grant Dotterel permission to access the hardware that it crashes. |
Ah. I just realized that I am still running the previous build. I did not notice the build failures.
|
found the crash log... |
Is this a simple permissions problem? I do not understand android well enough to develop for it, but the crash log gives me the impression that there is a permissions issue. I granted all permissions that were available to the app and it did not change the outcome. |
Thanks for the log. It's not a permissions issue. It doesn't have a serial driver for your machine, or at least doesn't know what driver to use. https://github.com/mik3y/usb-serial-for-android#compatible-devices Your machine maker might know if your machine is compatible based on this list. |
Well, that is unfortunate. Is the library you linked the one used by dotterel? I can try to get support for this device if so. This machine uses an ATMEGA32u4 which is listed as supported, but perhaps it is not using CDC/ACM protocol. |
Looking at the code, it seems that the Uni machine firmware is built using CDC. And since it is an ATMEGA32u4, I suspect they are reporting a different vendor/product ID pair. I will look into patching the code and report back if I have any success. |
I think you're right. I've been looking back at my code and there's a bit of code that tells it what driver to use for my test device's vendor and product ID. I also noticed that in newer versions of the serial library it mentioned being able to recognise CDC devices without knowing the specific vendor and product ID in advance. https://play.google.com/store/apps/details?id=de.kai_morich.serial_usb_terminal You could try with this app which is based off the same serial library (but a newer version). |
i could not see where that library was being pulled in, but i don't know java either. is this a matter of updating your repository to use a newer version of the usb serial library? |
Yes, I'll update the branch when I get time. There's another fix that I need to push as well. |
I've updated the feature/serial-support branch with a newer version of the USB serial library and a few fixes. |
Thanks for the update. I am trying to fix my IDE since it is complaining about incompatible gradle versions. I'll check back in once i get those sorted and am able to test the branch. |
With the newest build, the app crashes or freezes when the keyboard is attached and the machine menu is pulled up. The app just becomes unresponsive, and I do not get any indication that a crash log has been created. |
You might be able to get a log if you use the share log button on the Dotterel settings page (top-right). If you can run the app from Android Studio you'll be able to see the log in real-time. |
Attaching logs. It looks like USB permissions issue. |
Ah, I see, at some point they changed the UsbDevice API to require permission to access a device's serial number. I updated the branch to not use the serial number. |
OK, so the crashing problem goes away... but now I am left with another problem. After configuring the serial settings, when i attempt to switch to the Dotterel input, I receive an "Invalid Type found while reading" error |
Hmm, strange, that error appears to happen while it's asking for permission to access the USB device. Do you get the prompt to grant permission to access the USB device (just before the invalid type error)? |
No. No prompt. |
I can't tell where the error is coming from. I suggest removing these lines https://github.com/nimble0/dotterel/blob/feature/serial-support/app/src/main/java/nimble/dotterel/machines/SerialStenoMachine.kt#L242-L249 so that you get a crash with the raw exception. |
@nimble0 Do you still work on it? |
I'm not actively working on it, but I'll check any bug reports. |
I want to use "The Uni v3" on my android phone. Adding support for serial comms could probably support other steno machines that use it as well.
Example in Plover:
https://github.com/openstenoproject/plover/blob/3e7ba1afce0baf8992d43bc411100ca18e8d0d03/plover/machine/geminipr.py
A serial port android library I found googling:
https://github.com/lemoclone/SerialPortComm
The text was updated successfully, but these errors were encountered: