-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Multiple Serial Support #50
Comments
Paul posted that this will be in the next TD beta for #1.52! @Koromix - nice if you have the time to work with this. Might help with Teensy 4 I/O speed two if the different 'ports' can be placed into different TyCommander windows. Also might make it easier for future work to leave primary ports as it is and put VT100 support on other(s). |
Cool, looking forward to get this. Will make debugging MUCH nicer. I don't know if you noticed, meanwhile all ports can be used to reboot the teensy. The hex I posted above was done with an older version where only one port accepted reboot requests. |
Yes this works already. I need to clean up the changes needed (right now some parts are hacked in) and work on proper board settings for multiple serials per Teensy. |
Yes, while I was playing with Putty I already noticed that identifying Serials looking at the port numbers gets confusing quickly. A clear indication which port corresponds to which Serial would be helpful indeed. |
I will work on this more later, but in the meantime you can find a build with early multi-serial support here: https://koromix.dev/files/tytools/ |
Nice work Koromix! - not tested yet - but looking forward to it. |
Just tested with current PJRC from github. It shows three 'Teensy' from one Teensy 4.0! PROBLEM - maybe this is known future work: The goal is each of the three should have their own 'Serial' output GUI window, currently all three map to the same GUI window. |
Yes, will be useful sometimes. Usually, if I have more than one port per Teensy (which needed USB Serial cables in the past...) I simply open a second window. Advantage is that you can see both terminals in parallel. It would be good to be able to have a color setting (say title bar, or some other visible part of the GUI) The setting should be stored based on Teensy ID + selected Port. This would make it easy to identify the port/terminal on a glace. |
I just noticed that each of the 3 instances on the options tab do point to a unique TEMP file! Also hoping that will split the output load from the faster Teensy 4.0 in a way that total throughput between the 2 or 3 windows might exceed what one can do now. |
I'm not sure I understand, and I can't retest it right now, but if you open two TyCommander windows and set each one to a different "Teensy port" you should be able to watch both outputs at the same time? |
And you can use the compact window mode with Ctrl+H or "View > Compact Mode" to reduce used screen space. |
Let me check - I didn't read the code - it is doing something unexpected … |
MY Opps - YOU DID PERFECTLY right Koromix! Thank You! Works with sample code rewrite to work to actually show the desired unique output: |
Is each USB# associated handled independently - different processor core? - or common? |
Serial reads are handled with two threads: one reads from all Teensies, the second one deals with the GUI. |
Good info. Thanks for the support. This would be awful without TyCommander! |
I've made some progress on this; here is a new Windows build: https://koromix.dev/files/tytools/ (TyTools-0.9.1-10-g65d523b). The label now contains the interface number ('@2', '@4'), and each "board" should keep its own settings. They are also ordered deterministically in the main window, and a little + is shown for secondary boards. |
Gave it a quick test. Runs much more stable now. I saw that you removed reboot and reset from the auxiliary ports which is good (less confusing). However, on first connection to a Teensy it still has all ports in the list where it asks you to select the board for uploading. If you choose the @2 port it can't upload of course. Not a big thing but might confuse new users. Thanks a lot for this. Your TyTools are extremely useful productivity enhancers for me. |
Nice add with the @2 - Will give it a look Expect the UI will work well. Would it be easy to do a 'multi' select automatically when any of the exposed ports on a single Teensy are selected? By excluding the 'non-primary' what happens if the 'Primary' is connected by an outside USB Serial connect? Another SerMon or PC application? |
Yes, I was looking at that (the selection dialog). In the meantime, there's a new build with very minor GUI fixes, such as selecting the primary board by default after launch (it would select kinda randomly in the previous build). |
Not sure I understand. If I select multiple "boards" automatically, you can't look at the serial output. Or maybe I don't understand? |
Maybe I'm not following or explaining ... This is during 'Program' device selection with MultiSerial Teensy: Selecting ANY of the USB ports is the same as selecting ALL of the ports for that device to program it. If 2500450-Teensy has 2 or 3 USB 'ports' - when any of them is picked - can it Multi-Select All of them for clarity and avoid picking one and having it fail? |
It's not bad, and I've changed this, you can do it in the latest build (which also uses little numbers instead of the '+' in the red circle). Upload remains blocked because it is more problematic; in TyCommander there's a notion of "association between a firmware and a board". This thing does not know how to deal with the fact that multiple boards can in fact be the same. For now, it's blocked for secondary boards. In this build, the upload selection dialog will not allow you to select a secondary board. That's the lazy option, compared to the multi-selection thing you proposed :p New build: https://koromix.dev/files/tytools/ (TyTools-0.9.1-15-g87ed6a6) |
Looks Good and it works. Turned back on integration and dialog for upload seems fine. |
There is a new build with notes linked here #59 { https://koromix.dev/files/tytools/ } It is updated to have a command line way to control Teensy Reboot - and it has updated and great looking Multi USB support as far as tested here. When this gets released I can update the https://github.com/Defragster/Tset code to use it for cases where the IDE does not have TyCommander integrated. Selecting Teensy once for a sketch pushed it to bootloader for TeensyLoader AUTO program. Using two T_4.1's alternating on from 2 to 3 USB's in unique sketches while the other running a Dual Serial sketch All seems well! Thanks again @Koromix - without TyCommander programming Teensy would only be half as awesome! |
Thanks :) I've fixed the URLs in your comment. |
URL's do work now - Thanks - I dropped them and ran without testing it seems :( |
@Koromix Are you ready to make this the main release version? It has been running well here - just sitting. Supporting Multi USB is a useful feature not in the current release and with the UI improvements are a good step forward. And having the --delegate works as desired and won't break anything when not used. Then I can update TSET to expect it for cases where TyCommander isn't integrated at the time and --delegate takes out the manual bootloader trigger step where it otherwise blocks Teensy Loader. |
Good idea :) I've made some tests on macOS, it seems to work well. Uploading builds, which takes 1 hour on my ~16kB/s upload connection... Recently moved, and went from 50 MB/s (UP) to 16 kB/s (UP). That's painful oo' |
The working on MacOS sounds GOOD! The downgraded upload speed does not sound good :( I thankfully went from 7Mbps to ~40Mbps which was nice ... 160kbps sounds very painful. |
Release done! |
Cool, Updated https://github.com/Defragster/Tset readme and the batch files to call with --delegate when not integrated. |
Teensy supports now multiple serial ports per device. (Here the corresponding pull request. PaulStoffregen/cores#438). This, of course is a great feature if you need to debug something which uses the normal Serial port for communication with the PC. As can be expected, the current tytools don't support this yet.
I tried it with the following sketch:
Which works nicely. Both ports appear in Win10 and can be connected to with putty. However tytools gets confused. It does show the new ports in the info screen as shown below:
COM11 was the original port (not existing anymore) COM 29 and 30 are the two new ones.
But, unfortunately, reprogramming doesn't work. It looks like it looses the Teensy after programming. Probably it doesn't expect changed Ports Numbers?
Here MultiSerial.zip a HEX file with the sketch from above in case you want to give it a quick try. Would love if tytools could support this.
The text was updated successfully, but these errors were encountered: