#circuitpython-dev

1 messages Β· Page 246 of 1

manic glacierBOT
timber mango
#

Does the PyPortal http://adafru.it/4116 have any ordering gotchas such as "I wish I'd ordered an SD card to go with it!"

manic glacierBOT
prime flower
#

@timber mango Not that I've had - i've only sent data over wifi with it.

timber mango
#

@prime flower Thanks, I apprecate it! I don't have the time to research this at the moment but it looks like a good time to grab one before they disappear. ;)

#

Arduino-friendly and SAMD51 is usually all I need to know about a thing. ;)

tidal kiln
#

yah, you can just plug in a USB cable and start using it right away, so anything else you might want (the stand, JST pigtails, etc) you can get later if you want

timber mango
#

The 8 MB flash is common to NeoTrellis M4, PyPortal .. any others? I thought we were 2 MB SPI flashROM throughout, or was NeoTrellis M4 revised since I got mine?

scarlet maple
timber mango
#

@scarlet maple thanks! What use did you have for an SD card in this context?

scarlet maple
#

https://github.com/mikerenfro/iot-office-door-sign -- needed somewhere to download web content to. Could use the flash with some config change, and might be able to just store the JSONs in a string now, but didn't think that was an option at the time.

timber mango
#

Yeah those are good gotchas. That type of connector always seemed fussy to me, but they've been around for quite some time.

#

Yeah I was working on a filesystem for the QSPI flashROM but I don't remember how far I got with that. Someone else may've already solved that. I just don't remember.

#

All I remember was an offhand remark that one could kind of ignore that it was QSPI and use the existing hard wiring for legacy SPI work, to good effect.

manic glacierBOT
crimson ferry
#

@timber mango Grand Central has 8MB (but no Wi-Fi).

manic glacierBOT
#

