#circuitpython-dev

1 messages ยท Page 116 of 1

idle owl
#

Ok.

pastel panther
#

@formal plover not unless someone removed it from my machine ;p

umbral dagger
#

OK, as before, CP is running fine, CIRCUITPY shows up, I can screen inm but can't get into the repl

solar whale
#

wow - and it mounts and REPLs on my Mac!

idle owl
#

@solar whale FYI, I ran git submodule etc again in circuitpython/ and it did nothing. So apparently directory doesn't matter

#

Rebuilding after clean anyway

pastel panther
#

@solar whale did you say build in the root directory? There seems to be no Makefile there. ports/atmel-samd built fine though

solar whale
#

@idle owl good to know

idle owl
#

@pastel panther Build in ports, correct.

solar whale
#

@pastel panther build in ports/atmel-samd

pastel panther
#

@solar whale thats what I though. I guess I was confused by an earlier comment

#

+t

solar whale
#

I always do the submodule update at root, but it may not matter

pastel panther
#

I had to to make my build go after the directory shuffle

idle owl
#

Mounts immediately, REPL working, blinky flashing.

solar whale
#

Yay!

umbral dagger
#

@idle owl You're on Mac?

idle owl
#

@umbral dagger Yes

pastel panther
#

hmm, I got mount, blinky but no REPL

#

unless it's changed names. I'm on a mac fwiw

idle owl
#

@pastel panther screen /dev/tty.usbmodem14111 115200

#

The 14111 can be different

formal plover
#

What's displaying for the drive @pastel panther?

pastel panther
#

ya, no /dev/tty.usbmodem14* for me

idle owl
#

That's the issue

#

At least it was still an issue a few hours ago. Something with the way it's handling it, you can't get into the REPL fresh with a code.py running.

#

Also try /dev/tty.usbmodem* .. I had more than one board plugged in earlier so I had to identify them. I was using the * before that.

formal plover
#

@pastel panther Ubuntu right?

tulip sleet
#

@solar whale trying a 2.1 board on Rpi: I don't see a regular ttyACM0 or similar show up. Have you used the REPL from RPi?

solar whale
#

yes - usually works

formal plover
#

screen /dev/ttyACM0 115200

pastel panther
#

@grizzled arch no, mac. No dice after removing any .py from CIRCUITPY and re-flashing

solar whale
#

just a sec - I'll try my 3.0 on mine

formal plover
#

ahhhh ok @pastel panther

pastel panther
#

@formal plover I have no /dev/tty.usb*

idle owl
#

@pastel panther Hmm.

pastel panther
#

@idle owl what version of OSX?

formal plover
#

nvm @pastel panther I thought you were using Ubuntu for some reason

pastel panther
#

(do you have)

idle owl
#

Reflashing the CircuitPython firmware won't clear any .py files anyway, at least it's designed not to.

#

@pastel panther I'm running Sierra

#

10.12.6 apparently

pastel panther
#

yea, I know. I just removed it for extra special forsuresies

idle owl
#

That was a good idea

pastel panther
#

I'm on 10.10 so maybe that's an issue?

#

10.10.5 fwiw

idle owl
#

It took some serious nonsense to get the main.py file removed when I tried to do it. Can you remount it a few times and make sure the files are actually gone? Check in terminal...

pastel panther
#

Also I loaded my bootloader from bossec via instructions from scott, so maybe thats got something to do with it

solar whale
#

@tulip sleet 3.0 works fin on RPi - mounts CIRCUITPY and REPL ay /dev/ttyACM0

pastel panther
#

sure, will do

idle owl
#

Although, eh. no. That shouldn't matter. I could at least get to the serial connection before.

formal plover
#

@pastel panther ls /dev/tty.*

idle owl
#

@pastel panther Check it anyway though, it took me a few tries to get the main.py removed, and I wasn't the only one who ran into that.

formal plover
#

That does a list

tulip sleet
#

@solar whale for some reason not showing up. Tried two boards, so it's someting else. Maybe a misconfiguration in jessie. or something. I should reboot. I did a huge update after several months of non-reuse

formal plover
#

and or ls /dev/cu.* @pastel panther

idle owl
#

@pastel panther Wait does the way you flashed the bootloader affect whether or not you can get a serial connection? You did it differently than we did. I'm starting to speculate here.

pastel panther
#

@formal plover I think I'm good on locating a serial port if it's there. Thanks though

#

@tulip sleet would you know the answer to @idle owl's question?

#

@idle owl @slender iron said it would affect using the jlink but didn't mention anything about the serial port

idle owl
#

Yeah I remember that but I'm now trying to identify what else is different about your setup that might be causing issues.

pastel panther
#

though it does do serial port fu to allow bossac to work, so maybe it's related

tulip sleet
#

@pastel panther @idle owl is question how to remove main.py for sure?

slender iron
#

serial support sshould be fine. though I haven't tested on old mac

tulip sleet
#

i wasn't following the discussion

manic glacierBOT
idle owl
#

No, it's whether the way they got the bootloader setup could affect whether or not it would be able to get a serial connection. We all used the j-link, @pastel panther didn't.

pastel panther
#

@tulip sleet the question is if flashing with bossac could cause problems with my serial port(CDC?) not showing up

#

the wizard says serial support should be fine

slender iron
#

you have any other computers?

tulip sleet
#

@pastel panther I don't think so. Did you unplug/replug just to be sure? Which build is this, the aboslute lateest one with the ports/atmel-samd dirs?

idle owl
#

@pastel panther Also did you try multiple USB ports... so many of us ran into issues there and they were fixed by switching...

pastel panther
#

@tulip sleet yea, about 5 times or so. I'll check another port

#

@slender iron no other computer unless I drive to work and dust off my old windows machine

solar whale
#

@formal plover I was also able to build/load a blinky.ino via arduion to the M4 on my Raspberry Pi! Whew.

pastel panther
#

awesome @solar whale !

slender iron
#

np

formal plover
#

@solar whale YAY!!! Nice! Way to go!

idle owl
#

@solar whale Nice!

tulip sleet
#

try a non-usb3 port if you have one, or a hub. But the difference in MacOS versions might be an issue as well. This is with the m4 board? Do you have other boards with CPy 2.1 or 2.0 that work?

solar whale
#

now to see if I can put CP back on!

tulip sleet
#

@solar whale - yes, I just needed a reboot

solar whale
#

great

pastel panther
#

