#circuitpython-dev
1 messages ยท Page 113 of 1
would need to see more of the code.
is what's in the current repo pretty much it? and then what you showed earlier?
@idle owl @tidal kiln what would you folks think of returning actual board.A2 (the Pin object) rather than "A2" or "2"? Maybe too confusing?
Yes, exactly. The express.py I'm working from at the moment is stripped down so I can edit it live and not get memory issues, but otherwise it's what 's in the repo
@tulip sleet I think it would be confusing yes
@tulip sleet I want to add iteration but maintain the code being what's labeled on the board
@tulip sleet since you mention it. i'm curious - what actually is board.A2? (in terms of python type)
@tidal kiln it's an instance of the Pin class. They're created in advance and available as constants from board.
>>> board.A2
board.A2
>>> type(board.A2)
<class 'Pin'>
I didn't even know that was an option. That's great
board.A2 and board.D0 are the same pin on CPX. The CPX numbering is kind of all weird to preserve compatibility with CP classic. (EDIT: good example, but wrong board)
oops. sorry for lack of context. that was on a Trinket.
Trinket is also preserving numbering with original Trinket.
hold on. let me get more in sync...
ok. got that. i should familiarize myself with that class. assume it's in the api doc?
hmmm. so it just is what is. no methods or properties.
Unfortunately they don't print all that interestingly, like with the pin name. Also the chip pin number is used a lot, so you see stuff like Pin PA12 in use, which doesn't tell you much.
Scott told me to use gc mem free or something to that effect. I can't find anything on how to do it. gc doesn't have a "mem free" that I'm finding in the docs, but I'm obviously missing something. I think he told me 3 or so commands to type into the REPL, but I didn't get all, of them. How do I check the free memory from the REPL?
Import gc then gc.mem_free()
also micropython.mem_info()
yeah, that's what I was thinking of. Maybe not great for the cpx library, but good for people who actually refer to board.xxx
Agreed
Awesome, great job @tulip sleet!
yeah, and i think the cpx library should lean more towards a more user friendly interface
it would be nice if Pin had some property that was the board label string. Not sure what we would need to do to make it work across multiple boards, but should be possible.
Sounds like it should be a GitHub issue (it might be one already)
@tulip sleet labeled like how? We already have things that are descriptive, like board.SCL....
@idle owl this?import gc gc.collect() print(gc.mem_free())
@tidal kiln @idle owl so anyway, I was kinda interrupting you about the dictionary stuff
@floral dagger import gc gc.mem_free()
lol nm I see it was answered
@drowsy geyser but if you have some anon Pin object, you can't find out what its original name is.
no worries. glad you mentioned it. relates to something i was thinking about some days ago.
@tulip sleet No it's fine! I'm learning more and better to have more ideas
Oh oh oh, I'm being dumb. Yes, you're right!
@tulip sleet you've read through the related issue?
https://github.com/adafruit/Adafruit_CircuitPython_CircuitPlayground/issues/12
@tulip sleet I have working code now, but @tidal kiln was suggesting another way to do that I had considered while working on it but it wouldn't have worked with my original idea.
@drowsy geyser no dumb!
@idle owl I did look at your code. I wish DigitalInOut had a .pin property so you could just get the pin back. But it doesn't.
@tulip sleet Ah yeah
@tidal kiln so i assume you were thinking of creating a dict to map the DigitalInOut objects to pin names or numbers.
maybe. something like that.
first, curious which of the usage syntax's you think looks best (int vs. string)?
Since on most boards pin names don't match numbers all the time (e.g. your trinket example), a name is probably better. E.g. A1 is D10 on CPX, I think (or similar).
my thinking is that A1 is printed right on the board, so the string based syntax might be more user friendly
yes
the umpteen different levels of pin abstraction are of little interest
Side note, I'm also considering calling it cpx.touch - it would be more in line with the other touch code. That's irrelevant to what we're doing now though.
worth thinking about though
and i'm not so good at that myself. i always go round in circles. touched no wait touch no wait are_touched no wait.....
'A2' in cpx.touch ? Actually I kind of like touched since it indicates state. What's another API that's just touch?
It's not just touch, they're touch_A1
etc
I think they both work "if you touch A1, it prints" "if A1 has been touched, print"
touch_all?
.touch_A1 returns a boolean, but touch returns a tuple of pin names
But only one at a time, I think
so it doesn't seem so parallel to me
fair enough
cpx.touch could return (False, True, False, False, ...) for all the pins, but that's actually not so great
no. think of usage.
it can be more than one at a time, right? cpx.touched -> ('A1, 'A3')
Ah
so, returning a reference to the pads touched rather than a set of true/false responses for each pad?
correct. i think the only question is what exactly the reference should be.
hiya i'll be doing this and bme280/680 :)
@idle owl come to any conclusion?
Not exactly. Both options make sense. We can stick with touched.
I'd say wait for Scott's opinion but most of the time he tells me to decide ๐
is there an equivelant function for other parts of the board?
use klingon then!
digital in pins?
he is good at having people move forward into new territory๐
Is there a function to return what neopixels are lighted for example? If so, should they be consistent?
@floral dagger I would call it pixels.lit or something, but no there's not eqivalent functions for other parts of the board. All of the tone stuff has "tone" in it, so it's kept uniform when there are multiples...
ah, ok...thanks @idle owl
if 'D1' in cpx.low_pins:
print("D1 is LOW!")
We've not yet written up two different ways to do similar things for any of the other APIs
Haven't needed to
This is the difference between each invidivual pin, or returning info from a tuple of all of them
It's not a difference in state of the pins between this and the other part of the API
The touch stuff is input. The pixel values are known to the programmer. If we were attaching buttons to a bunch of pins something like cpx.low_pins might be helpful, but there isn't a central place where the DigitalInOut pins that are set to input are known.
unlike the touch stuff
Say pixel.lit returns a list of variables that references the pixels in a certain way, it would seem intuitive froma user standpoint that "touch" or any other equivelant should behave similarly.
But if that's not there, then it doesn't matter anyway ๐
Heh, yeah. This is the first time we've done something like this, other than there being multiple versions of *_tone
You all know way more than I do, so I'm probably not much help. Just trying to learn
@floral dagger I am still pretty new to all of this. Seriously. I'm learning so much as I go as well. You're a very welcome part of this conversation!
Anyway, debating design doesn't require huge amounts of knowledge. In the end, design is a matter of how it looks to a user. Having different perspectives on this is always good.
@tulip sleet is a wizard. Where do we send alms? ๐ [CP for the M4 is now compiling after he showed me how to update the gcc toolchain!]
@drowsy geyser #hug-reports
@drowsy geyser Don't worry - Adafruit sends me alms already.
Me too! After all, I have an M4 to work on!
I am fading. I'll say goodnight!
G'night!
@tulip sleet Good night! Thanks for all your input!
@tidal kiln I guess the most important thing here is, does this do what you wanted? I mean, your code examples work, but that's not necessarily the same thing.
you're giving me too much sway. i think the idea of a tuple return is useful. but details are a point of design and discussion.
didn't mean for you to think both had to be implemented.
I learned a ton from figuring all that out. Totally worth it.
Anyway Dan asked for the same thing when I was writing the original API but we decided it might be an edge case. So you asked wasn't new, but it meant we were wrong.
Which is good!
I'm just making sure that the functionality you were looking for is there. Design can be sorted, but that part I want to make sure is solid.
so, looking in the PEP20 zen refamadoodle:
"There should be one-- and preferably only one --obvious way to do it."
lol
so even more sorry you did both
I'm serious that it was worth it. Promise.
what do you think about the string version?
I like it returning what's labeled on the board. That part I'm steadfast with, have been this entire time because in teaching a friend how to use this board, trying to explain everything starting with 0 and so on was a new concept to them, so having it be already on the board is super useful.
i agree
Whether it's touch or touched isn't really a big deal. I'll probably ask a few other people which makes more sense on it's face and give that consideration to figuring that out.
thats sounds like a very good idea
I don't understand tuples well enough to know if the core functionality of the function does what you (and Dan) were looking for. That's why I asked. Going based on your random code suggestions, I nailed it, but I don't know how to test it beyond those examples, so I have no way to extrapolate the potential use cases.
are you still confused about tuple vs. list?
Nope, that part makes sense
It's just not understanding what another example might look like. Or what I might use it for in general.
tuples?
The entire function I mean, not a tuple specifically
What another example of code that works with this function might look like
oh
I need to be more clear here lol
other than the ones in the issue?
Yep
I have no idea how to use the function I made beyond changing the numbers in what you posted in the issue.
Why would I use it?
What is another example of it?
That's what I mean
Or did your issue cover all the potential code that works with it
not at all
I have this right now while True: if 'A1' in cpx.touched(): print("touched A1") for pad in cpx.touched(): print("pad {0} touched!".format(pad))
it's general purpose
I wouldn't know what else to try
I know it prints for A1 twice, I was just making sure they both worked ๐
not a really good example, but imagine what the last two lines would look like using the current api
Ah ok yeah
for the if one, imagine if the A1 were something more variable
How would that work? I tried a few things but it just stopped working completely
My 2 cents on pin instances vs strings... You loose any richer information by going to strings. I always look twice when I see strings being used to represent things. When you have a string, that's all you have.
MAKE_ROCKET_GO_PIN = board.A1
#
# thousands of lines of code
#
if MAKE_ROCKET_GO_PIN in cpx.touched:
make_rocket_go()
@umbral dagger It's meant to be simple.
Another 2 cents... in a constrained environment, sometimes simpler (and smaller) is better.
then you decide you want A2 instead
And you're not searching thousands of lines of code....
@idle owl And it's not as if Python is going to do a lot of type checking, so you don't get that benefit by having somethign more specific.
@umbral dagger Exactly. And all the CircuitPython stuff will still work. This is meant to be a simpler class that allows you to learn how to program and work your way to the core stuff.
That's where I think the M4 will be a game changer... the expanded RAM space.
Also exactly
@idle owl Ya.. I only have partial context on this.
@tidal kiln Alright, that makes more sense.
not only searching the lines of code, but with the current api you'd have to change the actual function call, cpx.touched_A1 to cpx.touched_A2
@tidal kiln I was thinking of a sort of "combination" lock where you had to touch all the correct pads at the same time.
that's a good one too. having a tuple to work with would make that simpler.
otherwise it's if cpx.touched_A1 and cpx.touched_A2 and etc.
How does it look with the tuple code
and if you change the combo?
with a tuple, you use in, but to check for multiple, there's some pythony trick
here's what the google says:
https://stackoverflow.com/questions/6159313/can-python-test-the-membership-of-multiple-values-in-a-list
hmm, but that's a list
should work for tuple too
Ah
>>> COMBO = (1,2,3)
>>> all(x in (1,2,3,4,5,6,7) for x in COMBO)
True
>>> all(x in (3,4,5,6,7) for x in COMBO)
False
>>>
yep
nice!
COMBO = ('A1', 'A2', 'A5')
if all(pad in cpx.touched for pad in COMBO):
print("UNLOCKED!")
else:
phone.dial(911)
good example @floral dagger !
@idle owl Very nice
@tidal kiln Needed (): if all(pad in cpx.touched() for pad in COMBO): But now it works! I remembered from earlier that I had forgotten () and it gave me a bound_method not iterable error. Can't believe I remembered that enough to figure it out immediately.
did you @ property it?
I didn't figure it out myself the first time, lol. I had help. But I remembered!
I did not
and now that you mention it, I remember that it resolves needing the ()
Or the () showing up on Sphinx docs, lol
easy to crack though. just touch all pads.
I feel like if someone malicious has access to your CPX, them cracking the code to print unlocked is the least of your worries.
lets talk about this touched business tomorrow during our voice chat! its an awesome discussion
Will do ๐
glad we answered your question about using a dictionary!
Now I have to come up with something else to learn dictionaries!
@tidal kiln Thank you so much for all your time. I really appreciate it!
It might be that dictionaries might be a good way to define pins (with another layer of abstraction). You could make a given MCU's pindefs more easily portable to other boards with the same MCU by having a dictionary of pin numbers to MCU pins
And now it's time for me to call it. Thank you @floral dagger and @umbral dagger for your input!
try writing a program that prints different things with different touched pins
and store those responses in a dictionary
@idle owl Any time
or to map a set of neopixels to light to a touch pad
yw @idle owl Gn. It always fascinates me to watch all this stuff come together.
I've been working with the MQTT stuff over the weekend. It works pretty well on CP connecting to Adafruit IO. It's an interesting protocol. Have any of you worked with it in CP yet?
@floral dagger Not in CP yet. In C, Go, and Scheme, though.
# a dictionary of tones
tones = {
'A1' : 262,
'A2' : 294,
'A3' : 330,
'A4' : 349,
'A5' : 392,
'A6' : 440,
'A7' : 494,
}
# get all currently touched pads
touched = cpx.touched
# if there are some
if len(touched) > 0:
# play the tone associated with the first one
cpx.start_tone(tones[touched[0]])
@floral dagger Actually twice in Scheme, where I build integrations with the underlying Go and C libraries.
@floral dagger It's a nice protocol. Simple, yet functional.
nice @umbral dagger I was surprised how little info there is for a beginner, but once you start piecing it together it does come together nicely.
@floral dagger There's a fair bit of information on the paho site: https://www.eclipse.org/paho/
@umbral dagger IThanks! I'll have a look at that. It's funny, I have like three or four sites I was going through. One has a great graph of the bit order for connections, one explains what it does. It's all very fragmented between all the different software that implements it
@floral dagger Oh.. and they have a fairly clean looking python implementation
@floral dagger I'm using the paho C implementation as the basis of my current ChickenScheme support
Yeah, the micropython one is fairly complete.....but they've not implemented non blocking connections
it has the function, but just calls the one forblocking inside of it, which is odd
oh cool @umbral dagger
Ah sweet! My first CP PR!
@slender iron So... did you swap out the flash on a Feather to test the PR? ๐
Happy hacking, west coast folks. bedtime here for me. M4 arrives tomorrow.. I am excite!
@umbral dagger nope, it won't be "officially" supported. Good night!
Hi everyone and <@&356864093652516868>, our weekly is on for tomorrow (Monday) at 11am PT / 2pm ET in this text channel and the CircuitPython voice channel. It'll be the usual Hug Reports, State of CircuitPython, Status Updates and Odds and Ends as usual. See you there!
@hollow tartan the first step is getting your own ESP8266 build going
I have a github acct
there are instructions here to do it using a vagrant VM: https://learn.adafruit.com/building-and-running-micropython-on-the-esp8266/build-firmware
what os are you on?
win 7
kk, vagrant is a good approach then. I believe @solar whale has ESP8266 builds going that way as well
Oh Kay ๐
once you can load your own build, you can confirm that the code doesn't work like it should (see the bug) and then fix it ๐
lots of folks here to help ๐
Alright, I have my marching orders. Thank you, sir.
no problem!
GitHub pulse is awesome in pulling stats for an individual in the last week. It would be awesome to have a python script that can run in the Adafruit bundle and Community bundle and aggregate the stats for all of the repos.
Start with the stats on the Pulse page. Later we can add other things like new contributors.
just got my led matrix working with my m0 on the repl; wew!
Add pycodestyle checking to Travis builds for all CircuitPython drivers and examples.
autopep8 can be used to clean up failing code and get travis back green.
@slender iron I can now successfuly build a .uf2 version of CP master and load it to the metro_m4 via your new bootloader. I wish I could explain what is different, but I may have just been loading the wrong file before. In any case - it seems to be working fine now. At least this time. I tried reloading the firmware.uf2 file you provided and have mixed results with it as I did last night. Sometimes it hangs in REPL then eventually unmounts CIRCUITPY. My latest debug build is: Adafruit CircuitPython 3.0.0-alpha.0-29-g1c97b7f4d on 2017-10-23; Metro M4 Express with samd51j19 -- current master.
@slender iron one more update on using the UF2 bootlaoder- I can only get the new UF2 bootlder to be regognized on my MACOS system. My linux system and my Raspberry Pi do not mount the METROM4BOOT file system when I doubletap. They will sometimes mount the CIRCUITPY system but sometimes won't mount it unless I reboot them. It will mount CIRCUITPY after a reboot of the linux box. It all works fine on the MACOS box....the linux box and raspberry pi still report lots of errors ```Oct 23 06:01:27 Ubuntu-Macmini kernel: [ 322.125651] sd 7:0:0:1: [sdd] Unit Not Ready
Oct 23 06:01:27 Ubuntu-Macmini kernel: [ 322.125654] sd 7:0:0:1: [sdd] Sense Key : Illegal Request [current]
Oct 23 06:01:27 Ubuntu-Macmini kernel: [ 322.125655] sd 7:0:0:1: [sdd] Add. Sense: Invalid command operation code
Hi @tannewt,
Just to clarify the use of autopep8, since it's not entirely clear from above. I think it's fine to have a tool to check the style of PRs. I would be cautious about using the tool to automatically change code as that can introduce errors and unexpected results.
Just an fyi, well maintained tools can be found in the PyCQA org:
https://github.com/PyCQA
@slender iron since my work from home day got moved, I won't be able to participate in today's meeting. Womp womp ๐ฟ
@slender iron I should be able to attend the meeting today.
@solar whale I had an extended episode over the weekend in which no M0 boards (Including CPy 2.x) would appear as ...BOOT on my Ubuntu 16.04 Linux box. I rebooted with an older kernel to no avail. I then powered down completely and things were better. I don't like not understanding why this is happening.
@tulip sleet UBS ports can get locked out sometimes (especially if too much current gets drawn, but Iโve seen it happen for reasons that arenโt clear). Check if the port works with something else. Often a reboot seems to be required to reset things.
My M4 will be well travelled by the time it gets here.
@umbral dagger The port was still working: I could mount CIRCUITPY manually, but the automount was not working. However, it may have been in some kind of bad state. When I looked at dmesg, it seemed to be complaining about the filesystem. However, no USB drive (not just M0 boards) would work at all. I have a number of USB sticks that didn't show up. So I was looking for any recent Linux changes that might have affected this.
those M4 travels are indeed ridiculous: "I need to get to Canada tomorrow. Well, sir, we can route you through Iowa and then Montana and then back to Toronto. How's that."
@tulip sleet ugh. USB can get weird. I imagine the file system stuff adds another layer of potential weirdness.
I can understand odd routing to take advantage of space in planes for overall faster delivery, but the loops ...
My M4 is in Phil's inbox. Lol
Haven't had the heart to tell him he overlooked my email yet.
I haven't had a lot of time to test anyways.
@formal plover can mention today
@tidal kiln yeah, I might just DM Scott what I would say in today's weekly. I won't be able to participate today unfortunately.
ok. and then you can also mention the M4.
M4 is finally on the truck and out for delivery!
@tulip sleet do you see any messages like the ones I posted in via dmesg?
@solar whale I am seeing those. I am also seeing this odd behavior: connect CPy 2.x Gemma or Trinket. REPL works fine. Connect up 3.0 CPX. Use REPL a little. Unplug it. Now no board (including 2.x Gemma and Trinket) work with repl. I get "screen is terminating" messages. However, it does appear to work with "sudo screen". If I look at the protections on /dev/ttyACM0, they are wrong. Then it flips back, at random, after unplugging and replugging, but only sometimes:
crw------- 1 root root 166, 0 Oct 23 11:27 /dev/ttyACM0
halbert@salmonx:~$ ls -l /dev/ttyACM0
crw-rw---- 1 root adm 166, 0 Oct 23 11:28 /dev/ttyACM0
It's as if unplugging the 3.0 CPX leaves the linux kernel or drivers in a bad state.
this wrong protection is also coincident with CIRCUITPY and ...BOOT drives not showing up.
i've seen something that may be related. sometimes the drives get mounted as read only. (on linux)
sometimes they are read-only if the driver thinks they are damaged (same old delayed-write problem); but could also be protecttion?? There are recently created systemd-udevd processors in ps. I have looked at recent changes in systemd, but haven't found anything suspicious.
it's like the udev rules aren't working all the time
yep
I do have the Adafruit-supplied udev rules to allow non-root access to ttyACM0
same here
@tidal kiln you mean same permission problem?
yep, they have worked fine up to now. Either something changed in how they are treated or something bad is happening sometimes when device is plugged in (or previous device is unplugged)
yeah, it seems related to plugging/unplugging
I have had them mount seemingly read only when I try to drag/drop but I can cd to the directory in a terminal window and write to it.
when it's happened on one machine, i've simply moved to another (also linux, also has udev rules) and it all works fine
@solar whale what're you on?
because now that you mention it, same for me
Linux Ubuntu 16.04 also raspberry pi stretch.
same here, ubuntu
Works on macOS
and same here, updated as of a few minutes ago with latest packages
yeah it takes care of automatically mounting. But I don't see why it would have to do with the /dev/ttyACM0 permissions.
could explain why it's interfering at the gui, but not at the cli
but yeah, doesn't explain your ls of /dev/ttyACM0
When the filesystems don't show up, I see nothing in /media/halbert. But I can sometimes mount the filesystem by hand with sudo mount. However I also get complaints that it's damaged and won't mount. Fixed by reboot.
well, not sure about the reboot. it may be inconsistent
@tulip sleet I get a similar permission problem with the usb drive
also - i haven't done anything with 3.0 yet, so don't think there's any relation to that
I just assumed it's ubuntu being stupid and broken
i think it's that
I have that with 2.x
did any of your have the unable to connect to repl problems with 2.x recently (past few days)?
yeah, me neither, at least not that i've noticed
i think these may be separate problems
i think so also
the auto mount to /media and the drag/drop are gui things
the permissions on /dev/ttyACM0 are something else
or, the usb driver problems are affecting downstream things like the automount. not sure if ttyACM0 permissions are downstream or not. I have to read how it all works.
it's time for me to be methodical in testing
there's always a reason; it's not cosmic rays
good luck. please report back.
Hi all, do we have a preferred way to do random? I want something like 'random(1, 10)' for a value.
looks like MicroPython docs say: https://microbit-micropython.readthedocs.io/en/latest/random.html
that's the random module, which then has what you're probably looking for
can you describe the use case more?
@tidal kiln I'm doing some tone generation and want to have some randomness so it doesn't sound like a pattern.
@solar whale when you can't connect, let me know if the permissions are wrong
Ok will be home in a while
something like: 'cpx.start_tone(288 + (i * (random(1, 10))))' where i is me looping through ten times.
looks like maybe you want random.randint(1,10)
@split ocean if you use the pentatonic scale only, it will sound good even if completely random
you want to send start_tone() a value that ranges from 288 up to some random offset?
thanks @tidal kiln that did the trick
yes, it's based there at 288 and then each iteration "wobbles" around a bit by that random value
I'm not saying it's aliens. But, it's aliens.
can maybe replace whole thing with random.randint(288, 288+WHATEVER)
aah, for alien stuff definitely you don't want pentatonic ๐
to answer your original question - i don't think there's one 'preferred' way, other than just using what's available in the random module
and if you want truly random, you'll need to seed it
random.random() is the basic functionality, but don't overlook the other useful ones like random.choice()
and when using randint or randrange be careful about the inclusiveness of the range
thanks much!
i don't need true randomness, just organic variance : )
i like the looks of random.choice() thanks, that could be fun to feed it only the notes I want for some other music-ish projects.
yep
instead of generating a random index value and using that to retrieve the item out of the sequence
The M4 arrived. Now to resist the temptaton and try to get some work done. You know.. for the people who pay my bills ๐ OK, so it's generally also fun.
@tulip sleet Are you looking for permission issues with 2.1 connections or 3.0? THe only 2.1 issue I have seen is sometimes not automounting CIRCUITPY an then it appearing to be Read-only. With 3.1 it does not even create ttyACM0 some of the times.
@solar whale I mean the root-only permissions on ttyACM0, not filesystem permissions. I haven't seen filesystem permission issues except with write-delay problems. What I do see is the filesystems not even mounting. And yeah, with /dev/ttyACM0, sometimes it's not even there.
@split ocean If you just want to sort of "warble" a tone around the central tone, you could probably do something like ((random.random()*.05)*tonevalue) + tonevalue It's similar to what I am using on a candle project to sort of randomize the blue LED by 0-5%of its base value
Keeping master up-to-date with bugfixes and features from 2.1.
Notable for master from 2.1:
Abstracted SPI vs internal filesystem selection in mpconfigboard.mk.
Strong pin drive support.
@tidal kiln @solar whale @tulip sleet USB problems in 3.0 wouldn't surprise me at all. I don't think the ASF4 Chapter 9 USB stack is very well tested.
thanks @floral dagger I'll try that out
@slender iron yeah, and it seems to be getting the Linux USB stack into a bad state in some way
yeah, that doesn't surprise me. I have a linux box I can test with after I finish the UF2 stuff
MacOS seems to be far more tolerant of it.
if you can duplicate it, that would be great. You can look back for the issues, or I can give you a recipe: (unplug 3.0 board after REPLing, then try any other board)
Linux stack should be more robust than that
It is almost alway OK immediately after reboot of the linux box, but it deteriorates quickly.....
I was concerned that it was relaled to use of Jlink, but I think the JLink USB connection is just caugt up in whatever is getting hosed.
@slender iron I just ordered a box to install Linux, so I should be able to help test/debug in about a week.
@solar whale Can you force the condition with other USB devices? (Sorry, I'm at work so missed the conversation.)
@solar whale I haven't been using jlink at all during these problems -- it's not even plugged in.
Well there's the answer. Thanks, @tulip sleet
I have not had issues with any other USB devices.
@drowsy geyser it happens after using 3.0 boards. Then many things don't work, such as plugging in regular USB sticks: their filesystems don't show up. But only the 3.0 boards seem to provoke the problem.
off for a few mins
Oh, that's fascinating. Not good, but fascinating.
I'll see what I can do once I get my Linux system built.
I think @slender iron is going to regret enabling so many early testers ๐
@tulip sleet I alos had issues with a metro_M0 3.0 build. Have you seen that as well. I can try that again if needed.
I am seeing these issues on CPX 3.0 build. Havenโt even started on M4 yet.
just loade 3.0 on M0 - USB drive did not auto mount and ttyACM0 looks OK and I can connect, but no response from REPL an dit exits after a few minutes
CIRCUITPY is not accessible.
@solar whale nah, I'm ok having bugs found early
Moved USB cable to MACOS and it mounts CIRCUITPY and REPL works fine
@solar whale I have a bad habit of using infinite loops in error cases. You may be hitting one of them
@slender iron what part of the code it this likely occuring in?
not sure. I use the while loops because I can get a backtrace with a debugger
I was just curious wher it may be useful to look at the code - where is most of the USB stuff you are working on?
BTW on M0 the REPL does not print out garbled strings like it does on the M4. import board then dir(board) looks normal on M0, but gets garbled on M4.
ah! in atmel-samd/usb.c and atmel-asmd/usb_mass_storage.c
thanks.
no problem!
@willingc I don't intend on automatically running autopep8. I was thinking it'd be used by someone to fix the backlog of existing files we have. That way when Travis style checking is green when enabled.
Thanks for the links to those tools! Add love to be able to add checks for when certain Python funcitonality is used as well. For example, I'd love to keep bit manipulation (| and &) out of examples and only in driver code.
now have a new wierd case - CP 2.0 on M0 all good on MacOS but on Ubuntu - CIRCUITPY is empty? REPL works OK. - went back to MacOS and CIRCUITPY has all its files in place!
and os.listdir() on the UBuntu system shows all the files, but they are not visible on CIRCUITPY
ah - even weirder - ls /media/jerryneedell/CIRCUITPY shows all the files do the drive is mounte OK - just the GUI file manger is confused.
so just the gui layer?
closed an reopend file manger and it is now showing the files!!!
Special.
That is actuall "exited" file manger and close all windows then restarted
I never liked GUI's
@solar whale Just out of curiosity, which version of Ubuntu are you running? I'm going to be building a 17 system....
16.04
same here. tend to just go with latest LTS
Thank you!
Same
@tulip sleet FYI - I have always had USB erors generated by my backup drive - from what I read they are supposed to be "harmless" but now I wonder - see https://askubuntu.com/questions/832394/what-does-this-error-mean for some background
They are not the same erros we see with 3.0, but I wonder if there is a common tread.
@drowsy geyser Iโm running Ubuntu 17.something
@umbral dagger Thanks! Is there a significant improvement of 16.04?
@river quest Thank you so much!
@drowsy geyser Not really sure.. It had come out just before I built my system and had support for all the bits and pieces. Itโs been working fine ... about 6 months now.
HukuzatuaNa#8314 Iโll dig into the M4 later today
@umbral dagger Just got some flash chips - looking forward to supersizing an M0_express
Cool. I'll keep using my Windows 10 system for the M4 until I get the Ubuntu system built.
@solar whale Nice. You got the one I used?
pro tip: if you find yourself on a borked terminal after disconnecting from your CP-thing, type 'stty sane' to maybe, probably get your terminal back into a decent state.
yes - hope so anyway
@solar whale http://www.cypress.com/file/316661/download
S25FL064LABMFI010 P/N
@drowsy geyser I am using 16.04 but am using the cinnamon (mint) UI, which I started using recently after getting tired of Unity (which is going away anyway). The regular Gnome UI, which is also an alternative, is too low-function for me. PPA for cinnamon is https://launchpad.net/~embrosyn/+archive/ubuntu/cinnamon
@solar whale Thatโs the one. Just build with BOARD=...supersized
Just need to steady my soldering hand - they are small!
Thanks, @tulip sleet , I'm not familiar with cinnamon, so I'll give it a try. I'm not emotionally attached to any particular window manager. ๐
lower left of taskbar
@solar whale The extra flash is neat, but RAM is still limiting.
@solar whale After the Trinket hack I did, the flash chip pins seem huge.
I was tempted to try the trinket, but those looked way to small for me to attempt with the tools I have at hand.
@solar whale Do you have am SMT tip for your iron?
no - just some smallish "screwdriver tips"
We're in the CircuitPython voice channel for whoever wants to join
about to get started
me neither
ill try a recoonect
Kurt: โHugs to all the CircuitPython helpers and the community. Extra hug to the M4 testers + Scott and Dan for their guidance on those working on that.โ
Hug report: Echoing @solar whale and @idle owl, thanks to the @meager fog, @river quest, and @slender iron for making M4 christmas in October a thing. Iโm sure weโre all excited to get CP doing backflips on the sweet new hardware. I for one welcome our new M4 overlords.
Also thanks to everyone in the CP discord; the level of teamwork and discussion has been on point.
@fast wharf just got it in mail ๐
@tidal kiln yay!
Out of curiosity, are the upcoming M4 boards expected to be around the same price as the M0s? Will they largely replace the M0s or be a more upscale option at a slightly higher pricepoint?
@marble talon not sure. @meager fog makes those decisions
I thought maybe she'd happen along later and pipe up. ๐
๐
did I miss the meeting?
oh, great
Kurt: โAs for my updates, I don't have any other than continuing to flash 2.1 on some of my boards that are still on 2.0.. Been watching the CircuitPython channel to stay in the loop. Lastly been floating around helping here on discord as much as I can.โ
@solar whale That should work fine for this chip. If you end up bridging pins, just dap with solder wick to pull of the excess.
Iโm going to do a rev two of the MetroWing once I get some feedback from @slender iron, making some nice art and maybe a few more dev-friendly widgets. If anyone can think of any useful features to add, or any other boards that would be useful for CP developers (or users?), let me know.
franken feather?
Sure thing, with the previso that it's currently untested
should be here: https://oshpark.com/profiles/siddacious
one more thing:
Otherwise Iโm going to see about getting the different branches built on the M4 and M0 where appropriate and read a bit through the code to get more familiar with it. If my attention would be best directed towards a particular branch or part thereof, please let me know. My hope is to help with testing and eventually development as well.
print('Touched 1!')```
```if 'A1' in cpx.touch:
print('Touched 1!')```
if cpx.touch & cpx.A1_TOUCHED:
http://circuitpython.readthedocs.io/en/2.x/shared-bindings/gamepad/GamePad.html <-- I didn't know about your discussion, so I just used whatever made sense to me in the gamepad class, seems like this is a similar use case.
cpx.touch_A1
Another example: while True: COMBO = ('A1', 'A2', 'A5') if all(pad in cpx.touched for pad in COMBO): print("UNLOCKED!")
touch = [touchio.TouchIn(pin) for pin in (board.A2, board.A3, board.A4)]
touch[2].value
def touched(self):
self._touch = tuple(touchio.TouchIn(p) for p in self._pin)
return ['A{}'.format(i+1) for (i, v) in enumerate(self._touch) if v.value]
self._pin = (board.A1, board.A2, board.A3, board.A4, board.A5, board.A6, board.A7)
i have to run, have a 12pm
๐
but i agree.. less strings the better. explicit names are awesome ๐
aren't strings interned in circuitpython?
The idea of having the advanced button stuff in a separate library makes sense but the doco for it should probably be linked to from the "normal" CPX button doco. Maybe that was obvious but easy to find doco = win
yeah totally!
mu, in the long run
we could have an automated style check configured on github?
Link to the latest bootloader to flash onto my M4?
Does the j-link edu have any benefits over the edu-mini other than supported processors?
ttfn
chatter chatter
Chrome can support multiple users which is nice
I have different users for work and personal stuff, as does my wife and my spam-dump
sorry, i think i am a little behind, i just got an metro m4 board today. i have the newest bossac release and i have built the M4 board using what's in github. do i still need to use bossac.exe? Do i send the .uf2 file or the .bin file?
I think for bossa you use the bin file
@fading solstice I'm at the same spot
uf2 bootloader cod eis here cause its early: https://github.com/tannewt/uf2-samd
actually SR-71 was designed in a similar system to SCRUM
@umbral dagger and @fading solstice did you get the bootloader going?
@slender iron i looked at the uf2-samd github and could not figure out what to do next.
the board comes with the bossa so you can just use the latest bossa to load bins
I flashed the uf2 loader, got the boot fdrive, put CP on it, got the CIRCUITPYTHON drive....
Now nothing... the "L" led is slowly pulsing
I have ttyACM0 but can't screen to it, and no USB drive is showing up
Well, if I single-tap reset just the power LED is lit. IF I double tap, pulsing red L.
try rebooting your linux box - somtimes helps - what you are seeing is not unusual
Hi everyone and <@&356864093652516868>, here is the recording from the meeting today: https://youtu.be/mbQFfC4OjJs
Join here for the chat all week: http://adafru.it/discord The weekly happens normally at 2pm ET/11am PT on Mondays. Check the #circuitpython channel for noti...
@mortal wing @umbral dagger i was able to copy the my build of M4 onto the metro m4 board. i did a power reset and the board appeared as a mounted drive. I was able to connect to it using putty on COM3. I entered the REPL.1+2
@idle owl, @slender iron Any infor on which j-link to get? Does the jlink-edu have any benefits over the jlink-edu mini other than number of supported processors?
@fading solstice Sorry but I have no experience with circuit python
@pastel panther I misread that. Sorry! I don't know the differences
i think i miessed the proper cable. the one in the box does NOT fit the metro or the jlink
@pastel panther We all got the edu mini. But get the smaller cable that is suggested on the product page. All of us who just got the M4 anyway... Scott has the standard j-link
I figured I would just buy the edu-mini unless the non-mini had like chrome wheels or something
I am a sucker for shiny things
this cable: https://www.adafruit.com/product/1675
will got straight j-link edu mini to metro
2x5 @ 0.05" on both ends
@tidal kiln thanks
why the 2x10 @ 0.05" ???? ๐คท
because it's teeny tiny and board space is $$?
I think i just have a thing for small boards
but the j-link mini only has a 2x5 header, why provide it with 2x10 cable....???
@tidal kiln I'd say maybe most things have the 2x10, or don't have the shield around the connector, but the cables are keyed so they're expecting the shields. Who knows. Just to baffle us perhaps.
@tulip sleet and @idle owl (and anyone else who may know) do you think there will be a release of 'express' soon? Or already happened? I'm trying to link to the best possilbe place in my guide for people to get it.
@slender iron just tried new bootloader - It works for CP - now to try arduino
@tidal kiln I believe the 2x10 connector has more capability: swd + trace I think
@split ocean The newest version is in the bundle, or available from the releases on the actual page.
My SAME54Xplained board has both connectors
perfect!
@slender iron If you get a chance, can you upload the express.mpy to https://github.com/adafruit/Adafruit_CircuitPython_CircuitPlayground/releases
@split ocean Right now the standalone version with play_file isn't posted as a .mpy, but the current version is in the CP bundle.
@slender iron woohoo! it works for arduino as well!
@idle owl I d/l'd the 2.1 zip here https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/tag/20171019
but don't see express.py or mpy in there.
in the unpacked zip that is
/lib/adafruit_circuitplayground/express.mpy ?
oh, now I see it
That's why all the example code has from adafruit_circuitplayground.express import cpx because of that folder structure.
makes total sense now, thanks
No problem!
i don't have the name in my head as circuitplayground_circuitpython ;)
or the inverse, actually
OK, so I'll test it w fresh install and that release version of the bundle. If that all checks out for me, that's what I will recommend in the guide for setup. Nice to have it all in the one bundle!
@stuck elbow I have thought the same thing...
I do but I have so many other files open with the same thing in it... I had to type it at some point though.
Yay!
congratulations!
@split ocean Don't forget to either update your code or put somewhere in your guide to copy express to CIRCUITPY/ ... I think you have it as from express import cpx. If you've already changed it, ignore me! ๐
rebooting to fix linux ๐ฅ
sad but true - get used to it for the time being.....
thanks @idle owl right, I want this in my code from 'adafruit_circuitplayground.express import cpx'
@split ocean Yep
from adafruit_circuitplayground.express import cpx oh, is this the proper code markdown backtick?
yes it is. now I'm talking to myself
@split ocean Single backtick is inline, triple backtick creates a code block codeblock
@umbral dagger waht seems to happen is taht it will hose up the linux USB when you disconnect it and try to reconnect.
that's very kewl
And I have the led blinking in CP ๐ Sliiy level of excitement.
Woohoo!
@umbral dagger I have the uf2 bootloader, but I haven't built locally, I used an updated build from Scott from yesterday
Ok, so to build it locally, I need to clone this: https://github.com/adafruit/circuitpython
And then run make something and that's it?
yes
init the submodules before making
Biggest repo I've ever cloned. Nice.
git submodule update --init --recursive
in the circuitpython dir
the into atmel-samd
make BOARD=metro_m4_express DEBUG=1``` after doing thw git update
The git submod thing is in /circuitpython/ yes?
yes
Running
then make BOARD=metro_m4_express
or make DEBUG=1 BOARD=metro_m4_express
depending it you want to debug
yes - run the make in atmel_samd
oops.. yes
On Mac. Same syntax?
should be
yes
Excellent
Mac is unix inside
FWIW I'm running the debug build
I get to see more in Ozone apparently, so I'm down
@idle owl - have you installed the arrn gcc toolset?
um... yes. I think I needed it to get the jlink to work?
How can I check for sure. I remember doing it but we did a lot this weekend
ah - yes - should be all set
COOL!
woohoo!
OK... good... I'm going to go back to learning Haskell for a bit before my kid comes over for dinner.
@umbral dagger good luck!
I'm going to leave blink running
@idle owl the build will be in build_metro_m4_express/firmware.uf2 if all goes well
It's taking a while. I assume that's normal.
yup
forgot to make mpy-cross!
but I have a .bin and a .elf so....
Here's the entire output:
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
Generating build-metro_m4_express/genhdr/mpversion.h
GEN build-metro_m4_express/genhdr/qstr.i.last
QSTR updated
GEN build-metro_m4_express/genhdr/qstrdefs.generated.h
39252 bytes free in flash out of 245760 bytes ( 240.0 kb ).
58336 bytes free in ram for stack out of 196608 bytes ( 192.0 kb ).
Create build-metro_m4_express/firmware.bin
Create build-metro_m4_express/firmware.uf2
python2 ../tools/uf2/utils/uf2conv.py -b 0x4000 -c -o build-metro_m4_express/firmware.uf2 build-metro_m4_express/firmware.bin
make: python2: No such file or directory
make: *** [build-metro_m4_express/firmware.uf2] Error 1```
But like I said the firmware.bin and .elf are in the build_metro_m4_express folder...
mmmmm crepe
Odd. It's installed by default.
It's an old Macbook Air.... so... robocrepe...
Python 2.7.10```
but if you type python2 does it run
I have 3.x.x installed over it, but that's there by default.
Nothing
Says command not found
that the problem
Blergh
what about just python?
Do I just install it again? I doubt symlinking it or whatever will work. @tidal kiln It gives me the 2.7.10 version
Or is there a way to make and force it to use python
it's just sym links for me
instead of python2
a symlink may well work
I installe python via homebrew and got all the variants, but you can try the symlink.
What's the actual syntax for it? I have a few but I've never come up with them myself.
for ln?
Wait hold on
you have ppython version 2.... but do you have the command python2
ah.. ya.. like @tidal kiln said
Apparently I need to do something specific with my Python3 install and it attaches legacy to Python2. Looking into this.
That python2/3 duality is so annoying
ahh ok
ln -s TARGET LINK_NAME
I remember "upgrading" to Python3.. "what's this Python2 stuff.. I don't need that anymore..." oops
@tidal kiln ahh yeah ok
you'll need sudo in /usr/bin
yep
@idle owl Welcome to the wonderful world of UN*X sysadmining
@umbral dagger Thanks! ๐
also, i'm on ubuntu, don't know if mac uses a different folder layout
@tidal kiln Not really different, no
i.e. is it /usr/bin/?
yes
@tidal kiln Much the same. /Users instead of /home
I checked.
@tidal kiln the rest is the same (other than maybe some of the more esoteric stuff)
The make boardname clean command will erase the broken half-build right? Is that what that's doing?
yes - usually a good idea
Ok thanks
In this case it would not matter since only he uf2 step is missing, but a good habit.
I'll get the python2 thing sorted and then start fresh. Already ran clean.
@idle owl I have to go for awhile - good luck!
@solar whale Thank you! Have a good one!
@tannewt Cool. We're in agreement. It wasn't clear from the earlier message :-)
One thing that we have done on other projects is temporarily activate the pep8 style checking and then let it pass even with errors until the backlog has been worked through.
@umbral dagger just wait for the circuitpython 1/2/3 triplality ๐
- serial repl!
- digitalio module
- time module
- local flash storage - 128KB of internal flash
Ok python2 resolved, and a few things updated.
Do I need to do the init thing again before building or is that a once type thing
@stuck elbow At least only one will be on a board at any given time. But I hope we can avoid that.
@slender iron trying to convert Beagle output to pcapng using your script. No errors, but file comes out empty. Should I export the .tdc in a special way? I am using the latest (last commit 10 days ago) from your python-pcapng repo.
One thing I noticed right away while recording is that the 3.0 board is much, much chattier when idle than the 2.1 board.
Has the uf2 bootloader been updated since yesterday?
@idle owl @meager fog just so you know, everything works great on UFO calling the cpx commands with clean install of CP 2.1 and the latest bundle.
@split ocean That's great!
I'm not doing play_file at the moment, just play_tone btw
Ah ok. Does it still fit your goal?
yes, it's great, just what I need!
Excellent!
I tried flashing the M4 and it didn't show up at all on the first try, but the second try, it mounted as CIRCUITPY! And I got my blinky back!
I made a debug build, time to try to connect the jlink again and see if I get the middle pane in Ozone.
I think it's still not halting. I still get a DAP error every time, whatever that is. And I have no idea how to even read any of this yet. But it's connected and I see the code. So cool!
And blinky still works on the other side of Ozone which it did not yesterday, so improvement!
Can't get to the REPL out of the serial connection though. This also happened yesterday. Reflashing my build didn't fix it.
anything in dmesg?
@solar whale I am having some success recovering from hosed USB by ps -ef |grep udev, find the base lib/systemd/systemd-udevd and then sudo kill -9 it. -9 may or may not be necessary. That brings back ability to use screen, but the 3.0 boards may still not respond.
Unplug the board while you are doing the above.
How do I check dmesg
thank you
"systemctl"
you will see everything your computer did since it was switched on, look at the end ๐
for usb-related errors
I can get the serial connection started, but I can't get into the REPL. It won't accept keyboard interruption or input. I don't see any usb stuf fin dmesg
@stuck elbow thanks - I was doing sudo udevadm control --reload-rules, which was just hanging (which suggests udev was in bad shape).
haven't gotten used to systemd yet
@tulip sleet yeah, export from beagle as csv
Agreement is good! Thanks for the sanity check @willingc
@slender iron did that, but the resulting .pcapng was only 52 bytes long. Did you change any settings in the dialog box when exporting?
goti it - tnx
@tidal kiln what do you want my eyes on?
My preference would be @tdicola's suggestion because its just explicit enough in my mind. @deshipu's options 6 and 7 feel like they hide too much by hiding board.
So, how about @caternuson's Option 1 for drivers and an issue to support default i2c busses through board so we can do something like @tdicola's example?
@slender iron looking at the 3.0 USB traces, they're chock full of SCSI USB mass storage traffic when they should be largely idle. Also many ENDPOINT HALT requests. Not sure who's doing what: whether the Linux drivers are confused or the board is not answering properly.
I bet the board isn't answering properly
@slender iron Is there a newer version of the uf2 bootloader since the one we flashed yesterday? Or is that still the same
yeah, dean fixed the arduino side
But nothing changed on the CP side?
I don't actually have a build
ok
I remember you mumbling about that ๐
I'm trying to figure out why I can't get to the REPL.
๐
Ok, I've forked this into Adafruit and set up ReadTheDocs. Mind creating a PR to get this in the bundle and fixing the docs?
It looks like the API docs aren't building quite right because of const. https://readthedocs.org/projects/adafruit-circuitpython-tsl2561/builds/6166595/ Try adding from micropython import const to the top and using ReadTheDocs to automoc...
Where are we at on this @caternuson ? It doesn't look like this code has any notion of channels.
@idle owl I could not get to the repl on a USB3 port on Linux. It works on USB2. If you have a USB2 hub you could interpose it if you have no USB2 ports on your Mac.
screen would connect, but I couldn't type or see output, and couldn't exit.
We have one somewhere. I tried flashing yesterday's firmware but that does weirder stuff. I need to rebuild my local build. I cleared it with the intention of trying again.
If it fails again, I'll try the USB2. Thanks!
This is not on an M4. This is just on a CPX. I have decided not to try wrestling with the M4 bootloader quite yet. But I believe this might be a USB problem, so using USB2 might be applicable to both.
Ok every time, the first time I flash, it doesn't work. It appears to do nothing. If I put it into the bootloader again, drop the same firmware.uf2 on it, mounts as CIRCUITPY. This has happened every time I've flashed it, done some things with it for a while, and then tried to flash it again at a later time.
Serial connection works, still not taking input to get to the REPL. Going to try to find a USB2 hub.
Print statement in blinky code.py is working in the serial connection.
@slender iron https://twitter.com/jdriscoll/status/922598628111409153
itshappening.gif
๐
Yay!
time for me to climb
l8r!
has anyone mentioned the flaky REPL interface on M4?
Yep. I'm dealing with some REPL issues right now.
Oh that I'm not sure of. I usually assume for a while that it's something I'm doing. I replicated it finally a few minutes ago, but I haven't filed an issue.
ok
dir(math)
[name'U, e'U, pi'U, sqrt'U, pow'U, exp'U, log'U, cos'U, sin'U, tan'U, acos'U, asin'U, atan'U, atan2'U, ceil'U, copysign'U, fabs'U, floor'U, fmod'U, frexp'U, ldexp'U, modf'U, isfinite'U, isinf'U, isnan'U, trunc'U, radians'U, degrees'']
I can't even get to the REPL right now, but when I could I did dir(board) I got a lot of weird characters.
dir(math)Ab=math.cos(1) happens when I type a up arrow key twice
should get one or the other command, not both
I haven't heard this issue yet.
i am on windows 10
I haven't done any testing on Windows with the M4 yet. Or with any of these boards for a while.
I'll be back in a bit, need to do dinner.
@fading solstice I'm on Windows 10 too. I'm going to flash my M4 with CP built from source last night when I get home tonight, so if you're seeing something strange and need someone to replicate it, just let me know.
@timber mango us Michiganders love CircuitPython!
@drowsy geyser try import math then dir(math). then type b=math.cos(1). that should work fine. now type up-arrow twice. i.e., up-arrow up-arrow. The command line should show dir(math), but instead show more stuff.
Ok, will do! Heading back that way now. ๐
USB2 did not resolve the REPL issue. I still can't get to it.
@solar whale systemd-udevd was using ~100% of CPU after using a 3.0 board. I restarted it with sudo systemctl restart systemd-udevd
I awoke the system from sleep after a couple of hours of non-use.
@tulip sleet thanks. sounds like you have been making progress.
@solar whale stopping for now but will take a look at MSC details tomw. Looks like some kind of ineffective communication between host and device is generating a lot of useless traffic.
@meager fog I love, love, love the CircuitPython Educator's Box. It makes me so happy. We played your CS4ALL video for 80 high school and college women during an all day hackathon on Saturday for two humanitarian causes. Folks loved the eyeballs. ๐
@tulip sleet great work - Goodnight!
@tulip sleet wow sudo systemctl restart systemd-udevd caused an immediate mount of METROM4BOOT - It had not been able to do that . Very nice!
@idle owl Are you using a Mac - I have had few REPL issues with mine on MacOS. BTW I think I have a reliable workaround for the "unable to halt" problem wiht J-Link. What I found works is to disconnect the USB (power via 9V) then manullly enter bootloader and then try Jlink. After it connects, I can plug the USB back in and get to UF2 drive or REPL.
Hmm. I am using a Mac yes
still no REPL
ah - have you tried it with the J-Link disconnected.
Yeah I usually disconnect it before doing anything. I haven't had it connected since I checked earlier to see if I could see the code in Ozone
I assume it'll interfere ๐
@fading solstice dan is looking at the USB issues now. we know its flaky
Dan is onto something - the restart of systemd-udevd really helps!
@idle owl how do you connect to REPL - screen /dev/tty.usbmodemxxxxx 115200 ?
I just plugged mine into my MAC and it took a few tries for connection to work. but it eventaully did.
I am using DEBG build
It connects just fine, but it doesn't accept ctrl C to get into the REPL or any other input to interrupt the serial connection. If I add a print statement to code.py, it prints just fine
If I save code.py from an editor, it does a softreboot even
hmmm - maybe it is just ready for baby steps....
lol. Along with fdsafdsafdsa that I typed earlier trying to see if anything would work....
Like it stored all the ctrl C I did....
๐
hmm.
control-C ends it and Iget control back.
I copied it back and imported it and it ran. Did ctrl+D to get it back to the serial connection, and then I was still able to get back to the REPL.
Going to try disconnecting it now and seeing if I reconnect if it works
yesterday was a long time ago ๐
๐
Congratualtion on your first build and getting J-link going!
Thanks! It still gives me the halt errors, but it's a start!
the halt errors are common - you saw my post - let me know if that works for you.
I copied the suggestion out so I have it, I think I'll try it tomorrow
but you need the 9V supply
all in good time - you are making great progess - so much of this has to be experinced rather than demonstrated.
For example. the Jlink is an incredible tool and it will take a lot of poking and proding to get used to it either in Ozone or GDB but there is no way to learn besides doing it.
Yeah for sure
The metro_m0 says the supply should be 7-9 V so I guess a 5V supply os not enough. too bad. they are more common. I was glad I had a 9V available.
I have a friend who does this type of thing daily, I told him he's on for teaching me, but he lives a ways away and it'll be a while before I see him. So I'm on my own for a while ๐
You too! Have a good one!
Hi 'all. Blink was still running solid. Screen was still connected. CTRL-C got me the REPL prompt and it worked fine.
Nice!
using up/down-arrow appends to the existing cmd line rather than replacing it
The output from dir(...) gets garbled seemingly semi-randomly
[__namm__'), colleec'', ddsabble), eenale'), 'senablee'), mem_frree), mem_aaloc'']
>>> dir(gc)
[__name___', ccolect'', dissbbe'), enable'), iisnnbled'', mem_ffre'), mem__aloc'']
>>> dir(gc)
[___amee_'', colllcc'), ddssale'), enabll'', iieeablld'), mmmm_ree'), 'emm_lloc'']
>>> dir(gc)
['_naaee_'), coolecc'', diisbbl'), ennale'', 'ienaabed'', mme_ffre'', meemalllcc']
>>> dir(gc)
[___ame___), collectt), disabll'), enablee), 'ienaabeed), 'em_free'), mem_alloc'']
>>> dir(gc)
[__nnmm__'), colllett', dissale'), ennble'), iseeabled'), mem_ffee'), mme_alllcc']
>>> dir(gc)
['_nnaee_'), 'olleec'', dissbbl'), ennabe'), iseeablee'), mee_free'), meem_lllcc']
>>> dir(gc)
['_name__'', 'clllct'), ddiablee', eenbbl'), 'sseabble'', memm_reee', 'emm_aloo'']
>>> dir(gc)
['_naam___', cclllet'), diisalle', eeaabe'', iiseablld'), 'eemfrree), 'emm_lloc'']
>>> dir(gc)
['_naame_'), colleet'), 'iiable'), enabll'), iienaalld'), 'eemffee'), 'ee_alloo'']
>>> dir(gc)
[___ame___), ccolect'), 'isable'), 'nabll'), 'iennabed'), mmmmffre'', mmemalllc'']
>>> dir(gc)
[__name__'), cooleett), disaabl'', eenall'), 'ienaalled), 'me_ffree', mme__llooc']
@umbral dagger Reading that makes me think your M4 is just drunk.
@umbral dagger I have seen both issues
Less obvious because there's a lot of 2 letter pins in dir(board) so there's only so many random combinations of 2.
output of REPL results seems fine
But there seems to be an issue with the readline equivalent. I.e. manipulating the command line
Not clear if it is on input or output - if output it may be one issue. If input it is two....
yes - so Iam hopeful it is all related to output of strings.
... print(x)
...
0
1
2
3
4
5
6
7
8
9
Backspacing and correcting worked
left/right-arrow appears to be ok
Just don;t look at the screen ๐
but left-arrow "too far" and type and it messes up... appending copies.
I thought about entering an issue, but I'm not even sure where - Thought it best to give it some time....
Now it is really time for bed - Good night all.
'night
I'm wondering if it might be my terminal emulation.
hmm.. screen claims VT100 compatibility which is what CP looks to be assuming/requiring
@river quest They look great!
it's like a mirror of all the cool stuff we are doing, so thank you everyone here!
And thank you @river quest!!!
Might just have to make the large banner my Twitter banner.
@formal plover Ohh.. good idea.
Thanks @umbral dagger! Mine is up
So... screening in doesn't work anymore... and I can't get the BOOT drive (doubletap reset) But CIRCUITPY shows up fine on reset. I can edit main.py on the board.
It isn't auto-reloading, but reset will pick up the changed code
hiya it appears i2c's busdevice uses read_into but spi uses readinto
maybe lets standardize on one?
@formal plover So's mine. I did my facebook as well
Enyone that knows me will be shocked that I'm a Python fan now!
Though to be fair, I'm a circuitpython fan
Howdy folks! I'm finally done with post-work things and can play around with my new toys!
I thinik @idle owl infected me. My REPL isn't working now....
@pastel panther What new toys do you have?
a oled featherwing, metro m0 and metro m4
Nice! UPS just dropped off another Adafruit box for me. I need to see what's in it. ๐
doing a 2.x build on the metro (cause I've already done one successfully on my feather), then 3.0 on the m0, then with any luck 3.0/master on the m4
I'm about to pull the trigger on a j-link as well
If you get the JLink join the crowd figuring out how it works. We're making progress!
nice
Did anyone buy the non-mini edu? I'm thinking of spending the extra bucks to get a bit more speed and processor support
Dan and Scott have them because of the commercial use case. I think the rest of us got the mini.
@pastel panther I'm thinking of getting the non-Edu JLink so I get a full license for the debugger.
@idle owl Bingo. That did it.
Thanks!
G'night @idle owl
night!
@fading solstice Double up-arrow bug confirmed. I'm running: Adafruit CircuitPython 3.0.0-alpha.0-26-g536bcb4 on 2017-10-20; Metro M4 Express
What's the repro?
dear lord, I forgot how much I missed dir() since I left python land for ruby land
import math, dir(math), b=math.cos(1), then double up arrow. It should display "dir(math)" but instead displays "b=math.cos(1)<gibberish>dir(math)"
sure. I'll take a look after I get 3.0 on the m0
Ok. No rush. @fading solstice had asked me earlier to replicate it, so that's what I did. ๐
I'm itching to get the m4 going but I'm trying to be smart and take it step by step rather than jumping to a new branch and board at once
@pastel panther I got 3.0 to compile last night. Trying to work up the nerve to flash it to my M4. ๐
there it goes, I had to get the 3.0 submodules
just doooeeeet
wait, didn't you say you repro'd the bug on a m4 with 3.0? Was that not your build?
@drowsy geyser if so, just save the current uf2, right?
@pastel panther No that was the "latest commit" build as of Saturday evening. I just flashed it with my build from source as of last night.
@fading solstice Also replicated the bug on my build from last night's sources.
@pastel panther MacOS?
ya
See if /dev/tty.usbmodem1412 is there. ๐
I noticed on my Mac that it would often renumber the tty.
no dice
tried that, no luck
I'll try 2.1 again. It will go into bootloader mode so I got that going for me which is nice
Drat. My Mac is dead or I'd try to replicate for you.
yup, that worked, tty.usbmodem1411 shows up after putting 2.1 back on
That's ... unusual.
That is really strange. I guess I've been lucky with my Windows 10 environment so far.
No, I put it on the M4.
If the feather works, I'll try the m4
Ok...
same thing on the feather m0
Huh. Now you have me wanting to build an image for the Feather M0 to see if I can replicate the USB problem under Windows....
Maybe @slender iron can try, since he has a Mac, too.
I mean, it can't hurt to try if you have a board lying around. No rush though
yea, I'll ask Scott tomorrow. Might also poke at the code to see if I can find an idea of what the issue might be
Did you have to do anything special to get 3.0 on the m4? I though I heard of people saying that they had to use bossac
speak of the devil! Hey @slender iron do you know of any trouble loading 3.0 on m0 boards from a mac? On the feather and metro both, my tty.usbmodem1411 disappears after flashing
@pastel panther I've only tried loading 3.0 on the m0 via jlink
@slender iron Ok, I'll poke it with a stick until it gives up it's secrets
dan is looking at the usb stuff more tomorrow too
I definitely saw the incorrect output on the m4
do you thing it's a general thing and not a m4 specifc issue?
it seemed m4 specific to me but I'm not exactly sure
most of the usb stack is shared
where would I look to poke around at that?
ok, thanks
I'm looking at the Circuit Playground Arduino IDE examples with an eye toward reproducing them in CircuitPython, and I'm stumped. One of the audio example sets is a speak-and-spell sort of thing that calls a function CircuitPlayground.say() or somesuch. But when I look in the .h and .cpp files, there's no implementation of .say. Just a bare reference in the header. Anyone got a clue offhand?
Can you point me to the code/example in question?
Hello all โค
er, I just yanked them out of the Arduino IDE and CP library folder, one sec
File --> Examples --> Adafruit Circuit Playground --> Speech, then etc. Talk_US_Male
ah here https://github.com/adafruit/Adafruit_CircuitPlayground/tree/master/examples/Speech/Talk_US_Male
https://github.com/adafruit/Adafruit_CircuitPlayground/blob/master/utility/Adafruit_CPlay_Speaker.h has the reference to the say() function
the matching .cpp doesn't include the string "say"
oh flip, never mind. The code I'm looking for is in talkie.cpp. But I'm not sure where that's included into the sketch
yea, I don't immediately see a refernce to talkie. The sketch compiles though?
Yep. I haven't tested it on the board, though
Let me actually install the SAMD board version and see what that looks like
Now it doesn't compile
#include "sam.h"
^
compilation terminated.
exit status 1
Error compiling for board Adafruit Circuit Playground Express.
That does not seem related
I literally just pulled them fresh. I guess I can try restarting the IDE
Nope, same error
I'm assuming you can't compile blink.ino either?
That would be right
You might try turning on verbose compile output if you haven't already
I would try and find samd.h in your path and verify that it's referencing that dir during compile
There is no samd.h in the Arduino packages\AdaFruit folder
I came to the same conclusion. Sorry, I don't think I'll be much further help
./libraries/asf4/samd21/include/sam.h
./libraries/asf4/samd21/samd21a/include/sam.h
./libraries/asf4/samd51/include/sam.h
that's in Documents/Arduino on a mac, not sure where the windows equivalant would be
It looks like it's an Arduino file that goes missing sometimes. Maybe part of the problem here is that my ArduinoData folder is real old and the IDE has been updated over and over without actually wiping that folder clean
when all else fails, nuke it from orbit and re-install