Page 28 of 30

Re: Teensy 4.0 & 4.1

Posted: Mon Mar 28, 2022 4:12 pm
by KurtE
Thanks for the information:

I am still in the learning phase, and just trying to understand things.

As for MSC versus MTP, versus serial... Lots of trade offs.

Now just trying to understand more basic things like:
Is it possible to do something like: input(), but only if there is data available?
sort of like: uart.any()

I noticed similar question up for circuitPython and saw something like:

Code: Select all

import supervisor
if supervisor.runtime.serial_bytes_available :
Now to see if something like that applies here.

Kurt

Re: Teensy 4.0 & 4.1

Posted: Mon Mar 28, 2022 4:31 pm
by Roberthh
sys.stdin is a stream, so you can stream methods like select to check, whether something available:

import select
import sys
avail = select.select([sys.stdin], [], [], 0)

Checks for data in sys.stdin. It will return ([], [], []) if no data is waiting and ([<io.FileIO 0>], [], []) if there is data. That does not look simple, but I a typical use case you would create a function for it. For more information about select just consult a Python textbook.

Re: Teensy 4.0 & 4.1

Posted: Fri Apr 08, 2022 12:31 am
by danhalbert
MTP would be great if Apple provided support. It's sad they didn't, for marketing (iPod) reasons. We certainly considered MTP for CIrcuitPython, but no good macOS support was a big stumbling block.

Re: Teensy 4.0 & 4.1

Posted: Fri Apr 08, 2022 6:54 am
by Roberthh
It's sad they didn't, for marketing (iPod) reasons.
That sounds strange, given that the iPod is an old product and Apple usually does not care a lot for long term legacy support. License fees are more likely a reason.

Re: Teensy 4.0 & 4.1

Posted: Fri Apr 08, 2022 12:17 pm
by KurtE
danhalbert wrote:
Fri Apr 08, 2022 12:31 am
MTP would be great if Apple provided support. It's sad they didn't, for marketing (iPod) reasons. We certainly considered MTP for CIrcuitPython, but no good macOS support was a big stumbling block.
With our MTP support for the Teensy, which is still not released as built in to the Teensyduino release. But there have been versions of it for awhile

We have tested it on the MAC. Yes not as good of support as on windows or Ubuntu.

I believe I have mostly done it by installing Android File Transfer. Looks like there are some other solutions as well, like MacDroid but that is a solution you have to pay for a subscription.

Re: Teensy 4.0 & 4.1

Posted: Fri Apr 08, 2022 3:22 pm
by danhalbert
Roberthh wrote:
Fri Apr 08, 2022 6:54 am
That sounds strange, given that the iPod is an old product and Apple usually does not care a lot for long term legacy support. License fees are more likely a reason.
I don't think there are license fees: it's a usb.org spec. I think there is not a demand for it, and Apple still does not care about supporting MP3 players, which are a tiny market nowadays anyway. So I think it's more like MTP missed the window, and convincing Apple to add support for something is hard. On the other hand, they did finally start supporting FAT12, though it doesn't work that wiell.

Re: Teensy 4.0 & 4.1

Posted: Fri Apr 08, 2022 5:10 pm
by dhylands
Google created an MTP file transfer program for the Mac, but it has been notoriously buggy. I used this for a while when I was working on FirefoxOS.

Somebody also made a kernel driver for Mac which makes the MTP files easily accessible through the Finder and other "regular" filesystem ways.

See this article: https://medium.com/macoclock/mtp-for-ma ... 7a3f75c1e5 which has a link at the end to the driver variant: https://www.hyperintegrate.com/products/mtp-for-mac

I haven't used that particular driver, so I can't comment on how good or bad it is.

Re: Teensy 4.0 & 4.1

Posted: Thu Apr 21, 2022 12:06 pm
by KurtE
As for MTP, being buggy on the MAC, it is hard for me to say as I have not done much using the MAC notebood. I do use my older one on occasion when I want to test out something, but I primarily use PC with Windows, and it is touchy on things like timing.

On a secondary note: Recently a few of us (mjs513 and myself) added the Sparkfun Teensy Micromod to CircuitPython. So was curious about adding it to here as well.

I do have a version of it building and running, however I have run into one issue, which is it appears that I can not fork this project.
Github complains that:
No more forks can be created. View existing forks.
So not sure what to do, other than maybe punt.

Re: Teensy 4.0 & 4.1

Posted: Thu Apr 21, 2022 12:26 pm
by danhalbert
circuitpython is a GitHub fork of micropython, and you can't create multiple forks of a repo, even transitively. But since the repos are related, you should be able to make the micropython repo be a git remote of your current clone.

Code: Select all

git remote add micropython https://github.com/micropython/micropython
git remote -v
git fetch micropython
git checkout micropython/master
git checkout -b my_mpy_development_branch
It's a bit confusing, so do this in a separate clone. You can also create another GitHub user and make a new fork there.

Re: Teensy 4.0 & 4.1

Posted: Thu Apr 21, 2022 12:53 pm
by KurtE
danhalbert wrote:
Thu Apr 21, 2022 12:26 pm
circuitpython is a GitHub fork of micropython, and you can't create multiple forks of a repo, even transitively. But since the repos are related, you should be able to make the micropython repo be a git remote of your current clone.

Code: Select all

git remote add micropython https://github.com/micropython/micropython
git remote -v
git fetch micropython
git checkout micropython/master
git checkout -b my_mpy_development_branch
It's a bit confusing, so do this in a separate clone. You can also create another GitHub user and make a new fork there.
Thanks, I was wondering that this morning as I tried to go to Adafruit fork and ended up at the CircuitPython... So wondered If I could hack it that way.