@tulip sleet I tried both ports, neither work (don't know if one is not USB3 or not). I had blinky/repl working on my metro m0 and feather with 2.1 the other day

#

I'll have to see if I have a usb port

#

hub rather

tulip sleet
#

so just plug in one of the m0 boards and see if ti works, and then we can work forward from that

pastel panther
#

k

#

ok, m0 (I think with 2.1) works as expected, repl, blinky, etc

#

should I try 3.0?

tulip sleet
#

you could try putting a 3.0 build on one of those boards. You can always put 2.1 back. Just build the right board.

#

you can use the uf2 loader to load the firmware.uf2

solar whale
#

whew - taht was odd - when I wen back to linux box with arduino load on M4, I could not get bootloader to mount METROM4Boot - until I rebooted Linux box - then all OK - wa able to reflash CP 3.0 and all happy ...

frail geode
#

loving the swoopy USB traces on the M4 Metro Express!

pastel panther
#

@tulip sleet built 3.0 for the m0 express fine, loaded the uf2 fine but now CIRCUITPY won't ls and there is no serial connection

#

It's hung righ tnow trying to ls

tulip sleet
#

when did you last pull master?

pastel panther
#

like 20 minutes ago?

#

latest commit is d61377

solar whale
#

ohman - I missed somethin I have gd613776

idle owl
#

I have gd613776f0

#

What's the current?

pastel panther
#

d61377 on master, says github

tulip sleet
#

@solar whale that's what gitlog says?? should be dated 17:41:44 today

slender iron
#

the g isn't part of the commit

#

in the version string

idle owl
#

Oh we're looking at different things. Sorry for confusion.

tulip sleet
#

@solar whale btw, your mpy-cross works. will upload to release.

solar whale
#

@tulip sleet that is what th build says - I'm up to date accd to git. - great re:mpy-cross

pastel panther
#

@idle owl if you type git log|head in your CP directory it should tell you

#

should be something like ```commit d613776f0d4215e064964c6838de27e81d4fbcca
Author: Scott Shawcroft scott.shawcroft@gmail.com
Date: Wed Oct 25 17:41:44 2017 -0700

atmel-samd: Add support for ERR_ABORTED to indicate medium not present.
solar whale
#

yup - same here

idle owl
#

Oh. Yep, thanks. We were looking at different things, but apparently they use the same number. The REPL shows the beginning of the commit number.

pastel panther
#

seems useful

#

brb, feeding the hounds and mewbits

solar whale
#

@meager fog I was able to get arduino/samd51 working (at least for blink) on a Rasperry Pi as well. A few minor changes to procedure - I will try to post them to the github repo tomorrow after I do a bit more checkout. So far so good on Ubuntu Linux and Raspberry Pi.

formal plover
#

@solar whale If you switch back to CircuitPython, see if you notice the CPU spike and run high with the M4 plugged in

#

IF

solar whale
#

I have it back on my Linux box. just a sec - want to try somthing on RPi any way

formal plover
#

oh ok, good deal

solar whale
#

pack on Pi - CPU usage goes up to ~40%

formal plover
#

It's not just me!!!

#

Mine went all the way to 80% after like 30mins

#

Then locked up

idle owl
#

Interesting

formal plover
#

๐Ÿ•ต

#

Given I am running pi hole too, but that utilization is usually minimal

solar whale
#

I'v got a few thing running - ddi not drop when I went to bootlaoder but now running ad=rduino so hard to tell

formal plover
#

Yeah, no matter what I had running it continued to rise until I removed it

tulip sleet
#

High CPU is system-udevd; run top to see what's consuming a lot of CPU.

formal plover
#

Fun GUI for high cpu is htop

#

sudo apt-get install htop

#

then just run htop

solar whale
#

just loked at my linux box and top user is systemd-udevd

tulip sleet
#

It might be good if someone were willing to write up this stuff. Perhaps someone running linux could open a linux 3.0 issue on things, and someone running on mac could open a similar issue. If you could write down the steps to reproduce and what does and doesn't work, that would be good.

#

other people could add any variants on the original report

formal plover
#

@tulip sleet Spreadsheet?

tulip sleet
#

I think it's paragraphs

idle owl
#

@tulip sleet Sounds good

tulip sleet
#

include log extracts, etc. if you find something interesting

formal plover
#

stuff like: pro tip, unplug jlink when done using it lol

#

here's htop btw @tulip sleet similar to top, but prettier?

tulip sleet
#

just installed it: I like it gives complete path for process, which is very helpful; thanks!

formal plover
#

@tulip sleet You're welcome!

pastel panther
#

@tulip sleet Would it be worth opening an issue for the stuff I ran into?

solar whale
#

I need to get some sleep - long day tomorrow --- Tahnks for all the great work tonight - I will work on Raspi Pi toolcahin for building CP tomorrow.

tulip sleet
#

I'm writing up an issue right now for the Linux problems. I think it would be good to document it, especially since you're on an older but maybe not uncommon Mac veresions.

#

@solar whale I ran into problems running the .sh files in the arm download ./configure failure late in building pre-reqs. But I don't need it right now.

#

good night!

pastel panther
#

Night!

idle owl
#

@solar whale have a good night and day tomorrow!

glacial bronze
#

I did a little exploratory hacking to see how feasible it was for me to write example programs and I was able to get a functioning tachometer on the CPX using just the REPL. That's hecka neat. I think I actually will be able to contribute meaningfully.

idle owl
#

@glacial bronze That'll be great!

glacial bronze
#

Well, 99.9% credit to the author of the Arduino version. Brilliant to use the neopixels as a flashlight plus the light sensor

formal plover
#

@glacial bronze I second @idle owl's comment

#

๐Ÿ˜ƒ

pastel panther
#

@glacial bronze You seem to have had the same experience I did the other day, working on my led matrix. It was just working before I knew it.

#

If you've never used one before it's easy to not understand how awesome a REPL can be

#

I've got some ideas in mind for how to make them more awesome, taken from some Ruby REPL enhancements I've seen, though memory might be an issue. We'll see.

glacial bronze
#

A solid utility would be the ability to save the REPL session to a file

pastel panther
#

๐Ÿ˜‰

#

even cooler would be an editor but that's probably asking a bit much

glacial bronze
#

Yeah. More fully featured interactive editors like bpython can really chug even a Raspberry Pi type system

#

if the code gets complex enough

#

but really you program CircuitPython hooked up to a computer in any event, you don't really need an on-board editor

manic glacierBOT
#

Commit: d613776f0d4215e064964c6838de27e81d4fbcca
Ubuntu 16.04
Metro M0

With this build, CIRCUITPY appears and the REPL works. However, the second disk that does not exist stills seems to be causing problems. After a time, CPU consumption of /lib/systemd/systemd-udevd and /usr/lib/udisks2/udisksd rises dramatically, and the errors below are repeated in syslog many times. E

Interestingly, if the board is unplugged, the cpu consumption of the processes above rises even higher. Even...

pastel panther
#

it would be an interesting exercise to see how small you could get. Theoreticaly your edior buffer could be dynamically sized to not waste memory, but overhead from the editor itself... I have no idea what would be involved

#

When I have some free time I might start poking around to see what super simple editors are out there. Probably would have to be written in c

glacial bronze
#

FWIW I Googled up a lightweight DOS text editor and it's 80 KB with a 64 KB filesize limit. Nano is ~2 MB

pastel panther
#

nice

manic glacierBOT
manic glacierBOT
slender iron
#

anybody around to test?

pastel panther
#

yes-ish

#

I'm here but I'm not sure if my buggy state will help

manic glacierBOT
slender iron
#

@pastel panther do you need a uf2 to test with?

pastel panther
#

@slender iron yes, please

slender iron
#

k 1 sec

#

I think itd your buggy state I'm trying to fix

pastel panther
#

weeee

slender iron
#

linux happiness

pastel panther
#

? I'm on a mac

slender iron
#

ah ok

#

still worth a shot ๐Ÿ˜ƒ

#

any luck?

pastel panther
#

loads, mounts CIRCUITPY, binky works, no CDC

slender iron
#

hrm ok

pastel panther
#

let me try another port

slender iron
#

nothing prints at all?

#

dmesg say anything useful?

pastel panther
#

nothing shows up like /dev/ttymodem

#

let me see

#
       0        0 AppleUSBCDCACMControl: getFunctionalDescriptors - Descriptors are incorrect, checking...
       0        1 AppleUSBCDCACMData: start - Find CDC driver for ACM data interface failed
       0        1 AppleUSBCDCECMData: start - Find CDC driver for ECM data interface failed
AppleUSBCDC: Version number - 4.3.2b1
Google Chrome He (map: 0xffffff80329241e0) triggered DYLD shared region unnest for map: 0xffffff80329241e0, region 0x7fff89200000->0x7fff89400000. While not abnormal for debuggers, this increases system memory footprint until the target exits.
USB (XHCI Root Hub USB 2.0 Simulation):Port 1 on bus 0xa connected or disconnected: portSC(0xe0206e1)
USBMSC Identifier (non-unique): 0x239a 0x13 0x4201
         0 [Level 5] [com.apple.message.domain com.apple.commssw.cdc.device] [com.apple.message.signature AppleUSBCDCACMData] [com.apple.message.signature2 0x239A] [com.apple.message.signature3 0x13]
AppleUSBCDCACMData: Version number - 4.3.2b1, Input buffers 8, Output buffers 16
AppleUSBCDC: Version number - 4.3.2b1
slender iron
#

ah interesting. I wonder if its a driver issue

#

is it possible for you to upgrade the OS?

pastel panther
#

Yea, I suppose so. I've been meaning to do so but is having someone on an older version to test useful?

slender iron
#

thats true ๐Ÿ˜ƒ

#

not sure its something we can fix on our end though

pastel panther
#

I'm not in a hurry (to upgrade or have a working M4) so if it's useful I can stay

#

Is ASF4 doing something different that needs a better/newer/faster driver?

slender iron
#

ah, the old one works?

#

then we should be able to fix it

#

my brain isn't working so well

pastel panther
#

Yea, 2.x works fine

slender iron
#

kk, yeah stay so you can test

pastel panther
#

Err, I haven't tried it on the m4

slender iron
#

may need to get you some more testing gear

#

the uf2 I sent was for the m4

pastel panther
#

it's not m4 compatible, is it?

slender iron
#

2.x isn't

pastel panther
#

right

#

What else did you have in mind for testing?

slender iron
#

usb sniffer

#

the beagle 12

pastel panther
#

I have a logic8 if it's of any consequence

#

Though I'm not so sure it would know what to do with usb. Isn't it high-ish speed differential?

slender iron
#

those are awesome for other protocols

#

its 12mhz differential

#

I have some tooling and workflow for the beagle

#

we can hook you up with one if we need to

pastel panther
#

I will not turn away any tools that show up at my house ;P

slender iron
#

cool, well thanks! I'm off

pastel panther
#

night

hollow tartan
#

@solar whale still having trouble with chef (i think) on ubuntu 14

#
$ vagrant ssh
ssh_exchange_identification: read: Connection reset by peer

William@Magnificat_V2 MINGW64 ~/esp8266-micropython-vagrant (master)
$ vagrant ssh -v
Vagrant 1.9.7

William@Magnificat_V2 MINGW64 ~/esp8266-micropython-vagrant (master)
$ vagrant ssh-config
Host default
  HostName 127.0.0.1
  User vagrant
  Port 2222
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile C:/Users/William/esp8266-micropython-vagrant/.vagrant/machines/default/virt
ualbox/private_key
  IdentitiesOnly yes
  LogLevel FATAL
pastel panther
#

you're having issues sshing in?

hollow tartan
#

@pastel panther I did a uninformed upgrade of the ubuntu from v 12 to v14., apparently shot myself in the foot.

pastel panther
#

@hollow tartan would it be to hard to just start over?

#

+o

hollow tartan
#

not hard, just time consuming

#

vagrant destroy un does everything

pastel panther
#

then takes a while to re-provision?

#

I forgot the exact syntax but if I recall, the first time you set up you have to download and install a bunch of stuff

hollow tartan
#

do you use vagrant and virtual box on a windows machine?

pastel panther
#

I've only used it on mac and it's been a while.

#

What windows version?

hollow tartan
#

7

#

pro

#

oh I got it to compile micropython and the bin works.

pastel panther
#

that's cool

#

before or after it got borked?

hollow tartan
#

before, of course

pastel panther
#

(thought you might have un-borked it)

#

Did you have to do much setup for the dev environment after you got vagrant up?

hollow tartan
#

ah, yeah, the whole gcc compiler

pastel panther
hollow tartan
#

yep, that is the one.

pastel panther
#

it might suck but I'd suggest starting from scratch.

hollow tartan
#

I am going to bed soon. thanks for chatting.

pastel panther
#

fwiw the author of the vagrant is @timber lion

#

sure thing

solar whale
#

@hollow tartan I think he correct way to update the Ubuntu release from 14.04 to 16.04 is to reinstall the vagrant box and change the line in Vagrantfile from ``` config.vm.box = "ubuntu/trusty64"
to
config.vm.box = "ubuntu/xenial64"

hollow tartan
#

@solar whale Hello. I backed up and chose Vagrant 2.0 to get Ubuntu R14. 4 . So I have a Vbox with what you have and I am trying to get gcc and xtensa-lx106 playing nice together, so it will build a loadable bin.

#

my $PATH has an ESP32 reference. is that correct? I think I noticed it yesterday when I had R 12 running good.

solar whale
#

@hollow tartan ok - good luck - I to sounds like you are building microoython at this time. Do you then plan to move to circuitpython as well?

#

@hollow tartan ok - good luck - I to sounds like you are building microoython at this time. Do you then plan to move to circuitpython as well?

hollow tartan
#

yes, definitely and then to the M4 , I hope.

#

you got one didn't you?

solar whale
#

yes I did. lots of fun ๐Ÿ˜‰

hollow tartan
#
make axtls
make```
#

is blowing up

#

the /esp8266 it is looking for is actually /ports/esp8266

#

and the xtensa-lx106-gcc is not being found!

#

good night, leave any thoughts you have and I will read tomorrow. blinka

solar whale
#

@obsidian helm It does llok like the master buil at mircropythoin has also changed to but esp8266 in ports so yes - that is the way to build it. Not sure what the issue with xtensa is. - you shoudl; execut the make axtls in ~/micropython/ports/esp8266 . just curious Are you following this guide? https://learn.adafruit.com/building-and-running-micropython-on-the-esp8266/micropython-usage?view=all Of course there are many ways to do this,I'm just trying to follow along with what you are doing.

How to compile and install MicroPython for the ESP8266 WiFi breakout!

solar whale
#

@slender iron @tulip sleet just a sanity check - It looks like the 2.x build did not migrate to the new repository layout, correct? Tha is 2.x does not hac the ports folder. It gets a bit confusing when you switch between branches. if I go from 2.x to master, then the top level atmel_samd folder is still there along with others. Is there a simple way to get git to remove all the unused subdirectories when you switch branches. I think it is jsut git submoule update --init --recursive to make sure they are properly reinstated after a switch but that does not remove the unused ones. Not a big deal, just wondering if there is some git magic I should know.

drowsy geyser
#

Thaks for the reminder, @solar whale ! I did a pull this morning and the build was failing. I hadn't looked closely at it because I'm working on the multi-repo "Pulse"-like Python program that Scott wanted, but git submodule update --init --recursive fixed it....

stuck elbow
#

the metro m4 just arrived

#

I will do science to it

#

I was able to attach gdb to it with the black magic probe

#

now I have to learn to use gdb...

solar whale
#

What could go wrong?

stuck elbow
#
Attaching to Remote target
warning: while parsing target memory map (at line 1): Required element <memory> is missing
warning: No executable has been specified and target does not support
determining executable automatically.  Try using the "file" command.
0x000055cc in ?? ()
(gdb)
solar whale
#

are you trying to load the bootloader?

formal plover
#

Thank you @tulip sleet for attacking those high CPU problems so fast! I guess it's a Linux problem not specifically Linux on the Pi. I'll write up some of the other stuff like making sure you don't have too many other things plugged in via USB and what not, in a document like you suggested.

umbral dagger
#

@solar whale Re the esp breakout guide. Cool! I just got one of these to play with CP & IO. No idea what Iโ€™m going to do yet.

#

Ok... adequate caffeination level achieved. Time to try the latest CP on M4.

solar whale
#

Is that the ESP8266 or esp32?

umbral dagger
#

@solar whale 8266

solar whale
#

OK - I can help with that if you have questions - dont have any esp32s

manic glacierBOT
solar whale
#

@umbral dagger when you start playing with IO, my main warning is put in some checks for failed connections. I try twice then reset the board if it still does not connect. That usually gets it back.

manic glacierBOT
tulip sleet
#

@solar whale to remove stuff that isn't in a branch, you can use git clean -f. (It requires the -f because you could be removing stuff you want to keep.) git clean --dry-run (aka -n) will tell you what it will do to make sure. git help clean.

solar whale
#

@tulip sleet thanks!

tulip sleet
#

i have used it mostly up to now to clean up .orig etc. after fixing merge conflicts.

solar whale
#

Sounds good - just makes it very imoprtant to do a git submodule update every time you switch braches!

tulip sleet
#

yeah - I actually now have two clones for convenience, one for 2.x and one for master

solar whale
#

probably the smart way to go...

formal plover
#

@tulip sleet @solar whale, you guys sleep at all?

#

Lol

solar whale
#

sleep is overrated ๐Ÿ˜‰

formal plover
#

Haha true true @solar whale

solar whale
#

@tulip sleet On the Pi - I tried apt-get install gcc-arm-none-api - installs all the right stuff, but it is an old gcc and fails the -lto stuff so it looks like a manual build is necessary. I thought I had done it inthe past, but it may have only been for the esp8266 under micropython - different tools....

umbral dagger
#

@solar whale I grabbed the toolchain from ARM's site

solar whale
#

@umbral dagger - for Pi? can you post alink?

umbral dagger
#

@solar whale a little more work to install, but it's the latest. That was for Ubuntu on intel

solar whale
#

@umbral dagger I don't see an ARM build there but should be able to build it from the source - thanks

umbral dagger
#

With a fresh pull & build on linux I still can't get the repl. CP runs, main.py runs, led blinks (main.py is blinking & printing), CIRCUITPY shows up, screen connects and I get output from main.py.

solar whale
#

@umbral dagger have you tried removing the main.py - just to see if you get to REPL

umbral dagger
#

Oh ya.. that works immediately.

#

And if I put it back, everything works great

#

I can reload, then get back into the repl no trouble.

#

So it looks like an initialization issue. It's like main.py starts before the usb/serial thing is up & running

solar whale
#

so it is only a proble if you boot with a main.py in place?

umbral dagger
#

yes

#

I just tried that. resetting with an empty CIRCUITPY lets me drop into the repl

solar whale
#

It might be good to add that to the github issue that Dan has open for linux.

formal plover
#

Yeah like @solar whale watch out @umbral dagger the M4, cranks up CPU usage

#

Just by being plugged in

manic glacierBOT
#

What I'm seeing on Ubuntu 17.04 with Adafruit CircuitPython 3.0.0-alpha.0-1031-gee18b5cba on 2017-10-26; Metro M4 Express with samd51j19

If the board is reset with code in main.py, etc CIRCUITPY shows up, the code runs (in my case it blinks the LED and poutputs some text), the led blinks, and when I connect with screen I see the text. I cannot get into the repl, though.

If I then (from a terminal) remove the code on CIRCUITPY, I can get into the repl without problem. If I had tried to ...

tulip sleet
#

I think this morning's ee18b5ca commit fixes the CPU usage issue. I have not seen it after that. However @dastel's note above documents a continuing issue.

#

will be off line for an hour or two

umbral dagger
#

@tulip sleet @slender iron It's as if (or really is) the USB input processor doesn't have a chance to finish initializing before code starts running, and gets preventing until code stops running.

#

@tulip sleet @slender iron Updated my comment to include the case where main.py does NOT loop forever.

fading solstice
#

how do we build circuitpython now?

solar whale
#
git submodule update --init --recurstive
cd ports/atmel_samd
make BOARD=desiredboard clean
make BOARD=desiredboard
fading solstice
#

ok thanks

solar whale
#

taht is for 3.0 - for 2.x omit the ports/

fading solstice
#

i was looking to build 3.0

manic glacierBOT
#

@dhalbert SD cards are never mounted when usb is inited because they currently require the Python VM. So, by supporting removable media we should be able to dynamically make it available.

@dastels that will still have the misleading inquiry response. try it with this latest commit. On my Arch linux box I see a warning about unable to get the write protect bit and the cache but it works otherwise.

#

Yes please. :-) Limor just tweaked it.

On Thu, Oct 26, 2017 at 9:11 AM Carter Nelson notifications@github.com
wrote:

Hmmmm. Maybe back to lux instead of light?
c966976
https://github.com/adafruit/circuitpython/commit/c966976591f6397eaa7821e00a51ad20fe8ae544

โ€”
You are receiving this because you commented.

Reply to this email directly, view it on GitHub
https://github.com/adafruit/circuitpython/issues/314#issuecomment-339717740,
or mute the thread
<https://github...

tidal kiln
#

question on updating something in the bundle. did this originally to get it:

  1. worked in personal repo
  2. personal repo forked into adafruit
  3. made pr on adafruit fork to get into bundle
  4. bundle now has adafruit fork
#

now if i need to update my code, what's the process?

manic glacierBOT
manic glacierBOT
#

Iโ€™ve been testing 3.0/master on a M4 with my early 2015 MacBook Pro 13 Retina running Yosemite. My M4 bootloader was flashed with BOSSAC with a .bin provided by @tannewt.

Hereโ€™s what Iโ€™m seeing with the current master and a build @tannewt sent last night around 9pm:
No /dev/tty.usbmodem* when the M4 is plugged in
CIRCUITPY mounts and is accessible
a code.py blinky in CIRCUITPY will run when written or reset
removing code.py or any .py in CIRCUITPY and resetting/powercycling several tim...

pastel panther
#

@tulip sleet finally got around to filing the ticket, sorry for the delay

tulip sleet
#

@tidal kiln maybe fork a new personal repo from the adafruit one and then delete the old personal one. That will normalize the workflow so your personal one is downstream from adafruit/. To make a change, create a branch in the personal repo for this change, make the change, commit and push it. Then you'll probably see a pull request button both in the adafruit and your repo (you can always create one manually). This is how we normally do it in CPy: Scott and I work in personal repos on temporary feature or bugfix branches, then submit PR to adafruit/circuitpython. When accepted, we delete the temporary branch. When the PR is accepted, in the personal repo, we do git fetch upstream, then git checkout master [if necessary]; git merge upstream/master, and then push to the personal repo so it's sync'd with adafruit.

tidal kiln
#

@tulip sleet thanks. that was my thinking as well.

#

but wanted to make sure before i nuke my original repo

umbral dagger
#

@slender iron pull & rebuilt & flashed. Same behaviour.

tulip sleet
#

Scott likes to name the upstream remote as adafruit instead of upstream, so the source is clear. I haven't started doing that consistently yet; I have muscle memory for upstream.

tidal kiln
#

i name my remotes after power puff girls ๐Ÿ˜€

slender iron
#

@umbral dagger I think @tulip sleet is right that we're not handling ctrl-c correctly

#

what should I do with text typed while main is running? save it for the repl or ignore everything but ctrl-cs unless input is going?

pastel panther
#

If it's being echo'd, I would say save it. Otherwise ignore it

tulip sleet
#

I think you should flush everything before the ctrl-C. That's how it works in regular Python and in a shell.

pastel panther
#

I think the friendlyist thing would be to save it but make it very clear that it won't do anything until you stop main

#

Also consitency with @tulip sleet 's comments would be good

tulip sleet
#

just tried it while True: pass, then abc<ctrl-C>. abc is echoed but not taken as input

#

in python3

slender iron
#

ah ok

tulip sleet
#

are you looking at the lack of interrupt of main.py or should I look at that?

slender iron
#

i am

#

though you can if you like

#

I can look at descriptor stuff

#

it should be fiixable in circuitpython code

tulip sleet
#

I'll look briefly. was going to compare it with 2.x. Descriptor - you mean the duplicate disk name stuff? not sure

slender iron
#

2.x is different because it caches the usb input in an interrupt

#

right now we only read from cdc when usb_read is called

tulip sleet
#

if you're on a roll go ahead. I can finally get to busio and analogio. but if you have something else, i can look too.

#

can the interrupt handler peek without reading? I know right now it has a one-char rollback, I think

slender iron
#

the only interrupt we get currently is the complete callback after we initiate a read

#

go ahead and take a look. I'll fix asf4 some more ๐Ÿ˜ƒ

tulip sleet
#

k๐Ÿ˜

slender iron
#

I gotta go help a friend for a bit in two hours too

tulip sleet
#

i did my outside IT support this morning (plus groceries), but i'll be out at dinner time

slender iron
#

kk, no worries. I'm just happy we aren't heating up linux boxes now

idle owl
#

Always a good thing

umbral dagger
#

I'm out for the evening, but will be here for another ~3 hrs, then probably back for a while at 10pmish ET.

pastel panther
#

I'll be in a superposition of work and discord. Observations may affect my postition.

formal plover
#

@slender iron what's wrong, don't like baked Pi? Bwhaha oh man where's @cunning crypt ?

cunning crypt
#

Mmmm pie

tidal kiln
#

huh. apparently hacktoberfest checks constantly, not just at end of contest. just got notice i made it!

slender iron
#

yay!

formal plover
#

That's awesome @tidal kiln!

tidal kiln
#

most of them were me fixing my own messes, but guess a pr is a pr

slender iron
#

yup yup

tidal kiln
frail geode
#

the shirt is cute again this aeyr

#

2 year's ago was the best, I think

pastel panther
#

Hmm... now I'm inspired

idle owl
#

@tidal kiln My shirt's already ordered too!

manic glacierBOT
manic glacierBOT
formal plover
#

So is the UF2 that doesn't drive up the CPU on Linux on the GitHub? I've just been grabbing them here when someone posts an update.

slender iron
#

the s3 bucket should have one

tidal kiln
#

@drowsy geyser willing to share your onenotes? (for m4)

#

s3 bucket? where is that?

slender iron
#

(its in the readme)

tidal kiln
#

ah. got it. first time even looking in the continuous builds. neat.

slender iron
#

๐Ÿ‘

drowsy geyser
#

@tidal kiln Yes, of course! I'll clean up a few inconsistencies and update for the new build tree structure, then move them to a public notebook and send you a link!

tidal kiln
#

cool thanks. i'm only just now getting a chance to go hands on. so i'm like at t=0

drowsy geyser
#

No worries!

#

There are two notes pages there - Installing Debugging Components, and Compiling

tidal kiln
#

seeing this first page at least.

#

wait. learning the ui...

#

left tabby. got it.

drowsy geyser
#

Sorry about that....

tidal kiln
#

cool. yep. seeing it.

#

thanks. will give this a read.

drowsy geyser
#

Cool! I hope it's helpful.

#

Oh, I should have said the commands are for UINX-like systems (MacOS, Linux, Windows 10 Bash environment).

formal plover
#

That'd be helpful to anyone working with the M4 @drowsy geyser.

#

Good stuff

drowsy geyser
#

Thank you, @formal plover ! It's really just notetaking of how I got it working. Most of which is other peoples' advice!

formal plover
#

@drowsy geyser you're welcome! I need to make something like that for tracking issues per @tulip sleet's suggestion

drowsy geyser
#

Oh? The "issues" link in GitHub isn't sufficient?

pastel panther
#

I was about to say the same thing

#

Though it would be nice to have a breif summary like

  • OSX no serial console
  • RPi: CPU is a toaster
  • Windows: bla bla
#

Something like that would be useful as a pinned post

drowsy geyser
#

That's true. There may be more information we want to capture that would clutter up the issues page. Namely, historical information.

formal plover
#

Yeah at least for where things are with the M4 right now @drowsy geyser

idle owl
#

Learned today that an older CPX might not communicate consistently with a newer CPX over IR. I noticed the transmitters were different on the two I have, but figured they would operate the same. Apparently not. Figured it out with MakeCode, but I imagine it might happen with CP when we get to it.

drowsy geyser
#

@formal plover I'm working on the "Insights"-like program for Scott. It will generate statistics across multiple repos and sub-repositories. Since it's going to use the GitHub API (GraphQL) it might be handy for your task, too.

formal plover
#

Once things go out of alpha, might not need it anymore.

#

@drowsy geyser nice! I saw some discussion on that. Are you using the GitHub API?

drowsy geyser
#

@formal plover Yes. There's an interface library called Graphene that abstracts away all the JSON query construction so you don't have to write code to do it!

formal plover
#

@drowsy geyser that's fly

#

Well I'm excited to see the end results!

#

Keep up the good work @drowsy geyser!

slender iron
#

I'd like to keep the issues list as the location for port status

drowsy geyser
#

Trying to stay focused! ๐Ÿ˜ƒ My new desktop system for a Linux build is arriving by FedEx today. Must not get distracted by that.

#

@slender iron That makes a lot of sense.

idle owl
#

@drowsy geyser Or you should totally get distracted by that ๐Ÿ˜ƒ

drowsy geyser
#

I'm really anxious to try the JLink on Linux and see how it is....

formal plover
#

@drowsy geyser worked find on my Pi

#

Needed to apply the 99 rules file so that it could communicate, that wasn't hard.

#

It was in the readme

drowsy geyser
#

Cool. Thanks!

formal plover
#

You're welcome!

#

@pastel panther are you working on your M4 yet? Or do you still need more info to get started?

tidal kiln
#
Could not connect to target.
Please check power, connection and settings.
#

see note on power issue...anyone got it to work with pwr through usb?

formal plover
#

@tidal kiln what are your settings? I got it to work fine that way

#

Wait you're trying to connect via jlink right?

tidal kiln
#

yep.

idle owl
#

@tidal kiln Yeah I did. I don't have a 9v power supply.

tidal kiln
#

i'm powering through USB, but with an AC adapter

idle owl
#

I'm on MacOS but I used the JLinkExe commandline util.

#

That's what I did for jlink stuff. Powered USB from a wall plug... 5 port wall adapter thing.

tidal kiln
#

above was from JLinkGDBServer

formal plover
#

Device is named properly? Speed is correct?

#

All that jazz?

idle owl
#

I don't think I got that to work. Did you install the other tools you needed? gcc-arm-blah or something....

formal plover
#

Oh, I've been using jlink exe

idle owl
#

Seriously, we're just going down the list of stuff we ran into.

tidal kiln
#

ha! wait. it can't just read the silk on the chip.

#
Connecting to target...ERROR: No CPU core or target device has been selected. Please make sure at least the core J-Link shall connect to, is selected.
idle owl
#

What command are you using

tidal kiln
#

JLinkGDBServer

slender iron
#

JLinkGDBServer -if SWD -device ATSAMD51J19

idle owl
#

^^

formal plover
#

Yeah I was totally going to say that @slender iron

#

๐Ÿ˜‰

tidal kiln
#

so it CAN'T read the silk. ok.

#

that worked.

Listening on TCP/IP port 2331
Connecting to target...Connected to target
Waiting for GDB connection...
#

yeah. i'm where everyone was 3 days ago!

formal plover
#

Yay! Better late than never @tidal kiln!

idle owl
#

Yeah!

tidal kiln
#

darn. and now gotta run.

#

back later...

#

should this have functional firmware on it? or is that first step?

idle owl
#

First step

tidal kiln
#

excellent. thanks.

#

๐Ÿ‘‹

pastel panther
#

@formal plover I have an open issue with my status. @slender iron is looking into it

slender iron
#

yeah, I'm redoing all of the descriptor stuff

formal plover
#

@pastel panther ah gotcha. Good deal. Just wanted to make sure you weren't left hanging

pastel panther
#

Nope, I'm good, thanks. Just have to figure out why my metro m0 doesn't want to talk to my SPI led matrix

formal plover
#

You're welcome. Hmm running 2.1?

#

Is it a wing? Or a DIY matrix?

tulip sleet
#

I have some fixes so you can ctrl-C main.py. Tested on Metro M0. The REPL exits every 30 seconds unless I only enable one MSC device (with mscdf_init(0);). Then it's fine. @slender iron I can make a PR for this as an intermediate step. OK by you in your progress?

#

aaah doesn't work compiled with optimzation. not yet...

pastel panther
#

@formal plover It's a matrix I got from the SparkFun dumpster dive. It was previously working fine with 2.1 on my feather m0 express. It may well be a wiring issue. I'm sure I can figure it out.

formal plover
#

Wait, the Metro classic runs CircuitPython?

pastel panther
#

I don't think so, i was just using it as a reference for the pins

umbral dagger
#

@drowsy geyser What'd you get for a Linux system?

drowsy geyser
#

Just a cheapo refurbished system from NewEgg. Nothing special. I didn't want to get a top end powerful system because I want to spend that money on a NAS.

tulip sleet
idle owl
#

@drowsy geyser That's the beautiful thing, though, it'll work great

drowsy geyser
#

Yup! It'll be great running Linux.

#

If I need power these days I just use a cluster at work. ๐Ÿ˜ƒ

umbral dagger
#

@drowsy geyser After close to 15 years of buying Macs I was amazing how cheap it was to put together a top end Linux system. Granted, I'm just using the onboard video (which is pretty in line with Apples video choices).

#

@drowsy geyser There's always AWS or Azure if you need the power.

drowsy geyser
#

@umbral dagger I work at Microsoft, so I have literally thousands of cores of compute available.

umbral dagger
#

@drowsy geyser Ya, I saw that.

formal plover
#

I'm half asleep lol, hang on

#

I was thinking outloud and was comparing them.

#

The feather m0 and metro m0

idle owl
#

@formal plover I read that as fell asleep. And the rest made half as much sense, but was twice as hilarious.

formal plover
manic glacierBOT
#

Read USB input as a background task when the interrupt character is enabled. The interrupt character is already handled in the course of doing input. All input is flushed when interrupt character is read, and a KeyboardInterrupt exception is raised at the next safe time.

Tested on Metro M0 under Linux: main.py contains a blinky program
Reset board. Enter repl. Type ctrl-C.

Not tested on MacOS.

This works most of the time. When it doesn't work, it appears to be because there's s...

glacial bronze
#

bitmapfont.py can be in /lib/ but if the font.bin is there, it won't be seen and init() will fail on line 28

#

putting the .bin in device root works

tulip sleet
#

@glacial bronze This can be fixed by using BitmapFont(..., font_name='lib/font5x8.bin') as well. Also, we could change the code to look at bitmapfont.__file__. That returns the path to where the module was imported from. Feel free to submit an issue on the library.

glacial bronze
#

I still haven't figured out GIT. It's on my to-do list for tomorrow night :v

tulip sleet
#
pastel panther
#

@formal plover @tulip sleet Thanks for your help. I think that diagram is just wrong. I just looked at the board and SPI only goes to the header and not to any of the other pins

tulip sleet
pastel panther
#

On the otherhand I think I made a boo boo with the MetroWing

#

Yea, I just looked at the board for the m0

tulip sleet
#

The Metro 328 has a tilted CPU chip and doesn't say Express. The Metro M0 express has a straightened chip and says Express. The M4 has a tilted chip and says Express. This is kind of like which is the Biscayne, which is the BelAir, and which is the Impala.

pastel panther
#

Yea, I know. I just ended up with that diagram as I didn't see anything similar for the m0 express and I mistakenly thought they were the same

tulip sleet
#

(Our family had two of those Chevy's, vintage 1963 or so)

pastel panther
#

Nice!

tulip sleet
#

two-speed automatic, about 9 mpg

pastel panther
#

mpg is overrated when you're rollin' in style ;P

#

My friend in HS had a super sweet 72 Malibu that we would drive around in all the time when we should be doing something more productive

tulip sleet
#

my father had to install aftermarket seatbelts to get any at all. The dashboard was metal. Roomy inside, enormous trunk. ... I'm getting punchy, need to say goodnight!

pastel panther
#

Night!

pastel panther
#

note to self: printing to the console can be as effective as a sleep at slowing down your code

#

@slender iron is SPI working as expected on the M4?

slender iron
#

nope, its not implemented yet

#

you shouldn't be able to import busio

#

dan and I are still in USB land

pastel panther
#

Ok. I can't currently tell if it's importing because of the CDC issue

#

Is there a general roadmap of features that need to be implemented for 3.0 to be ready for release?

slender iron
#

yeah, its the 3.0 beta issue then the 3.0 ones

#

they aren't well sorted though

#

busio will come after USB has settled down since it enables the spi flash

pastel panther
#

ok, cool

slender iron
#

I'm brewing up some awsome stuff for usb I think

#

hopefully get to the point where we can change the usb funcitonality enabled in boot.py

pastel panther
#

ooooooh

#

I'm eager to see how that works. I've been watching the commits to get a better idea of how the code is working.

slender iron
#

working on a python script to generate the descriptors to be built in with the idea that it can be used in boot.py later

pastel panther
#

cool

slender iron
#

if you have code questions feel free to ask. I'm happy to point you places

pastel panther
#

Will do. I think I could get a decent lay of the land if tracing paths wasn't such a chore. I'm still haven't loaded the code in something that can index it for me yet to make finding function definitions a bit easier.

slender iron
#

yeah, I'm low tech and use ag which is essentially grep

pastel panther
#

aaaand now I have cat lap

#

I use RubyMine for work stuff and it's spoiled me

slender iron
#

yeah, I should probably figure something out to do that

pastel panther
#

I've been trying out Atom and I think it has a ctags package so I might try that next

#

huh, apparently it has ag support with the atom-codesearch package

slender iron
#

huh, interesting

#

the tab management in atom kills me

pastel panther
#

also a couple other search engines in the same package

#

Yea, I'm a bit annoyed with that so far. They seem to be reproducing on their own

slender iron
#

yeah, I tried sublime and it had the same problem

pastel panther
#

Hmm, apparently JetBrains has CLion. I'm downloading it now in hopes it's similar to Rubymine

timber mango
#

hey guys, so i'm new here. So this dischord thing... is sort of like an IRC right? and if i have any qns i just write it here? is that how it works?

slender iron
#

@timber mango yup! questions on circuitpython go here. Anything that doesn't fit another channel can go in #general-tech

timber mango
#

ok i have a little qn. i don't have my circuit python with me now, but awhile ago. and my baby girl threw it around for a bit . Then i'm having problems uploading code. So i double clicked the btn to go into bootloader mode.(red light blinks) Previously new code used to be able to be uploaded. but recently uploading code seems impossible as the arduino ide just gets stuck at uploading and it remains like that for a minute or so.... after that erroring out

slender iron
#

@timber mango do you mean circuitplayground? the round board?

timber mango
#

ah yes ciruit playground

#

round and black ... the circuit playground classic.

slender iron
#

ok, I know less about the classic

#

I'd suggest posting on the forums if you haven't already

#

?forums

digital shoreBOT
slender iron
#

there are folks there who know arduino better than I do

timber mango
#

oh dear... ok i mistook circuit playgrd for circuit python

#

ok thanks anw @slender iron

slender iron
#

no worries! we all do it @timber mango

solar whale
#

@tulip sleet built latest CP 3.0 Master loaded to M4 and connected to Linux box - running cool and no 100% udevd processes! Thanks!

formal plover
#

@solar whale glad to hear that. I'll have to give it a try this weekend.

solar whale
#

Notice an interesting quirk - If you have the board runnig on 9V and disconnect from USB, then reconnect - it bring usp CIRCUITPY but cannont connect to REPL unless I reset the board. Same happen on Mac - I suppose this makes sense since the CP board is not RESET so it does not initialize the conenction for the REPL

#

@formal plover I'll be happy to help you with Arduino any time as well. I hope to have my notes written up today.

formal plover
#

@solar whale Awesome, thanks! We'll have to devise a plan for testing. Lady Ada said it's more stable than CircuitPython

solar whale
#

@formal plover seems to work well and seesm to support many I2C devives with no problems

solar whale
#

hmm - did somethig change regarding I2C on 2.1 with 2.1 Bundle- whwnever I try to init an i2c device, I am getting ```>>> import mpr121test
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "mpr121test.py", line 19, in <module>
File "libraries/drivers/mpr121/adafruit_mpr121/mpr121.py", line 52, in init
File "libraries/helpers/bus_device/adafruit_bus_device/i2c_device.py", line 60, in init
File "libraries/helpers/bus_device/adafruit_bus_device/i2c_device.py", line 58, in init
File "libraries/helpers/bus_device/adafruit_bus_device/i2c_device.py", line 56, in init
ValueError: Buffer must be at least length 1

#

this is on a metro_m0_express Adafruit CircuitPython 2.1.0-3-gbd7abcd on 2017-10-27; Adafruit Metro M0 Express with samd21g18

solar whale
#

appears to be a bug in i2c_device but I am not sure when it was intrduced. Has anyone been able to use an I2C device with 2.1.0 and the 2.1 Bundle?

tulip sleet
solar whale
#

it is in i2c_device.py

#

@tulip sleet I was jsut looking at the issue - but the error is in the i2c_device.py - part of bus_device in the Bundle.

#
        # Verify that a deivce with that address exists.
        while not i2c.try_lock():
            pass
        try:
            i2c.writeto(device_address, b'')
        except OSError:
            raise ValueError("No I2C device at address: %x" % device_address)
        finally:
            i2c.unlock()

        self.i2c = i2c
        self.device_address = device_address
#

should this be changed to write b'\0' ?? I think the write is just tsting for "aliveness"

tulip sleet
#

@solar whale ah, so it's testing whether the device is there by writing b''. Maybe there's a different way to do that.

solar whale
#

it breaks all I2C examples I have

#

@tulip sleet would it be safe to just write a b'\0' is that the correct sytax to write a zero?

tulip sleet
#

@solar whale you could just remove that try/except test for now. Not sure whether all devices would tolerate receiving a zero.

#

just remove everything before self.i2c = i2c

solar whale
#

@tulip sleet its nota crisis for me - just testin new build - but this will break a lot of stuff.

tulip sleet
#

I'm not that familiar with i2c transfer expectations at that low-level. We might need to back out that change, or not. Could you reopen that issue and point out the problem with i2c_device?

solar whale
#

I'll enter an issue at #358

manic glacierBOT
solar whale
#

@tulip sleet how do I re-open the orginal issue?

tulip sleet
#

I see a button on the empty comment form at the bottom of the issue that says "Reopen issue". Do you see that? Maybe a privs thing.

drowsy geyser
#

@tulip sleet I see it, too, and I h ave minimal repo privs.

solar whale
#

I don't see it - Is the comment enoght to get attention - or can you reopen it?

#

I have less than minimal ๐Ÿ˜‰

solar whale
#

thanks!

#

I was really puzzled why none of my i2c sensor tests would work on the my new build of 2.1 - I don't have enough hair left to pull more out ๐Ÿ˜‰

umbral dagger
#

I'm picturing @solar whale as a bald cat now.

tulip sleet
#

this is why we need regression testing that includes some external devices. it's on the agenda

solar whale
#

Thats what we are here for.

tulip sleet
#

thank you for being wetware rosie

solar whale
#

nice to see my CPU at 50 degrees rather than 85 C ๐Ÿ˜‰

formal plover
#

Also nice for my Pi to not lock up and bring down my network

solar whale
#

@tulip sleet removing the test for now does work - thanks

umbral dagger
#

The compiler is clever... that s to say... it's rather obtuse until you get your head around a few things. Then you sit back and think "huh... that's clever"

solar whale
#

clever is great until you try to debug....

umbral dagger
#

uh huh

solar whale
#

BTW I looked at the DEBUG=1 setting it it does not appear to invoke O0

umbral dagger
#

HEAVY use of macros... grammar.h is a prime example. It gets included into compile.c several times... with different macro definitions each time to extract different bits of the rules.

#

Thus no direct, explicit wiring in the compiler... it's all done at compile time based on different interpretations of the grammer rule file.

#

That slight criticism aside, I like how it's putting ALL the compile rule information in one place.

#

Once that's clear, it all makes sense.

solar whale
#
  # Turn on Python modules useful for debugging (e.g. uheap, ustack).
  CFLAGS += -ggdb
  ifeq ($(CHIP_FAMILY), samd21)
    CFLAGS += -DENABLE_MICRO_TRACE_BUFFER
  endif```
#

unless -ggdb does it

umbral dagger
#

Lanuguage implementation is what I do for fun, so digging through the MP compiler/vm is going to be a blast ๐Ÿ˜ƒ

manic glacierBOT
tulip sleet
#

@solar whale -Os is on all the time for SAMD21. Scott chose -O2 forSAMD51: not sure why. It might not fit with -O0 and -ggdb.

manic glacierBOT
#

Looks like the docs are at least building now. But this looks a bit odd (address=<sphinx.ext.autodoc._MockModule object>):
https://circuitpython.readthedocs.io/projects/tsl2561/en/latest/api.html#adafruit_tsl2561.TSL2561
Here's the mod I did for readthedocs:
https://github.com/adafruit/Adafruit_CircuitPython_TSL2561/pull/3/files
Totally new to sphinx / readthedocs, so let me know if this is wrong.

solar whale
#

@tulip sleet Thanks - I was just curious how the optimization impacted the code for debugging. Sometimes it can make it hard to trace - especaill at the assembly language level.

#

I was used to turning off for debug builds. I'm sure it has a huge code size impact!

tulip sleet
#

I turned off -Os for SAMD21. It overflows flash by 111kB!

solar whale
#

๐Ÿ˜ฌ

#

@tulip sleet Not sure if you saw this earlier - is this a bug ? If you have the board runnig on 9V and disconnect from USB, then reconnect - it bring usp CIRCUITPY but cannot connect to REPL unless I reset the board. Same happens on Mac - I suppose this makes sense since the CP board is not RESET so it does not initialize the conenction for the REPL

umbral dagger
#

Sweet! My 8Mbyte FeatherM0 hack got reblogged on adafruit.com!! Level up!

solar whale
#

Ah ! you reminded me I was going to do that mod this weekend!

umbral dagger
#

@solar whale Support is in 2.x BOARD=feather_m0_supersized

solar whale
#

I saw that - nice!

formal plover
#

Start calling @tulip sleet the lawn mower!!! That man is always trimming.

#

That's fantastic @tulip sleet, great job!

tulip sleet
#

@formal plover No, I'm not trimming. I was just showing what happens if we don't turn on optimizations.

formal plover
#

Bwhaha fast read that whole statement @tulip sleet

#

On lunch reading fast and sloppy

#

Lol, sorry. Well still a true statement, you have created a lot more space since the beginning

umbral dagger
#

@formal plover Just don't eat fast & sloppy or you're be wearing stains on your shirt all afternoon.

formal plover
#

Haha @umbral dagger at least it's Friday. They are lucky I wear pants even.

tulip sleet
#

@solar whale I have a PR in to allow ctrl-C to interrupt main.py. But sounds like we should add some logic to try to reconnect. Does it work fine on a 2.x board?

meager fog
#

heya folkx - i made a BMP280 cirpython driver - anyone wanna try it?

tulip sleet
#

The ASF4 API is a lot weaker than the ASF3 one.

formal plover
#

I don't haz that one @meager fog, I'm sure someone does though

meager fog
solar whale
#

@meager fog I only have a BME280 - sorry

meager fog
#

BME280 is next

#

so ill post when thats done

#

(its 99% the same!)

solar whale
#

happy to try it

formal plover
#

@meager fog if you happen to make one for the SHT31-D, I'd be happy to try it

meager fog
#

ok! ๐Ÿ˜ƒ

formal plover
#

๐Ÿ˜ƒ blinka

tulip sleet
meager fog
#

ooh ok

#

got it

solar whale
#

@meager fog just tested my BME280 ont he M4 board via Arduino (on linux...)

meager fog
#

kool thx!

umbral dagger
#

@meager fog I should have some time this afternoon (it's busy for the next few hours).

meager fog
#

np, ill have BME280 by then, just checkin my math and humidity calibration

umbral dagger
#

@meager fog I also have a couple BMP180s

solar whale
#

@meager fog I do have a bmp280 - just had to dig inthe parts box- so feel free to post it. I'll give it atry.

meager fog
formal plover
#

@solar whale that's too funny. I've had that happen several times. Picking up an organizer after work today

solar whale
#

@meager fog ๐Ÿ˜ฆ ```>>> import bmp280_test
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "bmp280_test.py", line 5, in <module>
ImportError: cannot import name adafruit_bmp280

#
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name adafruit_bmp280
>>> 
meager fog
#

it should run! ๐Ÿ˜ƒ

solar whale
#

that is waht I ran - just renmed it

meager fog
#

make sure the library files are in a folder called adafruit_bmp280 in CIRCUITPY

solar whale
#

yup

meager fog
#

not sure, its something with your lib folder structure?

#

not the library itself ๐Ÿ˜ƒ

solar whale
#

does it matter if it is root or in lib

meager fog
#

dunno :/

tidal kiln
#

import works for me:

Adafruit CircuitPython 2.1.0 on 2017-10-17; Adafruit Trinket M0 with samd21e18
>>> from adafruit_bmp280 import adafruit_bmp280
>>>
meager fog
#

thats my folder

tidal kiln
#

^^ i'm same

meager fog
#

root vs lib folder shouldnt matter. maybe check you have py files in adafruit_bmp280? ๐Ÿ˜ƒ

solar whale
#

doh - nevermind - just a sec

#

Temperature: 21.2 C
Pressure: 1014.2 hPa
Altitude = -8.48 meters
#

sorry - I did not creat a floder named adafruit_bmp280 - just copied the .py ....

#

temp and pressure look OK - I'm not underwater but the BME280 said -3m so its not too different

meager fog
#

ooh yah

#

you can optimize the alt measurements by telling the sensor your sea-level pressure

#

since it varies every day

tidal kiln
#

can you compare pressure to a local weather station?

solar whale
#

on a BME280 I was getting 1013.6 af few minutes ago

#

checking weatehr

tidal kiln
#

pretty healthy change for 'minutes'

solar whale
#

weatehr station say 1014.78

tidal kiln
#

standard day sea level = 1013.25 hPa

#

so the negative alt at least makes sense

#

weather station agrees nicely

solar whale
#

now have bme280 next to it - it reads 1013.37 - bmp280 still 1014.2

meager fog
#

yeah there's some variation between boards

#

that isnt outrageous ๐Ÿ˜ƒ

solar whale
#

no - I'm not concerned

formal plover
#

Good enough for government work.

#

Lol my line at work all the time.

solar whale
#

isn't government work an oxymoron

formal plover
#

@solar whale Lolololol sure is.

tidal kiln
#

worth about 20ft in elevation

meager fog
#

thanks for testin! im wrapping up BME280 now - have some math to port

solar whale
#

Glad to help - thanks for creating it!

formal plover
#

@meager fog ๐Ÿ’ฏ

tidal kiln
#

should get tonyd to test it! he has a bme280 based altimeter he takes hiking.

solar whale
#

just for fun I switched the BMP over to the M4 board under arduino and it gives the same pressure reading 1014.45

pastel panther
#

@formal plover As a government worker, I resemble that remark ๐Ÿ˜

formal plover
#

@pastel panther we're both working for the man I see.

pastel panther
#

@formal plover I suppose so, what's your schtick?

formal plover
#

@pastel panther State government

pastel panther
#

@formal plover Sweet, I'm a fed. I just need to go to defcon again so I can get a shirt

formal plover
#

@pastel panther nice!

pastel panther
#

@formal plover The most boring kind of fed, I assure you

slender iron
#

@meager fog want me to make readthedocs projects for the bmp280?

meager fog
#

in a bit

formal plover
#

Lolololol I'm in the same boat on the State side.

lofty topaz
#

Quick question anyone. What is the I2C address of the CPX si7021. Defaults to 40 but complaining 40 has no device.

meager fog
#

the CPX does not contain an SI7021

slender iron
#

kk, let me know if you have questions about readthedocs @meager fog

meager fog
#

oki!

#

gonna keep hackin ๐Ÿ˜ƒ

slender iron
#

๐Ÿ˜ƒ I'll probably do dynamic heap size soon

formal plover
#

@slender iron some day soon we'll have to resume the readthedocs spoon feeding

tidal kiln
#

can i join?

formal plover
#

Ohhh yes, join the fun @tidal kiln

#

If we can nail the process down, I'll even document it.

lofty topaz
#

I see, No si7021. Ok. Ahhh what about this code in the guide?

import adafruit_si7021
import busio
import board

i2c = busio.I2C(board.SCL, board.SDA)
sensor = adafruit_si7021.SI7021(i2c)
print("Temperature:", sensor.temperature)
print("Humidity:", sensor.relative_humidity)

formal plover
#

Its just not intuitive enough for me to pick up and go

slender iron
#

@lofty topaz probably for an external sensor

formal plover
#

I should have documented things the first time we started readthedocs

idle owl
#

If I had a dollar for all the things I should have documented from the beginning...

slender iron
#

sphinx is the tricky thing. read the docs is covered in my sharing guide

formal plover
#

@slender iron yeah that's true. It's really sphinx I need the help with

#

@idle owl ๐Ÿ˜น

tidal kiln
#

@lofty topaz what guide are you looking at?

lofty topaz
#

The CPX guide in the CircuitPython area. It's the Libraries page. The example is for a sensor as @slender iron suggested.

#

I assumed it was on the board. Not an external.

#

My bad.

tidal kiln
#

no worries

#

got a link?

lofty topaz
#

I just can't work/play with the Block builder. Need to cut code so I am going this route.

idle owl
#

CircuitPython's not compatible with an ESP-12E chip, right? You can't take the ESP8266 build and put it onto any ESP chip?

solar whale
#

@idle owl depends mostly on pinouts - may be ok - huzzah build works on feather and breakout ,

idle owl
#

Hmm. Ok

solar whale
#

let me see if I can find doc for 12E - feather is 12-S

idle owl
tidal kiln
#

@lofty topaz thanks for link. that's a general how-to on using libraries, not specific to the cpx. i can see how it might be confusing in that context though, since the cpx has all kinds of sensors on it. but it is as @slender iron said - for an external sensor.

solar whale
#

I saw that and meant to answer then got sidetracked.

idle owl
#

@solar whale I'll leave you to it then. If I answered it, it'd be getting all the info from you anyway.

lofty topaz
#

@tidal kiln Yes, thanks for confirming. I have two CPX's now and wanted some data to send over the IR beam so I popped into that page, scarfed the code, and assumed the sensors were there.

solar whale
#

ok - Ill respond in a few minutes

tidal kiln
#

why did segger camel case their executables? thank goodness for alias.

idle owl
#

@lofty topaz CircuitPython IR support is still being developed.

lofty topaz
#

I know I've been out of the developers realm for a few years now but are you saying "camel case' is nolonger used?

#

@idle owl Yes, I know. Thought I'd try and see how far along it is.

tidal kiln
#

no, i'm just whining. on linux and the segger tools are mixed case for some reason. makes using on cli 'fun'.

#

alias jlink='/opt/SEGGER/JLink_V620g/JLinkExe'

lofty topaz
#

Ahh, I see.

#

The things I don't miss about developing.

idle owl
#

@lofty topaz This works for receiving and decoding many IR signals (might still fail to decode some, I'm not sure): https://github.com/adafruit/Adafruit_CircuitPython_IRRemote There's a module ported by someone who uses IR for communicating between accessibility devices: https://github.com/cyborg5/IRLibCP

umbral dagger
#

@tidal kiln I could not agree more. It smacks of a company not familiar with unix.

tidal kiln
#

or maybe they have stock in <SHIFT> key companies?

umbral dagger
#

@tidal kiln Also, I hate things going into /opt ... that's what /usr/local is for!

idle owl
#

The first one I've used on the CPX to receive signals from remotes and another CPX loaded with MakeCode. I haven't used the second one with the CPX. I also haven't made a CPX send IR signals using CircuitPython. But that's where I will start.

tidal kiln
#

meh. distro wars.

umbral dagger
#

@tidal kiln I cut my teeth on SunOS... never could get comfortable with Solaris.

lofty topaz
#

@idle owl Thank You! I will check out the links and hack away. ๐Ÿ˜ƒ

umbral dagger
#

@tidal kiln Give me a BSD deriviative over a Sys V one, anyday.

tulip sleet
#

@tidal kiln I am using aliases up the wazoo to save remembering stuff:

alias m4gdbserver='JLinkGDBServer -device ATSAMD51J20 -if SWD'
umbral dagger
#

(now I sit back to see if anyone (other than maybe @tulip sleet ) is old enough to get that ๐Ÿ˜‰ )

lofty topaz
#

@umbral dagger Are those "mini memories"?

tulip sleet
#

Also .gdbinit file contains:

    target extended-remote :2331
  end
tidal kiln
#

yah, i'll probably there at some point. right now i'm at "can i even see the board?"

tulip sleet
#

"I named the program more. This was a daring move at the time, since it was such a long name for a UNIX command, and was also a real English word."

stuck elbow
#

faints

umbral dagger
#

@tulip sleet That's right .. more Awesome story btw.

pastel panther
#

swoon

#

will a 'real' python repl give any better syntax errors than the CP one?

stuck elbow
#

not really

pastel panther
#

Does someone want to point out the errors of my ways?

stuck elbow
#

the parser is rudimentary and doesn't keep much state

pastel panther
#

๐Ÿ˜ƒ

tulip sleet
#

@pastel panther paste away

pastel panther
#
    return (x+ (y*8))
def swap(a,b):
    t = a
    a = b
    b = t
    return (a,b)

def fancyass_writeline(x0, y0, x1, y1, color):
    byts = bytearray([0 for i in range(0,63)])
    byt_array
    steep = math.abs(y1-y0) > math.abs(x1-x0)

    if steep:
        x0, y0 = swap(x0, y0)
        x1, y1 = swap(x1, y1)
    if (x0 > x1):
        x0, x1 = swap(x0, x1)
        y0, y1 = swap(y0, y1)

    dx = x1-x0
    dy = math.abs(y1-y0)

    err = dx/2
    ystep = None

    if (y0 < y1):
        ystep = 1
    else:
        ystep = -1
    while(x0<= x1):
        if(steep):
            byts[xytoi(y0,x0)] = color
        else:
            byts[xytoi(x0m, y0)] = color

        err -= dy;
        if(err < 0):
            y0 += ystep
            err += dx
        x0++

    return byts
#

it's complaining about return byts

tulip sleet
#

what's this : byt_array

#

two lines below third def

pastel panther
#

Oh, I was going to make a array then call bytearray on it, guess I left it in

#

removed, still don't like the return

#

I found an errant semicolor

stuck elbow
#

def swap(a,b):
retaurn b, a

tulip sleet
#

also x0++ is not python

pastel panther
#

-r+n

stuck elbow
#

by the way

pastel panther
#

@stuck elbow facepalm

tulip sleet
#

x0 += 1

tidal kiln
#

and semicolons err -= dy;

stuck elbow
#

aah, right, there is no "++"

#

or "--"

pastel panther
#

abs is not math.abs?

tulip sleet
#

semicolon is ok but superfluous

tidal kiln
#

yep

tulip sleet
#

the human group compilation has finished

pastel panther
#

haha

#

thanks guys

#

Would you believe I did python for 3 years a loooooooong time ago? I've got py-cred, I swear! ;P

stuck elbow
#

C does that to you

pastel panther
#

(blame ruby)

solar whale
#

@tulip sleet On the Pi after installing many many packages and the crunching for a looong time my arm gcc build faile while building "genautomata" ...sigh - Is there where your failed as well? I'm about to give up on the Pi as a development platform.

#

I think @formal plover will just have to get a "real" computer to build CP. ๐Ÿ˜‰

tulip sleet
#

@solar whale mine was somewhere in build-prerequisites.sh. Compiler error reporting is too harsh for ./configure (perhaps remove -Werror). Found this, but I'm not sure it's relevant: https://stackoverflow.com/questions/27867271/zlib-harsh-compiler-warnings-and-configure-test

formal plover
#

@solar whale Bwhaha! I have one. It got moved to a really inconvenient place after we set up the nursery

pastel panther
#

after an out of bounds issue, it works!

#

thanks guys!

solar whale
#

Mine failed there on the firs try, but I rerean it with --skip_steps=mingw32 and build-prerequisites completed.

tulip sleet
#

how did you know to do that?

pastel panther
#

I read the GFX lib

solar whale
#

It inthe intall guide pdf

pastel panther
#

oh, nvm

solar whale
#

part of the .tgz file

tulip sleet
#

I was using lesspipe to read the pdf on the rpi. I got that from google. But I just skimmed it. Should have read it on the big screen computer.

#

it converts the pdf to text

solar whale
#

How-tobuild-toolchain.pdf - it listed all the packages too so I installed tehm all - except there is no build-esentials

tulip sleet
#

I did see those packages (long list) and installed them, but I should have read further. Anyway, it was mostly to build mpy-cross and the one you built works fine on both jessie and stretch so I uploaded that to the 2.1.0 release.

solar whale
#

I was able to build mpy-cross and bossac so I can use the arduino stuff on the M4 - I think I'll be happy with that - Sorry @formal plover

tulip sleet
#

I like that ARMinARM joke.

formal plover
#

Haha @tulip sleet

#

Thanks, I'll check it out later.

slender iron
#

@tulip sleet what do you need me to look at today?

#

I'd be down for a voice chat. I've got some ideas about the supervisor

tulip sleet
#

sure - now is fine

slender iron
#

๐Ÿ‘

solar whale
#

@tulip sleet @formal plover taht builds gcc 4.8.2 - currnent build is 6.3.1 - worht a try, but probablt the same a apt-ge install arm-gcc-none-eabi - which won't support CP build.

#

I have to go for awhile -it is too nice outside to stay in all day!

tidal kiln
#

should i flash a bootloader on the m4 first? or just use one of the cp bins?

idle owl
#

Flash the bootloader if you want to be able to test using the .uf2 firmware files. That's what I've been using.

tidal kiln
#

where to grab bootloader?

idle owl
tidal kiln
#

one of the ones he posted here?

idle owl
#

Yeah that's the last one he posted, and the last one I flashed.

#

I haven't built the bootloader myself yet.

tidal kiln
#

yeah, i'll worry about building next, first just want to flash an existing build

#

can i use the uf2 with jlink?

idle owl
#

Totally understand that

#

Oh wait... you're right that's not it

#

hold on.

#

No you can't use the .uf2 with jlink.

tidal kiln
#

jlink -if SWD -device ATSAMD51J19 -loadbin bootloader.bin,0x0

idle owl
#

That's the bootloader from the 24th, which matches the last update to the uf2 repo.

tidal kiln
#

that look correct?

idle owl
#

For me the address was ,0

#

Otherwise I think so? I used JLinkExe to do it

#

connected first

#

then did loadbin

#

so I never ran exactly what you did, but other than the address being different when I did it, it looks right

formal plover
#

Wait, I thought there's one from the 26th now

tidal kiln
#

think it's the same, jlink is just my alias

#

and sounds you ran interactively

idle owl
#

@formal plover @tidal kiln There's might be. Might want to ping Scott before you flash that... I might be behind.

tidal kiln
#

oooo. fresher produce.

idle owl
#

I think that's the firmware, not the bootloader...

formal plover
#

I thought it has both

idle owl
#

You might be right. I probably misunderstood.

tidal kiln
#

well. let me try...

idle owl
#

If you end up with a neopixel, it's the bootloader. If you end up with CircuitPython, it's the firmware. ๐Ÿ˜ƒ

formal plover
#

There's both on there I'm fairly certain

#

Considering there's .bin and .UF2

idle owl
#

Yeah but I think travis builds both for the firmware

formal plover
#

@idle owl gotcha

idle owl
#

Since you can still use the jlink to flash a .bin firmware file.

pastel panther
#

both could be a bootloader, just diff formats I think

formal plover
#

True true

idle owl
#

Like I said, I could be wrong. That's just what I understood it to be.

pastel panther
#

hey @idle owl, You've done some CP library work right?

formal plover
#

I'm probably wrong @idle owl Lolololol

idle owl
#

@pastel panther Yeah for the CPX

pastel panther
#

@idle owl I was looking at the AdafruitGFX lib and I didn't see a CP equivalant, is that right?

tidal kiln
#

i get....nothing

idle owl
#

@pastel panther I don't know for sure. Cursory search says you're right. A lot of the CP libraries are included in the bundle, so that's always a good place to start looking for whether or not it exists already. Otherwise, a more thorough search of GitHub would be needed.

#

@tidal kiln That's not a very good prize

tidal kiln
#
Cortex-M4 identified.
Halting CPU for downloading file.
Downloading file [adafruit-circuitpython-metro_m4_express-20171026-e7e8e0a.bin]...
Comparing flash   [100%] Done.
Erasing flash     [100%] Done.
Programming flash [100%] Done.
Verifying flash   [100%] Done.
J-Link: Flash download: Bank 0 @ 0x00000000: 1 range affected (204800 bytes)
J-Link: Flash download: Total time needed: 2.905s (Prepare: 0.022s, Compare: 0.048s, Erase: 1.022s, Program: 1.760s, Verify: 0.045s, Restore: 0.004s)
O.K.
#

did something

idle owl
#

@tidal kiln And you disconnected the jlink and did the double-tap to reset to see if it would go into the bootloader?

tidal kiln
#

no

pastel panther
#

@idle owl Cool, separate from if it's needed, if I were to port something like that to CP would it make sense to write it in python or try to keep parts in C for performance? Is there a provision for including C/compiled code with a CP library?

idle owl
pastel panther
#

Oh right.

tidal kiln
#

yep. nothing.

#

let me try bootloader.bin...

idle owl
#

Did you start already

tidal kiln
#

me? start what?

idle owl
#

Start trying the bootloader.bin

#

or are you still in the current state

tidal kiln
#

yes.

#

current state

idle owl
#

Try to connect to the REPL even though nothing seems to be happening. We ran into that but that was supposed to be fixed iin the latest build

#

Like nothing would happen, we'd connect to the REPL, and then it would show up

tidal kiln
#

nothing is even showing up in dmesg

idle owl
#

Ah ok

#

then yeah try bootloader.bin

tidal kiln
#

it's name is more promising

idle owl
#

Valid

pastel panther
#

weeee ASF docs!

tidal kiln
#

seems happier. neopixly happier.

idle owl
#

Yay!

tidal kiln
#

got METROM4BOOT, now let me try a UF2 from the s3 bucket...

pastel panther
#

I feel strongly that there should be a animated neopixel emoji

tidal kiln
#

INFO_UF2.txt (fwiw):

UF2 Bootloader v1.23.0-14-g3db9182 SFHR
Model: Metro M4
Board-ID: SAMD21G19A-Metro-v0
idle owl
#

Yeah that's the last commit on the repo

#

So I am up to date apparently.

formal plover
#

@idle owl for the win

tidal kiln
#

and this seems promising:

Adafruit CircuitPython 3.0.0-alpha.0-210-ge7e8e0a on 2017-10-26; Metro M4 Express with samd51j19
>>> print("hello world")
hello world

idle owl
#

Yes!

solar whale
#

@idle owl @tidal kiln you are mking it look so easy - Not like the "the old days .... " ๐Ÿ˜‰

idle owl
#

@solar whale Yeah all of 2 days ago.

tidal kiln
#

thanks @idle owl i've now made baby step 1.

idle owl
#

@tidal kiln That's how it always starts. Good job!

tidal kiln
#

so the s3 bucket is just cp builds?

idle owl
#

That's what I thought anyway.

tidal kiln
#

seems like it. flashing the .bin from there did nothing.

#

flashing the bootloader.bin and then using the uf2 from the s3 bucket worked fine though.

idle owl
#

That's the end goal anyway.

tidal kiln
#

and i guess the .bin's are for loading cp with bossac

#

once you've got the bootloader on

idle owl
#

Ah that makes sense

lofty topaz
#

@idle owl @tidal kiln Howdy, just been kibitzn your conversation. I must say, that's hacking at it's best. Glad to see the M4 is progressing. ๐Ÿธ

tidal kiln
#

@lofty topaz thanks. i'm days behind everyone else. i'm probably benefiting from that.

idle owl
#

@lofty topaz Every time we get a new build there's something new. They're doing so well.

lofty topaz
#

@tidal kiln Hey! Whatever it takes right? Cut that code. ><>

#

@idle owl ๐Ÿ˜ƒ

idle owl
#

@tidal kiln Wait on using main.py and code.py... I'm pretty sure they're still causing issues with connecting to the REPL. You can create a file and import it while in the REPL (I keep blinky.py around, that little red LED Is so satisfying!), but if you have a main/code, you can sometimes connect to the serial connection, but you can't give it any input or kb interrupts to get to the REPL.

tidal kiln
#

k. thanks. mainly just making sure i got the flash/load process down at this point.

lofty topaz
#

@idle owl By the way, what's with "code.py" anyway? Why not "main.py" only? Is there a difference?

tidal kiln
#

still curious where the latest bootloaders live?

formal plover
#

Probably GitHub somewhere

#

I'm not doing very well at being correct so.... Lol

lofty topaz
#

@formal plover I use to tell people "My brain is not building today, sorry!".

idle owl
#

@lofty topaz code.py is where your code lives. It's meant to be easier to understand for beginners. main.py is a carryover from MicroPython

#

@tidal kiln I think they're at that repo I linked. I think you can build them there. Scott posts them prebuilt for us when we need to test after he commits.

lofty topaz
#

@idle owl Dang, I was afraid of that. You see, "main", whether for the start of C or the runtime in Python, it's a rock that shouldn't be moved nor changed. I hope "code.py" doesn't backfire and confuse beginners.

#

My opinion... ><>

idle owl
#

@lofty topaz There's no difference between the two. CircuitPython looks for code.txt, code.py, main.txt, and main.py in that order, I believe. The .txt files are included because people just starting out may not have editors that understand .py files, so we want them to still be able to plug in a board and get started immediately.

lofty topaz
#

@idle owl I understand, it's just giving choices at the fundimental level requires more explaining. I tend to view that sort of stuff as "noise".

idle owl
#

@lofty topaz You're coming from a solid background. You're not really the target audience for code.py ๐Ÿ˜ƒ I think by the time it starts to matter whether someone is using main.py or code.py, they'll have enough knowledge to understand why one is needed over the other. That's the goal. Teaching.

tidal kiln
#

now to read the 1732 page SAMD51 datasheet to see what we've got...

idle owl
#

@tidal kiln See you in a month..?

tidal kiln
#

maybe. not sure i'm that fast of a reader though.

umbral dagger
#

@tidal kiln @idle owl haha

pastel panther
#

@tidal kiln good luck, take a towel

umbral dagger
#

@idle owl @lofty topaz I like main.py. To me it says โ€œthis is where it startsโ€ even if there are other files there.

pastel panther
#

my problem was "oooh look at all these peripherials!!!!!!!!!" and then realizing I have no idea how to use them. That's how I ended up here actually; CP 3.0 as a ASF4 app reference

umbral dagger
#

@idle owl @lofty topaz code.py is great if thereโ€™s just one file. And I agree it is more beginner friendly. So having both as options is excellent!

idle owl
#

@umbral dagger That's exactly the point.

pastel panther
#

@umbral dagger I was in the middle of typing the same thing

#

main.py by itself is kinda like "wait, do I need more?"

lofty topaz
#

Just one file. Why does that make a difference. Please, I'm only trying to understand. If they are suppose to be the same, then what's the difference?

pastel panther
#

The diff is main.py makes more sense to people with a programming background and code.py makes more sense to a beginner

lofty topaz
#

And what if there are both?

idle owl
#

@lofty topaz It gives beginners a simple place to start while leaving the options open for people who understand it already to use main.

#

@lofty topaz Then it reads them in the order I posted earlier. Finds one, and stops.

tidal kiln
idle owl
#

So if you have code.py and main.py, the first one will be read and that's it.

lofty topaz
#

ok, got it.

tidal kiln
#

just options

idle owl
#

Yep

pastel panther
#

around line 134

lofty topaz
#

Why isn't it called code.c ???

pastel panther
#

because it's c and no CP

umbral dagger
#

code.txt, code.py, main.py, main.txt ... first of those it finds gets run.

tidal kiln
#

python isn't c

lofty topaz
#

just kidding... ><>

umbral dagger
#

ah.. ya.. @tidal kiln covered that ๐Ÿ˜ƒ

pastel panther
#

sometimes it's hard to tell a person kidding from a beginner with genuine questions

tidal kiln
#

this can all change with time as user experience is gathered

lofty topaz
#

I'm sorry, I was just trying to reenforce my point.

idle owl
#

I actually use it to my advantage. Sometimes I'll use main.py for working code and code.py for testing other people's code. So someone has an issue, drop their code into code.py and it'll let me sort it out without moving or renaming my working code.

#

@lofty topaz Don't apologise. Discussion is always good.

umbral dagger
#

Although, I don't get the rational of having .txt versions in addition to .py versions. It is python code.

idle owl
#

And @tidal kiln is right, as things progress, and the user experience becomes more solid, things can change if it makes sense.

umbral dagger
#

Maybe to accomodate people using editors that insist on using .txt ??

pastel panther
#

yea

idle owl
#

@umbral dagger Exactly

lofty topaz
#

@idle owl See that? Now you got experts asking questions. Told ya.

pastel panther
#

?

idle owl
#

@umbral dagger So total beginners who ordered something, got a Trinket with it, have never coded anything and only have Notepad can at least get started.

umbral dagger
#

@idle owl makes perfect sense. We loose sight of what it's like as a beginner.

lofty topaz
#

@idle owl And calling their file code.py instead of main.py is easier. Ok.

pastel panther
#

the more I think about it, a CPX with a simple text editor is an amazing way of learning to code