Teensy 4.0 & 4.1

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
KurtE
Posts: 11
Joined: Mon Mar 28, 2022 1:52 pm

Re: Teensy 4.0 & 4.1

Post by KurtE » Mon Mar 28, 2022 4:12 pm

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

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Teensy 4.0 & 4.1

Post by Roberthh » Mon Mar 28, 2022 4:31 pm

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.

danhalbert
Posts: 18
Joined: Mon Jan 16, 2017 3:58 am

Re: Teensy 4.0 & 4.1

Post by danhalbert » 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.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Teensy 4.0 & 4.1

Post by Roberthh » Fri Apr 08, 2022 6:54 am

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.

KurtE
Posts: 11
Joined: Mon Mar 28, 2022 1:52 pm

Re: Teensy 4.0 & 4.1

Post by KurtE » Fri Apr 08, 2022 12:17 pm

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.

danhalbert
Posts: 18
Joined: Mon Jan 16, 2017 3:58 am

Re: Teensy 4.0 & 4.1

Post by danhalbert » Fri Apr 08, 2022 3:22 pm

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.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Teensy 4.0 & 4.1

Post by dhylands » Fri Apr 08, 2022 5:10 pm

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.

KurtE
Posts: 11
Joined: Mon Mar 28, 2022 1:52 pm

Re: Teensy 4.0 & 4.1

Post by KurtE » Thu Apr 21, 2022 12:06 pm

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.

danhalbert
Posts: 18
Joined: Mon Jan 16, 2017 3:58 am

Re: Teensy 4.0 & 4.1

Post by danhalbert » 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.

KurtE
Posts: 11
Joined: Mon Mar 28, 2022 1:52 pm

Re: Teensy 4.0 & 4.1

Post by KurtE » Thu Apr 21, 2022 12:53 pm

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.

Post Reply