When tackling your issue I copy and pasted your code and tried to replicate the issue you were having and it displayed a position argument error on line 24. I fixed that error but it turned out that I was using an older version. So when I updated the version, the code I had didn't work but still received a position error. So I copy and pasted the code you had again and received the same issue you had. I assumed the reason your code didn't work was due to the way you set the position (since I ...

meager fog
#

@timber mango you dont need an sd card for any of the projects - thers' onboard 8mb storage

manic glacierBOT
#

There have been some changes to the positional argument as 4.0 has moved through the beta releases. At one point it was a tuple. But now both Group and TileGrid have specific and separate x and y.
https://circuitpython.readthedocs.io/en/latest/shared-bindings/displayio/TileGrid.html
https://circuitpython.readthedocs.io/en/latest/shared-bindings/displayio/Group.html
So I think either (or both) can generally be used to affect position. The fact that the issue only shows up when sett...

manic glacierBOT
manic glacierBOT
manic glacierBOT
karmic notch
#

For circuit python is there a thread, post, learning guide to learn how to "multi task" a circuit playground express?

I am looking to "interrupt" an action with another action in my little crickit rover bot.

Looking for something similar to this guide

#

Since I am learning python too I am guessing time.sleep() is just like saying delay()

tulip sleet
#

@karmic notch edited ^^ (second link aadded)

karmic notch
#

Thanks!!

manic glacierBOT
#

FrequencyIn was computing a float in an expression that included a uint64_t value. This causes software double precision floating arithmetic to be used, which brings a lot of extra code. The difference being calculated is between two closely spaced millisecond time values, so casting to 32 bits should be no problem.

Changing the arithmetic to used uint32_t only saves about 3000 bytes, which should improve the space squeeze we are seeing on M0 Express builds a lot.

Also fixed a m...

#

OK, so I can run the ethernet example code fine from code.py, so long as it successfully connects, and it loads example.com a hundred times without errors then gets to "Code done running".

If there's no ethernet connection then the socket.getaddrinfo() fails (slowly) and then it drops out to the
"Code done running." when it hits the OSError: -2.

Either way though, a few seconds after it gets done, it locks up hard and the serial port disconnects.
If I hard reset it it works again. ...

manic glacierBOT
#

OK, so 24934a1 removes nics from the network stack when the network deinits: this seems to fix the problem which I was seeing when loading code from code.py and then dropping out to "Code done running." ... it now drops out to a happy REPL and you can even Ctrl-D to restart or 'import wiznet' to use it from the REPL and it works.

In the process, I noticed that I'd not actually attached the jumper wire for RST anyway and it all worked perfectly with or without, so I've made the RST pin an o...

manic glacierBOT
manic glacierBOT
manic glacierBOT
upbeat plover
#

@raven canopy could add a optional parameter to cpx audio change how load sounds are played, but only 3 settings

def _sine_sample(length, volume=None):
        if volume is None:
            volume = 0
        elif volume is high:
            volume = 1
        elif volume is low:
            volume = -1
        else:
            print("options are 'high', 'low', or 'None'")
        tone_volume = (2 ** 15) + volume
        shift = 2 ** 15
        for i in range(length):
            yield int(tone_volume * math.sin(2*math.pi*(i / length)) + shift)
stuck elbow
#

@meager fog congrats on the Women in Open Source award!

ruby atlas
#

Question for the community: I'm cleaning up _pixelbuf and want to remove unnecessary byte-order classes to save flash. Does anyone know of all known Neopixel and Dotstar (and possibly other RGB led) byteorders?

surreal saffron
#

@ruby atlas - I'm not an authority, but FAB_LED has wide hardware compatibility and doesn't have RBG, GBR, or BRG.

surreal saffron
#

@ruby atlas - and FAB_LED supports WS2812, WS2812B, APA102, APA104, APA106, SK6812, and SK6812B

#

Do any circuitpython boards include moductypes by default?

stuck elbow
#

no

#

it only works on the unix port

ruby atlas
#

@surreal saffron thanks for the tip.

#

I'll go look at it.

knotty cypress
frigid cloak
#

How does one run the tests? I tried cding into tests and ./run-tests but I got this exception: FileNotFoundError: [Errno 2] No such file or directory: '../ports/unix/micropython': '../ports/unix/micropython'

manic glacierBOT
#

Solo inspecciona los cambios en 'es.po' y no los otros. Hay cambios ejecutados por "make translate", pero solo hice cambios en 'es.po' y para que sea mΓ‘s fΓ‘cil ver las diferencias en los cambios antes de "make translate". Muchas gracias.

--

Just check the 'es.po' changes and not the other ones. There are changes that were run by "make translate" but I only made changes in 'es.po' and to make it easier you can look at the differences in the changes before "make translate". Thank you so ...

somber coral
#

I've tried fresh virtualenvs, cleaning, etc, but can't get past that

manic glacierBOT
stark kite
#

@stuck elbow Is the source code for Jumper Wire example game running on the PyBadge available?

manic glacierBOT
#

After https://github.com/adafruit/circuitpython/pull/1850 is merged, if you are on a blank line and press TAB it will autofill import . Also, if you are in a continuation block like the following:

>>> import 
>>> while True:
...     if True:
...     

Then currently using TAB won't do anything, but it seems like it would be handy if this moved forward by four spaces.

I'm not sure how to run the tests or which should be updated, so please let me know what I can do th...

stuck elbow
manic glacierBOT
stark kite
#

@stuck elbow thanks. Trying to get https://github.com/circuitpython-badge/circuitpython-badge/blob/master/hardware/frozen/badge.py to work, but getting an IO error: File "badge.py", line 208, in _matrix_write
OSError: [Errno 5] Input/output error. For some reason "_i2c.writeto(0x50, _buffer, end=2)" doesn't seem to work on CircuitPython 4.0.0-rc.1.

stuck elbow
#

@stark kite that's not for the pybadge, it's for a custom badge that I made before pybadge existed

#

@stark kite it has an i2c-based display

shy elm
#

I've been wondering if the NodeMCU V3 (ESP32) is supported by circuit python.

stuck elbow
#

@shy elm the support is dropped in 4.0, but should work with 3.x

manic glacierBOT
manic glacierBOT
#

For both small and long integers, raise an exception if calling struct.pack, adding an element to an array.array, or formatting an int with int.to_bytes would overflow the requested size.

For long integers in particular, implement this in terms of primitives that could be used in the future to expose int.bit_length() to Python.

I still have some more testing that I'd like to do - and I'd like to add some unit tests - but I'm pushing this now to get some feedback on it sooner r...

tulip sleet
#

@somber coral what is the command line you were using that generated the output in that gist?

manic glacierBOT
#

The original example uses D10 as CS (chip select) and D11 as RST (reset) and specifies those when constructing the interface, so you can use a different pin for reset if you like:
eth = wiznet.WIZNET5K(spi, board.D10, board.D11)
I've made the rst parameter optional so if you've not hooked up reset, or hooked it up to the reset button, you can construct the interface like:
eth = wiznet.WIZNET5K(spi, board.D10)
Either way you can avoid configuring DHCP at initialization by providing a `...

somber coral
#

@tulip sleet I was just doing 'make html' from the root of the repo, with a fresh went activated and requirements installed

#

S/went/venv/

simple pulsar
raven canopy
#

hehe. circuitpython-build-tools is deployed to PyPI as a library, then is installed with pip by eacy library and the Bundle repos' CI to bundle the files. there are some things that are difficult to test before its deployed to PyPI, and we couldn't get it to act right today. It was causing a serious backlog of PyCon sprint PR failures, so we reverted it for now.

simple pulsar
#

Oh, that PyPI - I thought someone had made a board called PyPi - it didn't seem like a wise name.

raven canopy
#

that would be confusing. πŸ˜„

#

and to everyone who was affected: Full public apology!

trim elm
#

Does anyone know if the decimal library is implemented in circuitpython?

simple pulsar
#

Was it #29 or #30 or is that still unknown?

raven canopy
#

@simple pulsar that one should be good.

simple pulsar
#

@raven canopy thanks, i'll mention that one in the guide I'm writing explicitly for now, and then revise it when it goes out permanently

raven canopy
#

sounds good. that was one reason i reopened that issue; didn't want anyone thinking it was fixed for perpetuity..

tulip sleet
#

@trim elm Nope, no decimal, sorry. We have longints, as you'd expect.

manic glacierBOT
#

Thanks for the information.

And... great work in a short period of time!

I am still testing: in general it works now, sending as well as receiving in code.py and it doesnΒ΄t hang anymore, but there are still some confusing points:

  • It only works if I add a 3 second delay (2 or less donΒ΄t suffice) between ss=socket.socket and ss.connect, otherwise I get an Errno 13, Permission denied
    Or is there an option to check if the socket has been successfully created so that I can try a connect ...
frigid cloak
#

Are there instructions for running the tests? I tried cding into tests and ./run-tests but I got this exception: FileNotFoundError: [Errno 2] No such file or directory: '../ports/unix/micropython': '../ports/unix/micropython'

manic glacierBOT
#

Found another issue after testing special situations:
If I first have the server not listening I get the error 4 described above and it comes back to the REPL
Then after I activate the server socket and execute the code again by pressing ctrl D it hangs (no REPL in MU, not possible to access drive.) After a hardware reset of the feather I get circuitpy at least on my computer and can delete code.py, after relaunching MU it is able to communicate again.

tulip sleet
#

@frigid cloak the tests only test the micropython language core, so most of the time they don't provide the coverage you'd need. Check out a travis build for how the tests are run. I very rarely run the tests by hand.

#

they are only run on the unix build, usually by micropython-coverage

#

(which is a build that turns on all the features so they can be tested)

frigid cloak
#

Okay. Though earlier I was messing with the REPL which I'm assuming the tests probably do cover?

tulip sleet
#

@frigid cloak yes there are some simple tests of the repl. I'm working out how to run the tests by hand.

frigid cloak
#

Thanks. I'll probably take a look at how the CI does it tomorrow

tulip sleet
#
$ cd circuitpython
$ make -C mpy-cross
$ cd ports/unix
$ make axtls
$ make coverage_test
#

@frigid cloak ^^

frigid cloak
#

Thanks!

tulip sleet
#

there's also a make coverage_clean. yw!

manic glacierBOT
#

Hmmm, so just to confirm, the situation here is:

  • you don't have hardware reset hooked up on your wiznet module.
  • you have a TCP server ready to run on your network somewhere
  • your circuitpython/wiznet client attempts to connect a socket to it, but fails because it isn't running yet
  • that drops you out of code.py and into the REPL
  • you then start the TCP server and ctrl-D to re-run code.py
  • on attempting to re-create the client it hangs, hard.

I'm thinking that might be relat...

mint prawn
#

(if yes, that's pretty much the world's easiest PR, but I don't know how discord invites work so I might be missing something.)

tough scroll
#

Hello! I'm new to Circuit Python and received my Trinket m0 today. Just went through the beginner guides. I have a project im working on and wanted to know where i can go to ask questions about starting. This the right place?

mint prawn
#

Hi, @tough scroll ! I'm also new, but I think this is the channel for development on circuitpython itself - if you're looking for help with using circuitpython, I believe that is #help-with-circuitpython. But someone else with more experience can correct me here!

tough scroll
#

Thanks, mchua!

manic glacierBOT
raven canopy
manic glacierBOT
gilded cradle
#

Awesome. Thanks for adding the tests @raven canopy.

stuck elbow
#

@gilded cradle I wonder if you could, when you have some free time and a non-prototype version of pybadge, to help me with testing the games?

#

because I tested them on my prototype and they work, but someone recently tried them and said they only get black screen

gilded cradle
#

The badge I have is from the store @stuck elbow, so I don't think it's a prototype

stuck elbow
#

I suspect it may be some difference between what I have and the final version

gilded cradle
#

Yeah, perhaps I can give it a try when I get to the sprint in an hour or so

#

Where are the games?

stuck elbow
gilded cradle
#

Oh, the difference may have something to do with the bootloader version. I haven't updated mine yet, but I can check on it a bit later.

#

Thanks

stuck elbow
gilded cradle
#

Thanks, I'll give it a try a bit later and let you know the results and my bootloader version

stuck elbow
#

you copy all the files (except for the .mpy) from the repo, and reanme jumper.py to main.py

#

at some point I will clean them up, so you only need to copy them

gilded cradle
#

Ok, cool

manic glacierBOT
gilded cradle
#

@stuck elbow, when I try it, I am getting an error that stage is missing. If I remember correctly, it should be compiled in. It's possible it wasn't in the CP version that came on the PyBadge.

stuck elbow
#

ah, sorry, on the m4 you can just copy it

gilded cradle
#

Yeah, it has an m4

stuck elbow
cerulean pawn
stuck elbow
gilded cradle
#

Ok, now it's just a blank white screen

stuck elbow
#

any errors? :(

gilded cradle
#

I'm testing vacuum invaders first

#

No

cerulean pawn
#

@stuck elbow do you know how/where the build scripts are? I don't see it in adabot repo at least.

stuck elbow
#

they are in travis configuration somewhere

gilded cradle
#

Should I test out jumpers next?

stuck elbow
#

it will be the same

manic glacierBOT
gilded cradle
#

Ok

cerulean pawn
stuck elbow
#

it's weird, because stage should be frozen

cerulean pawn
#

I'll try to see if something is missing here

gilded cradle
#

I can try building from the latest source to see if it works, but as it comes, it doesn't.

manic glacierBOT
stuck elbow
#

that's 4.0.0rc1, right?

gilded cradle
#

Strangely enough, the boot_out.txt file with what comes on it says 3.0.0-rc1, bus same results with 4.0.0-rc1

#

Sure, I'll try that

manic glacierBOT
gilded cradle
#

I'm using the frozen uGame which is already using board.DISPLAY

manic glacierBOT
stuck elbow
#

huh?

gilded cradle
#

Also, in the frozen module, you have an alias link named stage.py that points to another file named stage.py. Perhaps that's part of the issue

manic glacierBOT
stuck elbow
#

it works on my prototype, with the link, so that shouldn't be it

#

also works for Β΅Game

#

how do you know that the frozen ugame.py is using board.DISPLAY?

gilded cradle
#

Well, looking at the current circuitpython source shows it is

stuck elbow
#

can you update the submodules?

gilded cradle
#

Yeah, let me try recompiling and see if that helps. I just tried downloading RC1

manic glacierBOT
#

I just edited that page to say:

  • vim / vi safely writes all changes. But set up vim to not write swapfiles (.swp files: temporary records of your edits) to CIRCUITPY. Run vim with vim -n, set the no swapfile option, or set the directory option to write swapfiles elsewhere. Otherwise the swapfile writes trigger restarts of your program.

Click on the "swapfiles" link for more information. Feel free to suggest edits of the above to improve its clarity.

gilded cradle
#

Ok, interesting results. First, after copying rc1 down, I was able to remove the external stage.py and got the whitescreen instead of the error. Second, after compiling and placing it on the PyBadge, I saw the game for about 1 second and then it went white.

stuck elbow
#

and still no errors?

gilded cradle
#

Not on the screen. Let me check the serial output.

manic glacierBOT
gilded cradle
#

No output on serial

raven canopy
#

@cerulean pawn the libraries_updater script doesn't update the firmware links. Those are done with tools/build_board_info.py in the core repo.

stuck elbow
#

this is frustrating

#

@gilded cradle thank you for confirming this

gilded cradle
#

You're welcome

stuck elbow
#

now I need to figure out why it works on mine, but not on yours :(

#

@meager fog was there a change in the display used on pybadge?

gilded cradle
#

Which bootloader version do you have?

#

Actually, I'm not even sure what I have

stuck elbow
#

3.3.0-1

#

but I can't see how bootloader would affect anything

trim elm
#

I'm having an issue with Travis. I fixed an image link in the Circuit Playground repo, and travis is saying: ../README.rst::image file not readable: docs/_static/circuitplayground_express.jpg
The command "cd docs && sphinx-build -E -W -b html . _build/html" exited with 2.

cerulean pawn
#

@raven canopy yeah I found that out later. I got to that one because top level Travis config only had this one script mentioned

raven canopy
#

:+1:

meager fog
#

@stuck elbow nope, same display

#

@gilded cradle hihi by chance do you have a link to your pybadge example code

gilded cradle
#

Yeah, just a sec...

stuck elbow
#

@meager fog so the only thing that changed was PA01 and PA00 being swapped, right?

meager fog
#

yes, pygamer also has a differnet pin for DC i think than pybadge

stuck elbow
#

I can't imagine how it would work on my prototype but not on the final pybadge

meager fog
#

:/

#

what not working

#

no display at all?

stuck elbow
#

a flash of correct content, and then suddenly white display

#

the program continues on running, no errors

gilded cradle
#

As @stuck elbow said. My badge code that I linked to runs fine though.

stuck elbow
#

I am reinitializing the display, that's probably throwing it off

#

@gilded cradle you didn't try with display = board.DISPLAY?

gilded cradle
#

I was able to use the frozen module when I compiled and that was already in there

meager fog
#

@timber mango do a hard reset

#

that will always clean u up

#

and then do a SWRST after

#

but give yourself maybe 50ms

#

@gilded cradle thanks, ill be rockin this badge

gilded cradle
#

πŸ˜ƒ

#

@meager fog, be sure to try the button code I added. πŸ˜‰ It changes the lights.

stuck elbow
#

I will try that

meager fog
#

oh kool i will!

gilded cradle
#

πŸ˜ƒ

ruby atlas
#

@gilded cradle Having the buttons work made the badge a lot more fun.

stuck elbow
gilded cradle
#

Sure

stuck elbow
#

much appreciated!

gilded cradle
#

No change even with adding display = board.DISPLAY

stuck elbow
#

and with the full re-initialization?

gilded cradle
#

Let me try another thing...

#

Nope, still doesn't work

stuck elbow
#

what happens when you just 'import ugame' from the REPL, without running the game?

upbeat plover
#

you got a reset pin on that display?

gilded cradle
#

I'll try

stuck elbow
#

@upbeat plover the init sequence resets it

gilded cradle
#

white screen

stuck elbow
#

@gilded cradle that's which which ugame.py?

gilded cradle
#

I'm not sure. I threw ugame.py (newest file) in lib

stuck elbow
#

can you freeze the one I linked?

upbeat plover
#

@stuck elbow looks like same init sequence as feather m4 minitft but is missing reset pin

stuck elbow
gilded cradle
#

I'll try. Do I need to edit it so that it has display = board.DISPLAY

stuck elbow
#

no, please use it exactly as it is in the repo right now

gilded cradle
#

Ok, I'll try that

upbeat plover
#

after spi unlock reset pin should be done?

stuck elbow
#

@upbeat plover FourWire does it

gilded cradle
#

Showed for a second, then white

stuck elbow
#

and importing it from REPL?

#

are you sure it's not using the pygame.py you have copied to /lib?

gilded cradle
#

Let me check

#

I think you meant ugame.py. I deleted the files from lib and same result. importing ugame from REPL resulted in just a white screen even after releasing displays before importing.

stuck elbow
#

and without releasing the displays?

gilded cradle
#

Same

stuck elbow
gilded cradle
#

Ok, just a moment

stuck elbow
#

btw, do a clean before recompiling frozen files

#

otherwise they don't get recompiled

gilded cradle
#

Yeah, I figured that out when it came back after 1 second the first time.

#

Anyways, lowering the frequency made it work for 2-3 seconds before going white

stuck elbow
#

O.o

#

I think I need to report a bug to the laws of physics

gilded cradle
#

Well, it's only working for about a half sedond before going white now

stuck elbow
#

when it goes white, is that instant, or can you see it getting filled?

gilded cradle
#

It shows the game animating for a moment before going white

stuck elbow
#

but does the white appear on the whole screen instantly, or does it get filled slowly with white?

manic glacierBOT
gilded cradle
#

instantly

stuck elbow
#

so it's something with the display

gilded cradle
#

Perhaps

stuck elbow
#

the code would need time to fill the screen white

#

it's not that fast

#

plus, it works on my prototype :/

#

which game is it, the vacuum invaders?

#

after about half a second it makes a sound

gilded cradle
#

Yeah, I'm not sure what's up with that. I could see if it does the same thing on another pybadge

stuck elbow
#

can you try jumper wire? it makes no sounds

gilded cradle
#

No sounds. Jumper wire from what to what?

stuck elbow
#

it's the title of that jumper game

#

sorry

upbeat plover
#

game jumper wire example

gilded cradle
#

Oh, sure I can try it

tulip sleet
#

jumper makes no sounds for me on pybadge; JP says the MakeCode folks aren't finished with sounds yet.

stuck elbow
#

@tulip sleet you mean it works for you?

tulip sleet
#

I was trying the MakeCode Arcade Jumper program (not sure about "wire"), testing the bootloader fixes last night that fixed the A/B button swap problem. But there's no sound: JP says that's expected.

OK, we are talking about different games, sorry

gilded cradle
#

Same result with Jumper Wire

stuck elbow
#

thanks

#

I give up, no more ideas

gilded cradle
upbeat plover
#

would reset pin make screen go white? lol sorry im stuck on reset pin

stuck elbow
#

yes

tulip sleet
#

@timber mango did you say you have a proto pybadge? There have been several pin revs, I think.

gilded cradle
#

I'll try a different pybadge, but I'm not sure.

stuck elbow
#

@tulip sleet but this is python code, it uses pin names from board, so it should be good

tulip sleet
#

but if the underlying PA PB pins are different, not OK? I mean electrically they chagned

#

which pin are you using for sound?

#

I'll look back at the older rev schematics

stuck elbow
#

board.SPEAKER, board.SPEAKER_ENABLE

#

but it's not sound

gilded cradle
#

Oh, one other thing I noticed @stuck elbow. After the screen goes white, it remains white (even with working code) until a hard reset is performed.

stuck elbow
#

the game without sound doesn't work either

upbeat plover
#

only idea i have is remove reset pin from fourwire, and call reset after spi unlock and see if that helps but that really shouldnt do anything different and if it does then some issue else were?

stuck elbow
#

@upbeat plover let's try this, if @gilded cradle is still up for it

gilded cradle
#

I'll give it a try

stuck elbow
gilded cradle
#

Ok, that version worked for like 10 seconds

stuck elbow
#

progress

gilded cradle
#

It seems to work somewhere between 2-10 seconds randomly

stuck elbow
#

battery?

gilded cradle
#

Plugged in via usb

stuck elbow
#

maybe the power dips?

#

it definitely looks like the display restarts

gilded cradle
#

Yeah, something like that

upbeat plover
#

😦

stuck elbow
#

crosstalk on the rst pin?

gilded cradle
#

I'm not having problems with normal displayio

stuck elbow
#

you are not sending a lot of data with it

gilded cradle
#

But also not much animation is occurring

stuck elbow
#

right

#

@gilded cradle thank you very much for helping me with this, I don't think we will be able to solve it like that

upbeat plover
#

would switching this line to```python
_reset.switch_to_output(value=0)

```python
_reset = digitalio.Direction.OUTPUT
#

do anything different?

stuck elbow
#

the second line does nothing

upbeat plover
#

it sets to output then the ```python
time.sleep(0.05)
_reset.value = 1
time.sleep(0.05)

be doing the work
manic glacierBOT
upbeat plover
#

never set to value zero?

gilded cradle
#

You’re welcome @stuck elbow

stuck elbow
#

it doesn't set anything to output, it just sets the variable _reset to point to the value digitalio.Direction.OUTPUT

upbeat plover
#
_reset = digitalio.DigitalInOut(board.TFT_RST)
_reset = digitalio.Direction.OUTPUT
time.sleep(0.05)
_reset.value = 1
time.sleep(0.05)

i thought tft_rst is

stuck elbow
#

first line sets the reset to DigitalInOut, second discards that and sets it to the other value

#

it doesn't do anything to that DigitalInOut

#

it's like:

x = 1
x = 2
upbeat plover
#
_reset = digitalio.DigitalInOut(board.TFT_RST)
_reset.direction = digitalio.Direction.OUTPUT
time.sleep(0.05)
_reset.value = 1
time.sleep(0.05)

o yes this then?

stuck elbow
#

not sure you can assign to direction

#

switch_to_output is for that

#

even if you can, it does the same thing

upbeat plover
#

that code is from digitalio example

#

in readthedocs

#

what is used to set LED pins high and low

#

@stuck elbow im sorry if im not much help just, im not a pro by any means just have theory your reset pin is doing something on the badge

main meteor
#

Looks like _reset is pointing to a DigitalInOut object, and is then controlled by assigning things to its members (like "direction" and "value").

tulip sleet
#

@timber mango what is the rev letter on your board? I think it's between the SPI flash and the I2C connector.

stuck elbow
tulip sleet
#

@timber mango, ok you have a very proto one, so maybe some pin changes. we need to get you a current one. limor is offline right now and I don't know the history of the pin changes

stuck elbow
#

@tulip sleet I don't think this problem is due to pin changes, I have a recent version of CircuitPython working on mine, just had to swap PA00 and PA01

#

it really looks like crosstalk between TFT_MOSI and TFT_RST or something like that

tulip sleet
#

when did you receive your board?

stuck elbow
#

04/11/2019

tulip sleet
#

there's no headphone jack on current boards, so I'm working backwards

stuck elbow
#

@tulip sleet I really think this is some kind of crosstalk problem on the rst pin on the new boards, or something similar

#

I can't imagine anything else giving this random effect

#

maybe power fluctuations

upbeat plover
#

the issue is with current boards not your proto board? your proto board screen doesnt go white?

stuck elbow
#

yes, precisely

#

that's why it's so hard to debug for me, it works for me

upbeat plover
#

yeah i think you need new board... lol the dev should have the newest version... just saying

stuck elbow
#

I'm not a dev

upbeat plover
#

oh i thought you dev the ugame stuff

stuck elbow
#

oh, of the ugame stuff sure, but that's not adafruit stuff

#

I have the latest version of Β΅Game :P

#

and all 10 prototype versions I made

upbeat plover
#

grats on hard work

tulip sleet
#

So here's a totally original idea, a @adafruit Feather Wing with LCD, 5-way button and a BB Q10 keyboard (I2C).
The LCD already works with @CircuitPython so just need some extra code for the keyboard. Note, this is just a mockup but the BOM would be fairly small...

Though...

A Feather Wing with a LCD, BB Q10 keyboard and a 5-way button. aka. Fauxberry

manic glacierBOT
tulip sleet
#

@timber mango look in #help-with-makecode for recent discussion about pin swap -- not sure it's relevant to the previous problem, though

manic glacierBOT
ruby atlas
#

@tulip sleet @slender iron Thoughts on naming? https://github.com/rhooper/Adafruit_Circuitpython_Dotstar4
https://github.com/rhooper/Adafruit_CircuitPython_Pypixelbuf

Still working on the neopixel library.

tulip sleet
#

@ruby atlas Hi! at the copyediting level, use "DotStar" instead of "Dotstar", and "PyPixelBuf" instead of "Pypixelbuf". Is that what you meant, or also the "4"?

ruby atlas
#

I wanted to start the discussion on the naming. I chose 4 because it's for CircuitPython 4 and up.

#

@merry turret I'll rename the repos (and copyediting).

#

OK Those two renamed, now to check for copy-editing errors.

tulip sleet
#

@ruby atlas I didn't mean literally copy-editing except for the repo names.

ruby atlas
#

There's some capitalization errors in the contents too πŸ˜ƒ

tulip sleet
halcyon breach
#

The circuitpython express is too much fun!

tulip sleet
#

it would certianly be unpythonic to do this in general, but I did the same thing (bit-encoding) in the HID library a long time ago, and it saved a LOT of space

ruby atlas
#

I tried to be pythonic with the classes so we could differentiate between RGB, RGBW and RGB(L=brightness) in the implementations.

#

I agree it uses a fair bit of space. I tried going through and removing classes, but got super nervous about removing some.

#

The other possibility is to have a single class and initialize them at load.

tulip sleet
#

i think having an integer const for each would be fine, and you could extract the necessary info by bit operations

#

they're basically opaque names to the end user

#

i'd think

#

so their representation doesn't matter to the end user

knotty cypress
ruby atlas
#

@merry turret I made properties on the byte-order classes so you can retrieve the BPP and/or white and/or luminance settings. I guess we're not losing too much if I go and remove that to save space.

trim elm
#

Quick question. I was restoring the firmware on my feather M0 because it wouldn't let me write and gave me a read-only filesystem error. Now it only mounts FEATHERBOOT. Does this mean it's dead?

tulip sleet
#

you could have a single class that stores an integer and properties to extract those values from the integer. The constants would be instances of a single class instead of singletons

manic glacierBOT
#

As we have the _stage module to work with displayio, and the stage and ugame modules frozen on the pybadge, all of the Β΅Game games should JustWorkβ„’ on it. And that is indeed how it is on the version D prototype of pybadge that I have and that I have tested it all with. It also works with itsybitsy m4 express with a display connected, and with the minitft featherwing on a feather m4 express, and even on hallowing and of course the Β΅game.

However, when I asked people to try those...

ruby atlas
#

@tulip sleet Yep, I think that makes sense.

#

I hope I can find time to do that before my free time vanishes.

tulip sleet
#

@ruby atlas we have to find another conference for you to go to.

ruby atlas
#

Preferably people will also respect my requests for minimal meetings too.

manic glacierBOT
tulip sleet
#

@trim elm what .uf2 did you copy to the Feather M0?

trim elm
#

update-bootloader-feather_m0_express-v3.3.0-adafruit.10.uf2

tulip sleet
#

that's the bootloader itself, not the CircuitPython firmware. Go to https://circuitpython.org and download the latest version of CircuitPython for the board, and drag that to the BOOT drive.

trim elm
#

Ah, that makes sense. Thanks!

tulip sleet
#

once you've done that, connect via the REPL and do:

import storage
storage.erase_filesystem()

that will reformat CIRCUITPY (and erase it)

trim elm
#

Ok

slender iron
#

@ruby atlas I don't understand what naming. Can't we just release a new version of the existing library?

ruby atlas
#

We could, but then we have to deal with non-express boards needing new instructions (eg: install pypixelbuf).

slender iron
#

that's ok with me

#

having pixelbuf is where we're going

ruby atlas
#

That seems like a lot of broken guides and tutorials and educational content.

slender iron
#

then let's fix them

#

these are all onetime costs versus having two libraries in the long term

#

we can make sure the error message is good too

manic glacierBOT
ruby atlas
#

The underlying import is still the same with pixelbuf compatible libraries. How do we make sure we can do the migration gradually and painlessly? While the hard cutover is cleaner in one way, I worry about the amount of pain and extra work doing it so will cause. For the boards that freeze NeoPixel or Dotstar it will still work as expected.

slender iron
#

It's worth a little pain

#

we can ease it by documenting the change well

trim elm
#

Is there a way to be able to read and write to the filesystem? I'm able to boot it in read mode and boot it in write mode, but I can't figure out how to do it simultaneously.

slender iron
#

@trim elm you can but it has a higher risk of corruption

trim elm
#

Ok. Thanks. I think I'll just hook up a switch for grounding the pin to switch the read/write mode.

slender iron
#

πŸ‘

old smelt
#

I am interested in porting CircuitPython to a 32-bit NIOS II micro on an Intel MAX 10 FPGA. Are there any instructions for a ground-up build like that?

I have done some digging around, and most of what I can find still presumes that the final target is a SAMD of some kind.

It looks like MicroPython was ported to the Zephyr RTOS which can run on a NIOS II. And there appears to be a fork of that port for CircuitPython, also. So, that's a possible path, but a native build for the NIOS seems like it would be more optimized in the end.

I also assume the first hurdle is getting the UF2 bootloader running on it. Lady Ada's UF2 video from about 2 years ago seemed to suggest that UF2 could only be used with SAMD devices. Is that still the case?

A lot to learn, here.

Any thoughts? Thanks!

tulip sleet
#

@old smelt There is also an nRF52 UF2 bootloader.

The hard part in most ports is supporting the chip-specific periperhals (I2C, USB, etc.). Does this FPGA impl include a USB peripheral? That's kind of central to CircuitPython's workflow (CIRCUITPY).

Our fork includes port/* inherited from MicroPython, but that does not mean we support most of those boards: we have just not removed them from our fork, so that merging from upstream is easier.

We have talked some about a Zephyr port, but that's a significant amount of work too. If Zephyr already support the NIOS II peripherals well, that might be attractive.

manic glacierBOT
old smelt
#

Thanks @tulip sleet. Yes, the Particle boards are nRF52 based, correct? And they support CP, so that makes sense.

#

I believe we could clear the USB hurdle, as well.

#

Thanks for the clarification on the ports. That makes sense with what I see in the repo.

manic glacierBOT
old smelt
#

Our hardware is FPGA-centric, but I am fascinated with CircuitPython and would love to find a way to get it running on one of our boards. I think it could open the doors for some cool CircuitPython + FPGA integrations.

tulip sleet
#

@old smelt the architecture is not ARM, right? What version of gcc are you using? We're on 7.3.1 and will move up to 8 soon.

old smelt
#

That's correct, it is not an ARM core.

tulip sleet
#

what size of RAM and flash are available?

old smelt
#

Don't have that at my fingertips. Hold on...

raven canopy
old smelt
#

Thanks @raven canopy . I was just looking at that earlier today, as well.

#

I will revisit that project, as well.

old smelt
#

@tulip sleet - looks like the M50 has ~204KB RAM and 736KB Flash. The flash includes storage for the FPGA image, and I'm not sure how much of the FLASH that uses up. When we first started talking about this, I thought that if we targeted a config similar to the M0 Express (256KB flash + 32KB RAM), that would be a great starting point.

#

Lots of tradeoffs to consider...

tulip sleet
#

that's quite good, assuming say 256-400k flash is available. Depends on the machine code density for this architecture. The SAMD51J19's we use are 192kB of RAM. 32kB of RAM is pretty minimal: we only end up with a 20kB heap or so, so even 64kB is a lot better.

old smelt
#

Ok. Thanks. I'm pushing internally to see what we can make happen. I think it could be very interesting.

#

My long-term utopian target is Python as a design entry language for high-level synthesis. Projects like FuPy and MyHDL are moving things in the right direction, and I see the rise of MicroPython and CircuitPython as key technologies that clearly enable and promote Python on small hardware platforms.

#

There's a lot of work to do to make that happen. But it's fun to think about.

slender iron
tulip sleet
#

on it

slender iron
#

thanks!

manic glacierBOT
manic glacierBOT
manic glacierBOT
slender iron
#

@solar whale are you around the next few days? I think I have a fix for internal flash nrf

solar whale
#

@slender iron yes. I’ll be happy to test it.

slender iron
#

k, thanks! pushing shortly

solar whale
#

Woohoo! pr_1870 works on the pca10059

slender iron
#

great!

solar whale
#

will test the others in a few minutes

slender iron
#

thanks, I have a feeling it's the same issue

#

it was trying to write out the cache when it had to content (and therefore address 0xffffffff)

solar whale
#

yup - works fine on the makerdiary_nrf52840_mdk_usb_dongle

#

Thanks for the quick fix!

slender iron
#

np, trying to get everything in for an rc.2 that we can call stable next week

solar whale
#

OK an all three -- sparkfun_nrf52840_mini works!

slender iron
#

thanks!

solar whale
#

now just verifying it is OK on the express boards πŸ˜‰

#

all good - feather_nrf52840_express OK -- I'll try to run more tests on the boards onver the next few days.

slender iron
#

k, np. it's a small change from me

#

just a fix on nickzoic's pr

solar whale
#

amazing what a "one-liner can do" πŸ˜‰

#

I'll add a note to the PR

slender iron
#

πŸ‘ thanks!

manic glacierBOT
slender iron
#

tries to figure out why on_next_reset is separate

karmic notch
#

Does cpx.pixels.fill have an internal delay set in circuit python?

manic glacierBOT
karmic notch
marble hornet
#

i'm trying to freeze my tg_gui into the firmware. i cloned my repo into $(TOP)/frozen/tg_gui i added :FROZEN_MPY_DIRS += $(TOP)/frozen/tg_gui/system.py FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlaygroun
to the mpconfigboard.mk file. i get this error: FREEZE ../../frozen/tg_gui ../../frozen/Adafruit_CircuitPython_CircuitPlayground ../../frozen/Adafruit_CircuitPython_HID fatal: No names found, cannot describe anything. fatal: No names found, cannot describe anything. Traceback (most recent call last): File "../../tools/preprocess_frozen_modules.py", line 14, in version_string tag = subprocess.check_output('git describe --tags --exact-match', shell=True, cwd=path) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 395, in check_output **kwargs).stdout File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 487, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command 'git describe --tags --exact-match' returned non-zero exit status 128.
but without the tg_gui folder added to the libraries to freeze it compiles and i can import adafruit_circuitplayground on an itsybitsy m4

raven canopy
#

@marble hornet "cloned my repo", how? git clone or git submodule add?

marble hornet
#

git submodule add

exotic pumice
#

does it need to be tagged?

raven canopy
#

did you run update afterwards?

#

i think you still need to run git submodule update --init --recursive after adding.

marble hornet
#

yes

#

i'll re-run it just in case

#

yep, it shows up in synchronized modules

manic glacierBOT
marble hornet
#

how does FREEZE know how to look for the specific py files inside of Adafruit_CircuitPython_CircuitPlayground. since the files to compile are inside of a folder inside of Adafruit_CircuitPython_CircuitPlayground?

#

hrmm...

#

i can freeze each module individually by hand

manic glacierBOT
tulip sleet
#

@marble hornet See these files:

$ ag PREPROCESS_FROZEN
mkrules.mk
125:    $(Q)$(PREPROCESS_FROZEN_MODULES) -o $@ $(FROZEN_MPY_DIRS)

mkenv.mk
76:PREPROCESS_FROZEN_MODULES = PYTHONPATH=$(TOP)/tools/python-semver $(TOP)/tools/preprocess_frozen_modules.py
marble hornet
#

on it

exotic pumice
#

πŸ˜›

tulip sleet
#

@marble hornet if you just make your files/directories look like the frozen modules, you'll be OK. You need to tag the submodules so it can put in version info.

marble hornet
#

okay...

#

tag. like change the file ending?

tulip sleet
#

no, a git tag, a version number

marble hornet
#

ah, okay

exotic pumice
#

called it an hour ago (sorry if I'm being annoying, I had too much coffee)

tulip sleet
#

do you just have some random files you want to freeze? I think you can also still use FROZEN_MPY_DIR (not FROZEN_MPY_DIRS), and point it at a directory (don't use frozen)

#

that does not get preprocessed, if I remember right

pastel panther
#

hey @trim elm did we meet at PyCon?

trim elm
#

Yeah

pastel panther
#

Sorry but I met a lot of people. Which of them were you?

#

(I'm also bad with names)

trim elm
#

I was the high-schooler who was working on the gps featherwing

pastel panther
#

and the ADCs?

trim elm
#

You gave me the circuit python card with your discord on it

#

Yeah

pastel panther
#

hey!

trim elm
#

hi!

exotic pumice
#

ooh ADCs you say?

#

I just wrote an ADC abstraction layer

marble hornet
#

@tulip sleet thank you. i;m trying the dir (no s) method 🀞

#

nope!

trim elm
#

@exotic pumice Cool. No clue what that is, but it sounds interesting.

exotic pumice
#

I made a more user-friendly interface for ADCs in Rust. Think like arduino's analogRead()

#

@trim elm What are you working on with ADCs?

trim elm
#

Cool. I was changing the circuitpython library for a 12 bit ADC to output an 16 bit value

exotic pumice
#

just upscaling or?

#

whats your use case?

marble hornet
#

@tulip sleet i turned all the files into bytecode then tagged them all. FREEZE ../../frozen/tg_gui mkdir -p build-itsybitsy_m4_express_gui/frozen_mpy PYTHONPATH=../../tools/python-semver ../../tools/preprocess_frozen_modules.py -o build-itsybitsy_m4_express_gui/frozen_mpy ../../frozen/tg_gui cd build-itsybitsy_m4_express_gui/frozen_mpy && \ find -L . -type f -name '*.py' | sed 's=^\./==' | \ xargs -n1 "/Users/jonahym/Documents/circuitpython/cp_with_gui/circuitpython/mpy-cross/mpy-cross" Creating build-itsybitsy_m4_express_gui/frozen_mpy.c python3 ../../tools/mpy-tool.py -mlongint-impl=mpz -f -q build-itsybitsy_m4_express_gui/genhdr/qstrdefs.preprocessed.h > build-itsybitsy_m4_express_gui/frozen_mpy.c usage: mpy-tool.py [-h] [-d] [-f] [-q QSTR_HEADER] [-mlongint-impl {none,longlong,mpz}] [-mmpz-dig-size N] files [files ...] mpy-tool.py: error: the following arguments are required: files make: *** [build-itsybitsy_m4_express_gui/frozen_mpy.c] Error 2 make: *** Deleting file `build-itsybitsy_m4_express_gui/frozen_mpy.c'

tulip sleet
#

make sure to make mpy-cross

marble hornet
#

i'll re-make it

tulip sleet
#

cd circuitpython; make -C mpy-cross

trim elm
#

@exotic pumice I was sprinting with them at pycon and that was an issue I decided to try and solve. I think that the purpose was just for consistency

tulip sleet
#

it's possible the singular DIR doesn't work any more

exotic pumice
#

@trim elm ok cool

marble hornet
#

i tried w/ and w/out s

tidal kiln
exotic pumice
#

interesting

trim elm
#

Oh, yeah. I meant 16 bit not 18 bit

tidal kiln
#

for AnalogIn.value anyway

manic glacierBOT
exotic pumice
trim elm
#

Does anyone know if I can write to an external adalogger from a feather M4 if the feather's filesystem is in read-only mode

tidal kiln
#

should be able to. in that case you're writing to the SD card on the adalogger

#

which is separate from the CP filesystem

marble hornet
#

@tulip sleet and @exotic pumice thank you, i'v got them all compiling and builtin. but they are all next to eachother in freeze. working on keeping them all in tg_Gui

exotic pumice
#

cheers

marble hornet
#

hrmmm so tagging is not file specific?

#

and you totally called it

tulip sleet
#

you tag a commit

raven canopy
#

hmm. i thought the submodule commit tag would work, but πŸ‘ @exotic pumice!

trim elm
#

@tidal kiln Ok. Thanks. I'll try that tomorrow. Hopefully it works since it's a pain to have to reboot it every time I want to change any code.

marble hornet
#

you need to tag while inside of the submodule

#

tagging outside of it does not work

tulip sleet
#

right. our submodules are tagged in their own repos and when they are brought in, the tags come with the commits. You could tag your libraries in their own repos and update them in your cpy build tree as necessary

marble hornet
#

do i tag then commit or commit then tag?

raven canopy
#

tag a commit. for instance, CP libraries are tagged at the last commit upon release. (i've never git tagged outside of a release in GitHub...don't assume i'm smart on the subject. πŸ˜„)

marble hornet
#

ah okay

#

i have it almost working

tulip sleet
#

@marble hornet you can tag and then push the commit. You can do git push --tags to make sure it goes up to github

marble hornet
#

will do

#

thank you @tulip sleet and @raven canopy and @exotic pumice ! it's (almost) working! i just need to do some reorganization

exotic pumice
#

lol it costs $11 to ship a 7g blinka pin 😦

#

πŸ‡¨πŸ‡¦

#

maybe I'll try to get it ordered from bc-robotics

#

y'all gotta give them some love though, they don't even have any M4s I don't think

#

when pygamer comes out can I get one through a distributor or is it adafruit-only?

tulip sleet
#

@exotic pumice Ask your distributor. I don't know how things are allocated to distributors. Quantities are limited when something first comes out. Some distributors only stock a limited selection. The larger distributors like DIgi-Key and Mouser have a wider selection.

exotic pumice
#

yeah, just wondering if there's some kind of rule that you only sell direct to consumer for the first few batches, or otherwise

#

I'll keep my eyes peeled for the notice of them going in stock and see if I can get my distributor to order them

#

oh hold up

#

is dc supposed to be high for commands?

main meteor
#

What am I looking at here? Looks like a weird dialect of VHDL.

exotic pumice
#

it's rust

#

but a kinda particularly janky example

#

it's not always that ugly

main meteor
#

Yeah, the unrolled bitwise copy seemed oddly verbose.

tulip sleet
#

i don't know the answer to your DC question, but could you combine data0-data7 into a single byte which you write in parallel? Otherwise it defeats the purpose of parallel write

exotic pumice
#

not easily

#

I timed it and it's still only like 20ms update

#

which is like 50fps

#

I think I have an issue with dc though

#

oh nevermind, I see what it's doing now

tulip sleet
#

the lower level CMSIS-style API could take data in parallel. Take a look at the C code we use

#

the CPU time spent doing this could be doing other things

stuck elbow
#

ah, sorry, unless you use the parallel interface

exotic pumice
#

yeah, I'll get to optimizing it, but first I need something to work

main meteor
#

I know that feel.

tulip sleet
#

understand - yes

exotic pumice
#

the problem with using the lower level interface is it's not portable

#

rust drivers generally try to be portable across the ecosystem

tulip sleet
#

but could the upper-level driver provide a parallel write which would be implemented in different ways per port?

exotic pumice
#

yeah, I kind of want embedded-hal to make up a port interface

#

like, right now we just have pin-level reads and writes for the hal

#

as portability abstractions

tulip sleet
#

in our case, displayio takes a starting pin and assumes the rest are consecutive, so it can do them in parallel

#

agree, though, get it to work first. we have a lot more optimization to do too

exotic pumice
#

mhm, but I don't have a cross-mcu way of representing a port

#

or group of pins

tulip sleet
#

yes, displayio takes that directly, so itself is the hal and short-circuits any intermediate layers

exotic pumice
exotic pumice
#

every hal author uses these common sets of traits, and then drivers build on top

tulip sleet
#

in our case, the use of the consecutive pin is implied by the starting pin

exotic pumice
#

yeah I don't think I can do that

tulip sleet
#

we could also take multiple pins in the constructor, and then check that they satisfy a constraint for that particular port (e.g. consecutive, on a pin number byte boundary, etc.)

#

i think it's worth discussing with the API authors, because parallel data is a needed thing

exotic pumice
#

yeah I'm working on it lol

#

generally the common api is a great strength, but there are gaps

slender iron
#

@exotic pumice we do usually restrict first batches to adafruit.com only so that we can do customer support directly if anything comes up. after the first few we're pretty confident that the kinks have been worked out

exotic pumice
#

ok good to know, thanks @slender iron

upbeat plover
#

i got my CPX back from a friend last night, tested play_melody(), worked well. I notected there is an open issue with CPX for sine waves playing not very loud. Can add optional parameter to _sine_sample() for slight volume control, normal no parameter change, or louder or quiter setting. adding it to that would also need the option placed in play_tone() start_tone() and play_melody(). but for play_file() you would need to control volume within the .wav file

manic glacierBOT
meager fog
#

@gilded cradle p0ng if yr back

gilded cradle
#

Not quite back yet, but I should be home this afternoon.

#

But I got a few moments

meager fog
#

you wnana write up a guide for pybadge to use your code?

#

i thought it would be cool to show how to use different languages

#

so you could have it say "Hello my name is: <name>" but in a variety of languages, since we have unicode

gilded cradle
#

Yeah, definitely. I was thinking about asking you about doing that.

meager fog
#

you'd have to find fonts that have all unicodes in em, but im sure they exist out there πŸ˜ƒ

#

kool!

#

assign yrself πŸ˜ƒ

#

it would really show off the power of python since arduino cannot do multilang

gilded cradle
#

Ok cool.

#

Is that in basecamp?

meager fog
#

yep plz add so you have it tracked

gilded cradle
#

Will do

exotic pumice
#

I could use another pair of eyes

#

is there any initialization that changes between 8bit and spi?

#

I read it was set by pins on the display

meager fog
#

heya saj, the init sequence is the same, but this isn't gonna be a good place to get rust support - i dont think anyone here knows rust :/

#

they may have their own discord servers with rustxperts? πŸ˜„

exotic pumice
#

yeah fair enough, my bad. just thought you guys know the displays

#

and the code is like, set this pin high, set this pin low

meager fog
#

we have code you can look over - but no rust experience - check the code for arduino and/or circuitpyt. good luck! πŸ˜ƒ

exotic pumice
#

thanks

#

a display question then? is it fine to leave cs low the entire time?

#

or better to have it only when writing

meager fog
#

i dont know off hand - whateevr we do in our arduino/cicuitpython lib is what you can follow. can also read the DS, they'll have a timing diagram

gilded cradle
#

It depends on the display. For instance the ST7789 requires a CS toggle between each command.

celest zenith
meager fog
#

just a PR is fine πŸ˜ƒ

exotic pumice
#

ok thanks @gilded cradle, I'll try changing that section of my code

gilded cradle
#

Cool

meager fog
#

thanks melissa, you def know your displays better than me now

manic glacierBOT
meager fog
#

@exotic pumice you can also try putting the pyportal display into SPI mode with the back solder jumper/s

exotic pumice
#

it's not my pyportal, the person who has it was hesitant to do that

meager fog
#

ooh ok

#

im sure y'all will get it working!

#

one thing to use for testing is the invert command, once its inited

#

its a simple one byte command so good for testing

exotic pumice
#

thanks, yeah I can't even get it initialized

manic glacierBOT
tulip sleet
#

@gilded cradle I think @upbeat plover might have such a universal font

manic glacierBOT
gilded cradle
#

Oh right @tulip sleet, from working on the Chinese Translation.

upbeat plover
gilded cradle
#

I think my badge used 3 different fonts, though I could bring it down to 2 if needed, so I gotta look into what works best.

upbeat plover
#

for displays you really need fonts, for like serial/REPL you can use unicode but it wont show up on displays without the unicode for the glyph in the font

gilded cradle
#

Yeah, it's for the displays. I think she was saying to use fonts that have all the glyphs so we can support many languages.

upbeat plover
#

@gilded cradle if you find a font you like missing some accents i might beable to add them for you.

gilded cradle
#

Awesome, thanks @upbeat plover

meager fog
#

yah - like i think arial is a 'complete' font

#

they're like 1mb but they have everything

gilded cradle
#

Yeah, I used Arial, Verdana, and Comic

upbeat plover
#

i like bold arial, nice font there

manic glacierBOT
#

Are early returns OK? I can refactor this into 2 functions, one checking if the value is valid (with early returns if it's not) and one raising for invalid values.

Also: do I need to do any memory management here, or will the GC take care of cleaning up any big ints that I'm creating here? I tried calling this in a loop and it didn't seem to leak (or, rather, the memory climbed until I called gc.collect and then dropped back down) - but I don't understand how it worked, so I might st...

slender iron
#

@stuck elbow you around? looking at your bug now

#

it doesn't repro if I use the already inited display

manic glacierBOT
#

So the version that does a re-init mostly works. I think the checked in version suffers from leaving reset floating and therefore very susceptible to cross talk. It doesn't look like a hardware issue to me. (And therefore you should be able to reproduce with yours as well.)

It looks like it's still fighting the native screen update where the terminal is still attempting to show on the screen. _stage should set the display to showing it own empty group so that prints don't trigger a displ...

stuck elbow
#

@slender iron gc fun again?

manic glacierBOT
upbeat plover
#

I'm not sure what I did wrong on cpx PR for volume and melody, but no travis check? should i just close and update the melody only PR? can you only have one PR at a time?

manic glacierBOT
slender iron
#

it looks like you reviewed it

slender iron
#

@tulip sleet I have two PRs out to you. they are the last we need for a new rc I think

tulip sleet
#

yes, I'm working on some bootloader stuff for PyBadgeLC. Still need to test yours. Can you wait until tonight? I have to

#

go out for a few hours

slender iron
#

ya, waiting is fine. just want it out by end of tomorrow

trim elm
#

So I think I might have found another issue with travis

#

It keeps failing and it says:

#

../README.rst::image file not readable: docs/_static/circuitplayground_express.jpg
The command "cd docs && sphinx-build -E -W -b html . _build/html" exited with 2.

#

I've verified that the image is readable

slender iron
#

My guess is that it needs to be "./static/" to make it relative

trim elm
#

Ok. I'll try that

upbeat plover
#

travis is working now for the cpx PR "volume and melody", travis must have just been busy?

slender iron
#

ya, library builds can get stuck behind the circuitpython build

trim elm
#

Failed again with the same error

tidal kiln
#

@slender iron w.r.t. BNO055 review - just wearing multiple hats. was basically just trying to get them green in travis, after that I tagged it for review by CP Librarians. which is where it's currently sitting.

slender iron
#

I saw that. I'm not sure what is left though for review

tidal kiln
#

you're probably right. i can put on my CP Lib hat and go check again and merge etc.

slender iron
#

k, thanks!

raven canopy
#

@trim elm i built it local with ../docs/_static.... responded to the PR.

trim elm
#

Ok. Thanks! I'll add that

tidal kiln
#

just got back from lunch / errands. also will try to check out your PR for that displayio.Group fix.

trim elm
#

It passed on the server as well

raven canopy
#

@upbeat plover got a moment to discuss your 2 CPX PRs?

upbeat plover
#

sure

#

currently have "volume and melody" on my cpx testing stuff...

raven canopy
#

k. I hadn't merged #52 yet; got side-tracked. but now #57 has the same updates as #52, but they also differ slightly (volume in play_melody, removing the length kwarg in _generate_sample()).

upbeat plover
#

would it be better if i didnt merge volume with melody? like have PR for melody and PR for volume seperate?

raven canopy
#

yeah, i would say so. will require some git-fu for #57 (just a git pull to merge in upstream merges).

#

lets work #52 real quick.

upbeat plover
#

@raven canopy not sure how i did that or why.... dargh

#

i think i added the param back

raven canopy
#

hehe. all good. i have way more mistakes then non-mistakes. πŸ˜„

#

@upbeat plover i would just git revert those last two commits for #52. then if you still want to change all of that up in #57, you can. I am not sure that the math will work out for frequencies >3500, and I have to run out for the evening.

upbeat plover
#

im not sure how you do that i only use web browser github

raven canopy
#

hmm. yeah, i'm not sure you can revert on github...

upbeat plover
#

yeah... it kind of embarrassing people can 100% see how i do stuff lol.... and all the mistakes i make, but im like hey w/e true open source right?

raven canopy
#

i feel ya. but mistakes are how we learn, and around here we try to celebrate that. i gotta run. taking my lappy with me, so i may get a chance to look in a few.

upbeat plover
#

testing current cpx PR #52, seems to be working

main meteor
#

Some of my favorite youtube channels are people trying to build or fix stuff and if it all goes wrong they show it anyway.

upbeat plover
#

@raven canopy i like PR #57, can we focus on that one and close #52, current #57 can do everything #52 can but has added volume control over; play_tone, start_tone, and play_melody

#

looks like it takes up a chunk of mem after from adafruit_circuitplayground.express import cpx 144 differents gc.mem_free() between current build and PR #57 πŸ˜’

trim elm
#

Could someone please close issues 15 and 19 on the CircuitPython GPS library? PR #22 fixed them.

stuck elbow
#

@trim elm you mean 21?

trim elm
#

Yes

stuck elbow
#

done

trim elm
#

Thanks!

manic glacierBOT
tulip sleet
#

@slender iron I am back from dinner but have to do something else. I'll start reviewing PR's later tonight.

tidal kiln
#

@slender iron thanks for the ADS1x15 attention. i'll close related issues and tag a release.

slender iron
#

np, thanks!

manic glacierBOT
#

@gvcp responses to your previous questions:

the startup issue

this works for me:
code.py

It's getting an address by DHCP, then connecting to example.com.
It spins for a few seconds waiting for the DHCP address.
Now, interestingly, socket.getaddrinfo() and socket.socket() work even without a network, if you pass it a numeric address anyway. So it's not so much a question of whether the socket has been s...

manic glacierBOT
manic glacierBOT
manic glacierBOT
fierce girder
#

Hello, I am curious if there might be anyone working on cap touch for the M4?

#

I see last comment was from March

#

I have a friend that would love to use cap touch with the M4 boards but looks like there still a lot of work to do?

lone sandalBOT
tulip sleet
manic glacierBOT
fierce girder
#

Thanks for the update

lone sandalBOT
manic glacierBOT
slender iron
#

@knotty cypress I'm going to merge translations into your PR for you

knotty cypress
#

Thumbs up

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#
[adafruit/circuitpython] New tag created: 4\.0\.0\-rc\.2
meager fog
#

@slender iron ^^^ blinka_cooking πŸ˜ƒ

slender iron
#

πŸ˜ƒ doing release notes now

solar whale
#

Friday night releases ... not for the faint of heart πŸ˜‰

orchid basinBOT
meager fog
#

@gilded cradle ok with ST77xx done, wanna do HX8357 and ILI next?

#

and then we'll sweep thru the repos to see any still using the older spi commands and if none, we'll protect em

gilded cradle
#

I think I already did the hx8357

meager fog
#

oh yah?

gilded cradle
#

Yeah

#

Let me check

meager fog
#

doesnt seem so

#

or is that the one we don't do

gilded cradle
#

That’s the one we don’t do

#

See how the others funcs have sendCommand

#

Did we want to add readCommand into GFX?

meager fog
#

umm yeah please do

#

i was just thinking but yes we do use it for ILI9341 to identify connection

#

so we should just do em

gilded cradle
#

Ok, Cool. I'll do that next then

gilded cradle
#

@meager fog, it looks like the readcommand8 functions are different between the HX8357 and ILI9341. It appears the ILI9341 is a little more "specialized".

meager fog
#

they are somewhate specialized, but maybe there's some way we can generalize? :/

gilded cradle
#

Yeah, I'll play around with it and see if I can get it to play along.

manic glacierBOT
meager fog
#

btw we finally have tons of grand centrals in stock

#

@ruby lake if ya wanted to pick up a bunch, now is the time

tidal kiln
#

what's the std. approach for getting library examples with a blinka/pi setup?

manic glacierBOT
meager fog
#

@tidal kiln whatcha mean?

tidal kiln
#

pip gets the library

#

but for the examples, what's best to show in a guide?

#

esp. for this one, since it's more than just a single .py file

meager fog
#

ohh i'd have em do a wget

#

that works pretty easily

gilded cradle
#

Yeah, forgot I changed a parameter name. Was just pushing now

tidal kiln
#

@meager fog thanks. trying to get that to work for an entire folder, but can't seem to get it to work.
but maybe moot..OK with just using the git clone approach in BNO guide?

main meteor
#

I take it you've worked out most of the production issues with the fine pitch chip on the Grand Central?

manic glacierBOT
meager fog
#

@tidal kiln try like wget -r for recursive?

tidal kiln
#

tried that a bit. i think it's a github limitation maybe?

#

it 404's with a -r

raven canopy
#

@tidal kiln which url are you using?

tidal kiln
#

raw.githubusercontent.com for the base

raven canopy
#

k. that'd be my rec. jus checkin! πŸ˜„

tidal kiln
#

so basically just hoping for a one liner to download that whole folder locally

raven canopy
#

well, once i get the build-tools to recurse subfolders merged (again, without breaking stuff), you could point to the release bundles. not sure how to do it in an easy future-proof way though.

tidal kiln
#

that'd be a zip of the whole bundle?

raven canopy
#

yeah, but just the examples. currently, that particular one only contains a single example file.

tidal kiln
#

ah. i see. it's not the whole bundle - just for that repo

raven canopy
#

yeah. circuitpython-build-tools runs for both the whole bundle and each individual library.

tidal kiln
raven canopy
#

yep. i wonder if there's a way to do it with PyPI/setuptools. i doubt it...but i'll look.

tidal kiln
#

i know that's been a general limitation before

#

but thanks for the examples.zip idea. i think i'll go with that. that's a little more familiar than git clone.

#

and also realizing need to do a version bump on that repo

raven canopy
#

there's quite a few that could use it. i was planning on hitting some of the list a little this weekend.

manic glacierBOT
#

On Sat, 11 May 2019, at 03:16, gvcp wrote:

Is the uf2 image for the feather M4 express with the changes blow available anywhere for further testing ?

It's in the latest Release Candidate: https://github.com/adafruit/circuitpython/releases/tag/4.0.0-rc.2 (click on "Assets" down the very bottom of that page)

Doesn't mean we won't keep fixing stuff ... thanks for your help with testing and keep reporting issues if you find them!
For starters, I'll raise a separate issue for fixing up the ex...

manic glacierBOT
lone sandalBOT
manic glacierBOT
solar whale
#

Trying rc2 on a feather_nrf52840 _express (with a tft featherwing)-- my ususal sdcard mounting fails with ```
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 4.0.0-rc.2 on 2019-05-10; Adafruit Feather nRF52840 Express with nRF52840

import sdmount_lib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "sdmount_lib.py", line 9, in <module>
File "adafruit_sdcard.py", line 113, in init
File "adafruit_sdcard.py", line 145, in _init_card
File "adafruit_sdcard.py", line 236, in _cmd
OverflowError: value would overflow a 1 byte buffer

#

code executed was ```import adafruit_sdcard
import busio
import digitalio
import board
import storage
import sys

Connect to the card and mount the filesystem.

cs = digitalio.DigitalInOut(board.D5)
sdcard = adafruit_sdcard.SDCard(board.SPI(), cs)
vfs = storage.VfsFat(sdcard)
storage.mount(vfs, "/sd")
sys.path.append("/sd")
sys.path.append("/sd/lib")

#

Will do some more checking before filing an issue

tulip sleet
solar whale
#

@tulip sleet thanks. I guess the sd card lib needs some work to be compatible.

#

I’ll try to look at it tomorrow and at least file an issue. I’ll be gone for two weeks on Monday...

tulip sleet
#

I see the issue in the libary, or at least the first issue πŸ˜ƒ

solar whale
#

πŸ˜‰

tulip sleet
#
        buf[0] = 0x40 | cmd
        buf[1] = arg >> 24
        buf[2] = arg >> 16
        buf[3] = arg >> 8
        buf[4] = arg
        buf[5] = crc
#

these need to be narrowed to 8 bits

solar whale
#

Just needs a few &0xff

tulip sleet
#

I'll submit an SD card lib issue.

solar whale
#

Thanks! Glad it’s a simple fix...

solar whale
#

I hope to have time tomorrow to try it.

tulip sleet
solar whale
#

We’ll see how many PyPortal examples are broken by it πŸ˜‰

upbeat plover
#

closed cpx PR for melody, when i first started it i though i need to edit frozen but can just do this

from adafruit_circuitplayground.express import cpx
import time

def play_melody(frequencies, durations, speed=10):
    for idx, frequency in enumerate(frequencies):
        if frequency != 0:
            cpx.start_tone(frequency)
        time.sleep(durations[idx]/speed)
        cpx._sample.stop()
    cpx.stop_tone()

notes = [293, 440, 440, 0, 330, 494, 349, 523, 523, 0, 330, 494,
293, 440, 440, 0, 330, 494, 349, 523, 523, 0, 330, 494,
293, 349, 587, 293, 349, 587,
659, 698, 659, 698, 659, 523, 440,
440, 293, 349, 392, 440, 440, 293, 349, 392, 330,
293, 349, 587, 293, 349, 587,
659, 698, 659, 698, 659, 523, 440,
440, 293, 349, 392, 440,
440, 293]

beats = [2, 2, 2, 1, 1, 4, 2, 2, 2, 1, 1, 4,
2, 2, 2, 1, 1, 4, 2, 2, 2, 1, 1, 4,
1, 1, 4, 1, 1, 4,
3, 1, 1, 1, 1, 1, 4, 2, 2, 1, 1, 6,
2, 2, 1, 1, 6,
1, 1, 4, 1, 1, 4,
3, 1, 1, 1, 1, 1, 4, 2, 2, 1, 1, 6,
2, 6]

while True:
    play_melody(notes, beats)
    time.sleep(2)

cpx PR #57i feel that is needed, but i removed melody from it. no way to control volume in tones without something changed

#

@raven canopy

#

also, melody not in frozen alows you to put code in the loop, if you need stuff to update while song playing

somber coral
#

@slender iron I have a (very) rough first draft of converting shared-binding docs to .pyi stubs, just a few questions before I make a PR to add it to circuitpython:
1: what workflow should it be part of, eg, make stubs or something else?
2: where should the resulting stubs be located?
3: should I only include the contents of shared-bindings, or are there any other directories worth including?

slender iron
#

@somber coral epic! Make stubs sounds good. 2) build somewhere? Up to you. 3) just shared bindings. Give us incentive to move stuff over. Will need to sort out cpu thin conflicts like time

somber coral
#

ok, I'll try to see if there are standard directories that vscode/et al look for, or if there should be some sort of central config to set

slender iron
#

I think we’ll want to pip them up

#

Into a circuitpython-stubs package

somber coral
#

also, I noticed some cases where the docs either don't use PEP484 compatible syntax, or otherwise have some hokey data that won't generate correct stubs

#

I keep forgetting we can declare stubs via PyPI packages now

#

btw, if you want to see what it currently generates, pip install rst2pyi then run rst2pyi shared-bindings stubs from circuit python root

slender iron
#

Ok awesome. I figured that we’d need to clean up some of the docs

#

We can rally folks to fix them if we have a list of what is broken

somber coral
#

the current logic for generating imports for the stubs doesn't yet support nested types yet (eg, Union[foo, bar]), but it's on my list

slender iron
#

Kk. I’m excited to see this! Thank you!

somber coral
#

happy to hav something substantial to dig into πŸ˜›

crimson ferry
#

I'm seeing the same rc2 SD-related OverflowError on PyPortal. Also getting similar OverFlow error with rc2 on ItsyBitsy-Airlift combo when using ESP32SPI set_digital_write: File "adafruit_esp32spi/adafruit_esp32spi.py", line 653, in set_digital_write File "adafruit_esp32spi/adafruit_esp32spi.py", line 307, in _send_command_get_response File "adafruit_esp32spi/adafruit_esp32spi.py", line 219, in _send_command OverflowError: value would overflow a 1 byte buffer

meager fog
#

@crimson ferry oi - do you want to try to fix with a PR? you've got it in front of you πŸ˜ƒ

crimson ferry
#

Let me look at the ESP library and the history here of what's happening and see if I can make sense of it.

meager fog
#

you probably just need to &0xff whatever it is

#

we historically have been loose with it because it would auto-crop

celest zenith
#

I can work on a PR for that en ESP32SPI

crimson ferry
#

@celest zenith I'll defer to you, I don't have much time until Sunday. Plus, you know what you'e doing πŸ˜‰

celest zenith
#

Hmm. Looks like it doesn't like assigning a bool to a byte

#

python cast turns bool in to 0/1

#

@crimson ferry can you paste your call to set_digital_write

crimson ferry
#

Sure, this: # 0x0=INPUT, 0x1=OUTPUT, 0x2=INPUT_PULLUP esp.set_pin_mode(pin, 0x1) esp.set_digital_write(pin, val) is called with a numeric pin number and True or False. Should I use 0/1 int?

celest zenith
#

It looks like the new overflow check does not allow bool to be assigned to a byte.

crimson ferry
#

Better to make the API to send an int (0 or 1), or change the lib?

celest zenith
#

int(True) returns 1

#

and cpython allows you to assign a boolean to a bytearray.

#

an easy fix in the library is to convert the booleans to int explicitly

meager fog
#

@celest zenith are we no longer compatible with CPython?

#
>>> print(a)
bytearray(b'\x00\x00\x00')
>>> a[0] = True
>>> print(a)
bytearray(b'\x01\x00\x00')
#

should be valid Py3

#

does it not work?

celest zenith
#

that does not appear to work in RC2

meager fog
#

ok ill open an issue

celest zenith
#
h samd51j19                                                                     
>>> a = bytearray(3)                                                            
>>> print(a)                                                                    
bytearray(b'\x00\x00\x00')                                                      
>>> a[0] = True                                                                 
Traceback (most recent call last):                                              
  File "<stdin>", line 1, in <module>                                           
OverflowError: value would overflow a 1 byte buffer      ```
meager fog
#

k thanx

manic glacierBOT
#

some assignments such as bool to bytearray no longer work, but do in cpython3

Python 3.7.2 (default, Dec 26 2018, 08:10:46)
[GCC 7.4.0] on msys
Type "help", "copyright", "credits" or "license" for more information.
>>> a = bytearray(3)
>>> print(a)
bytearray(b'\x00\x00\x00')
>>> a[0] = True
>>> print(a)
bytearray(b'\x01\x00\x00')
>>>

vs

Adafruit CircuitPython 4.0.0-rc.2 on 2019-05-10; Adafruit Feather M4 Express wit
h samd51j19                          ...
meager fog
#

thats def a bug

#

so maybe hold off on 'fixing' the library πŸ˜ƒ

celest zenith
#

yeah

#

BTW, I'm cpforbes on github -- I submitted the PR that added set_digital_write.

#

I thought I had a bug in there πŸ˜ƒ

meager fog
#

kk thanx!

#

πŸ’€ time l8r!

celest zenith
#

indeed

meager fog
#

z0nk

crimson ferry
#

Just to confirm... rc2 works fine with ESP32SPI esp.set_digital_write if I feed it an int val, 0 or 1, so no hidden issues arose (tested on PyPortal, Feather M4, and ItsyBitsy M4).

celest zenith
#

I was just about to suggest that that would probably work.

solar whale
stuck elbow
#

in regular python, bool inherits from int, and True is equivalent to 1

manic glacierBOT
manic glacierBOT
raven canopy
#

@gilded cradle you hitting the "needs release" list? i was going to grab some over the weekend, so let me know which ones i can get so we don't work the same ones.

gilded cradle
#

I think I've already released all the ones I planned on, so you should be good to go.

raven canopy
#

ahh. okie dokie.

gilded cradle
#

Most of them were example file updates by dherrada that I merged in.

#

Where is this "needs release" list?

raven canopy
#

k. i was watching Travis, and saw all the builds but couldn't find any PRs matching the time, so i figured it was releases. πŸ˜„

#

old = last monday, iirc

gilded cradle
#

I mean is there a current one?

raven canopy
#

nope. and since we dropped it from the daily report on adabot, need to run a fresh one.

gilded cradle
#

Ah, ok.

meager fog
#

RIP my inbox πŸ˜„

#

thank u @gilded cradle

gilded cradle
#

lol

meager fog
#

i can rerun some of the arduino travis

gilded cradle
#

Yeah, it looks like something happened to the esp8266

meager fog
#

oh crikiey

#

yes

#

wtf

#
arduino --board esp8266:esp8266:huzzah:eesz=4M3M,xtal=80 --save-prefs 2>&1
Picked up JAVA_TOOL_OPTIONS: Loading configuration... Initializing packages... Skipping contributed index file /home/travis/.arduino15/package_esp8266com_index.json, parsing error occured: com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'Dropping': was expecting ('true', 'false' or 'null') at [Source: (FileInputStream); line: 1, column: 10] Preparing boards... Error: esp8266: Unknown package```
#

ill open an issue

#

looks like they know and are fixing

gilded cradle
#

Ok, that's good at least

raven canopy
#

hate it when garbage gets into my JSON. 😜

meager fog
#

ok looks like a new release recently, will try kicking

gilded cradle
#

ok

meager fog
#

@gilded cradle ok so next up for the displays - we did all the SPITFT's to use sendCommand right?

gilded cradle
#

Yes

#

We could potentially move setAddrWindow into GFX with some parameters depending on the specific display needs.

meager fog
#

well lets start with making sendCommand protected

#

do you have a list of all the SPITFT-usin' displays?

gilded cradle
#

Yeah, in my head.

#

I mean all the ones adafruit currently sells