#circuitpython-dev

1 messages · Page 218 of 1

buoyant wigeon
#

@meager fog OK... but I have midnight here... I will be back tomorrow 🙁

meager fog
#

l8r!

solar whale
#

did have to start twice -- I have an idea about that

#

In the reset function it does ```def reset(self, program_mode=False):
"""Perform a hard-reset into ROM bootloader using gpio0 and reset"""
print("Resetting")
self._gpio0pin.value = not program_mode

#

if it was low, it puts it high -- then on secon run it goes low

meager fog
#

mm

#

you want it held low during program

#

and set high during run

solar whale
#

right, but this set it high before the RESET. doesn't it?

#

if program_mode = False then not program_mode is True

#

It is not set during init -- so is it High or low

#

reset() is only calles at the end to put it back high, but I'm not sure what state it is in at the start,

#

does setting it as an output make it low to start?

meager fog
#

@solar whale i had to revert back some of the uart.read(1)'s cause readine one byte at a time cuases buff overruns

solar whale
#

OK -- I'll take a look and see if it impacts any of the other boards -- it's been frustrating trying to come up with common ways of handing it.

meager fog
#

yah

#

like the M4 can't deal with one byte at a time, so we ge ta lot of failures

#

you can check os.uname at init and set a max-uart-read-size

#

or a flag

solar whale
#

ah -- yeah - thre are some signifiant diffeences inthe M4 and nrf UART handlers

#

OK -- I'll look into it -- was trying not to bloat the code with too many alternate paths.

meager fog
#

np

#

the M4 can handle the code lines, but the uart isn't big

#

we'll get the nrf52 uart caught up eventually

solar whale
#

eventually we may want to add flow control ... 😬

#

I have to run -- thansk so much for all the work on this -- it's great to see it working!

#

now taht uart.in_waiting works on the nrf -- those chages may not cause any problems - I'll test later tonight or tomorrow

meager fog
#

np

#

yep we'll work it out

#

at least minitool is done

gleaming magnet
#

Remote control ornament with CPE error's and not working .

#

CPE is version 3.1.1 and getting error --> File "main.py", line 1, in <module>
MemoryError: memory allocation failed, allocating 696 bytes. I am able to load simple programs without issue so the basics should be OK.

tulip sleet
#

@gleaming magnet is it the same main.py as in the remote control ornament guide?

#

are you using the .mpy version of adafruit_irremote?

gleaming magnet
#

Yes and I am using ir 389. I am using the py version of adafruit_irremote

tulip sleet
#

please use the .mpy version from the library bundle. the .py version is compiled when imported and there's not enough RAM to to do that.

gleaming magnet
#

OK thank you for the help! Very much appreciated. Sorry for the newbie questions.

tulip sleet
#

no problem! - there's a lot to learn up front. Circle back if you have problems.

meager fog
#

k @solar whale guide is live

tawny creek
#

Yay awesome!! @meager fog @solar whale !!! I have been running the Bitcoin example and been testing it over a few hours but sometimes need to do a hard reset to get it going again. Is this a known issue?

solar whale
#

@tawny creek I have not seen that. I do get many retries but it recovers. What boards are you using?

tawny creek
#

@solar whale an m4 feather express with an esp8266

solar whale
#

I have not run that combo for extended time . I’ll try to reproduce. What happens when it needs a reset? If you have any examples of output it might help a. Also post the code if you have made any changes to the example.

manic glacierBOT
manic glacierBOT
#

@simark hmm, that's too bad.

the -flto build works in the latest micropython. So there's something different, but I haven't found it yet.

So far, none of these fixed the problem:

  • Tried the micropython *.ld files.
  • Tried matching the compile options exactly (very minor differences).
  • Tried using builtin libm (which MPy uses)

Unfortunately, due to Nordic breaking their old downloads, it's difficult to do a bisect from some time in the past (like before tinyusb, etc.)

tawny creek
#

@solar whale will do! I’ve left mine running for a few days and needs a hard reset 2-3x. When it needs a reset the neopixel blinks yellow 5/6 times and blue 8 times — i think that indicates the error but I don’t have it connected to a monitor as it runs. Is there a way to log errors on runtime reliably?

solar whale
#

@tawny creek Ah. Sounds like it is rebooting for some reasons. I have seen startup issues. Sometimes it needs a reset at first run. I don’t usually run it as code.py but manually start it. There is still some work be done making this more reliable.

#

I will set one up to run overnight and see how it does.

tough flax
#

@solar whale and @meager fog - great work! This ties directly into an idea I've had about cutting a trace and/or pin off a Huzzah Feather to turn it into a Wing 😃

meager fog
#

@tawny creek its...very rough currently

#

if you turn on debug, you can see where failures occur. make sure you have good power, the ESP can draw a ton

#

you can keep it connected to a REPL so we can see what line its failing on

tawny creek
#

@meager fog Thanks! ok! shall see what i can find :)! #detective-mode 🕵

manic glacierBOT
tough flax
#

I'm seeing an error periodically on a Trinket M0: OSError: [Errno 5] EIO

#

If I wait a bit and reload it goes away

#

Thoughts?

#

Some more details - if I change main.py it reloads cleanly. If I change one of the files I'm loading ("settings.ini") then it resets the board, but about 80% of the time it fails with that error

tough flax
#

It's not failing on open(), it's failing on fetching a line from the fp

#

Here's the code (it's not pretty)

   def read(self, filename=None, fp=None):
        state=READING_GLOBALS
        modeName = None
#      """Read and parse a filename or a list of filenames."""
        if not fp and not filename:
            print("ERROR : no filename and no fp")
            raise
        elif not fp and filename:
            fp = open(filename, 'rt')
        
        curMode = None
        for line in fp:
            print(line)
            #remove the comment
            parts = line.split(";", 1)
            value = str(parts[0]).strip()
            if (value == ''):
                continue
            #debug(value)
            if (state == READING_GLOBALS):
                if (value[0]=='[' and value[-1]==']'): #new  mode name
                    modeName = value[1:-1]
                    state = READING_MODE
                    curMode = Mode(modeName)
                    self.modes.append(curMode)
                else:#reading global setting
                    settingParts = line.split("=",1)
                    self.globalSettings[settingParts[0].strip()] = settingParts[1].strip()
            elif (state == READING_MODE):
                if (value[0]=='[' and value[-1]==']'): #new  mode name
                    #debug(self.modes[modeName].settings)
                    #debug(self.modes[modeName].triggers)
                    modeName = value[1:-1]
                    curMode = Mode(modeName)
                    self.modes.append(curMode)
                elif (value[0].isdigit()):#new triggers
                    curMode.triggers.append(Trigger(value))
                else:#setting
                    settingParts = line.split("=",1)
                    curMode.settings[settingParts[0].strip()] = settingParts[1].strip()
#

print(line) is just for debugging... it prints up through about 80% of the file then fails (on a comment)

#

This is a big problem for me - having the end user edit settings.ini is a big part of why I'm using this stuff... if they have unplug/replug every time they edit it's kind of difficult.

tough flax
#

Ugh... latest CP won't fit on Trinket M0 if you freeze in HID

#

ACK

#

Ok, doesn't do it when editing with Notepad, but does with Notepad++

#

Ok, I found the notes about the various editors.. but this is weird, because the file IS fully written... it's not corrupted. And when the main.py file is modified and the board fully resets the changes I made to the file are there. And adding a delay before reading it doesn't change anything

#

Anyway, I will give instructions to use Notepad & eject the drive... but it would be nice if we could detect this.

#

(I need to have problems during normal working hours)

slender iron
#

<@&356864093652516868> Meeting notes for tomorrow are here: https://docs.google.com/document/d/1DhFiFKPp-k4LKHvd0f5AdB3Zq_IF1MjqvHdZPplVhAQ/edit?usp=sharing Talk with you soon!

tough flax
#

I do not understand why deleting files makes me run out of memory on the Trinket M0

#

And how can the same UF2 file sometimes fail on memory allocation and sometimes succeed?

manic glacierBOT
#

Hi folks,

I'm very frustrated - in advance, sorry if this ends up being my fault.

I have a custom build of CP for the Trinket M0 that freezes in HID per Kattni & Dan's instructions. This is necessary because I want to have a device that uses HID & Dotstar as well as parsing a config file.

I have put my parsing logic into an .mpy file and everything just fits... except when it doesn't.

The same chip, with the same UF2 file boots 80% of the time and the other 20 fails with
Mem...

manic glacierBOT
marble hornet
#

anyone recognize this error? make: msgfmt: No such file or directory make: *** [build-metro_m4_express/genhdr/en_US.mo] Error 1 Jonahs-MacBook-Pro:atmel-samd jonahym$

#

im compiling 4.x

manic glacierBOT
#

Hi Bill, make sure that only the .mpy version of whatever is on CIRCUITPY. The .py will be used in preference to the .mpy if it's present. Are you also mpy-cross'ing main.py? That will help.

I don't have an explanation for why it works sometimes but not other times, but it may simply be timing, which may affect where RAM gets allocated. This sounds more like fragmentation than literally running out of RAM.

I don't think going to 4.x is going to make it more stable, but you can try. To m...

raven canopy
#

@marble hornet try running make translate before building firmware.

#

I think it's translate. goes looking

#

Yep!

manic glacierBOT
slender iron
#

@marble hornet msgfmt is provided by gettext

#

so brew install gettext

tulip sleet
#

@tough flax

Ok, doesn't do it when editing with Notepad, but does with Notepad++
Ok, I found the notes about the various editors.. but this is weird, because the file IS fully written... it's not corrupted. And when the main.py file is modified and the board fully resets the changes I made to the file are there. And adding a delay before reading it doesn't change anything
Anyway, I will give instructions to use Notepad & eject the drive... but it would be nice if we could detect this.

NOTEPAD is not a good choice either. It doesn't fully write the file immediately.

Note that you can't tell whether the file is written or not by looking at it from Windows. Windows shows you what it thinks the file should be from its point of view, but that doesn't mean that's really what's on the flash drive

fierce girder
#

FYI , On voice, but lurking today.

timber mango
#

Lurking too

meager fog
#

text only

slender iron
#

<@&356864093652516868> meeting starting in a minute

tidal kiln
#

lurking

manic glacierBOT
#

While testing the use of the ESP8266 AT firmware when connected to an nrf52840 board via the UART on board.RX//TX I found that the UART RX would "hang" (stio receiving) if I RESET the ESP8266 -- The RESET sends out a failrly large burst of data.
A RESET can be triggered by a hard reset or by issuing the AT+RST command if the ATFirmware is installed on the ESP8266

The condition may be cleared by uart.deinit() the recreating the uart. (or by resetting the nrf52840)

It also occurs wit...

slender iron
idle owl
#

@meager fog Feel free to post your hug reports and status updates, we're about there 😃

#

@slender iron Brennen's in the notes.

meager fog
#

thanks to @tidal kiln for helping so much with issues and support, its incredibly helpful!

#

and @solar whale for getting particle argon wifi working, and helping with the ESP co-processor hacking

inland tusk
#

I will be lurking today, group hug

neat folio
#

@errant grail nice radio voice 😃

#

@slender iron 🍚

inland tusk
#

@slender iron Congrats

marble hornet
#

text only for now

raven canopy
#
  • @jerryn & @ladyada again for continuing ESP AT command work.
  • "Pre-emptive" hug for @kattni for giving Python workshops in Chicago this week.
  • A bowl-full-of-jelly sized Group Hug!
tulip sleet
#

@marble hornet do you have hug report and/or status?

inland tusk
#

Happy Holidays to all

marble hornet
#

report: (and hug) @tawny creek was able to get the gui code running on an ili9341 and feather m4! and still muddling through learning some c and the cp standards for creating new modules for the scratch ram module "svm"

meager fog
#

@marble hornet which gui code's this?

#

im doing some ili9341 hacking lately

marble hornet
#

i'll post a link to my repo! (100% cp)

meager fog
#

niiice

#

plz do 😃 ill chek it out, maybe we can share code!

marble hornet
#

https://github.com/TG-Techie/TG-US getting it running on different hardware is not documented but 100% possible! I wrote a name space buffer of libraries so disp libs and button types can be switched out without touching the main code.

#

i'll post some vids when the meeting is over

meager fog
#

ok thanks!

errant grail
#

Great suggestion @inland tusk !

marble hornet
#

oops typo, sorry

raven canopy
#

Dan, we could have web scraped that! :D

marble hornet
#

@meager fog gladly

stuck elbow
#

nothing from me

slender iron
#

@meager fog status update?

meager fog
#

wrote guide & commited WiFi w/ESP module coprocessor. it...worksish. needs more but is functional for basic URL queries

#

about to do a bunch of graphics work for M4 and TFT display, blitting, surfaces, graphics, maybe even f0ntz

#

nrf52840 feather being fabbed today

#

hopefully in the shop sometime this week

#

zats it'

slender iron
#

thanks!

marble hornet
#

WOO WHOO! nrf52840!!

errant grail
#

@meager fog 's new guide is excellent!

raven canopy
#

Last Week:

  • Adabot:
    • Fixed >100 Issues pagination issue.
    • Added 'dry run' and 'local' patching capability, for testing patches before submittal.
  • FRAM CP Learn Guides: SPI published. I2C in review.
  • Travis badge update (.org -> .com):
    • updated cookiecutter README badge link
    • Tried creating a git patch to update the library READMEs; won't work because of line diff including the lib name. So, wrote a python script that will update each lib. Still discussing implementation strategy with Kattni. Currently it will push changes to a branch on my forks, and submit a PR from there.
    • Fighting feature creep to "safely" include the above scripting capability in adabot patching. 😄

This Week:

  • Mostly travel prep, airports, and cars.
marble hornet
#

oh, i have a in the weedsy maybe question.

#

is there any chance of reactivating the running multi script in random from up? or as an option

#

tandom**?

#

sure,

#

for my project or in general?

#

I was thinking of the basic threading,

raven canopy
#

You got to where I was going with threads. 😄

tidal kiln
#

dan has an issue with discussion

tulip sleet
meager fog
#

yah use cases are most helpful

#

there's a lot of 'i want threads for this thing' where DMA may be more helpful

#

threads are so incredibly deadly

#

that and pointers its like the worst parts of C 😃

#

and i ❤ C

tulip sleet
#

people also say "I need interrupts", but sometimes they need what interrupts can do, and not necessarily the mechanism

raven canopy
#

Pointers aren't a positive? 😆

meager fog
#

for example, wifi coprocessor can do wifi stuff and get back to you later, with DMA and buffering

#

if you really want to shoot yourself in the foot, we have regexp support in M4 now 😃

#

j/k j/k

#

for example audio support, rotaryio,m pulsein...these are normally IRQ issues, but we do with DMA/timers

neat folio
#

multi processor is an interesting approach to multi threading 😉

meager fog
#

you can signup for the propeller 2 😉

fathom lava
#

Sorry I couldn't make the call today. Hugs to @slender iron and @idle owl for their huge help in getting my test suite structured correctly. Last week I finished my SAMD21 porting guide and checked in the BoardTest suite.

marble hornet
#

okay, I know what you mean! There are many solutions to one problem! i'll give it some more thought

idle owl
#

@fathom lava No worries! I've added your reports to the notes 😃

marble hornet
#

threading might not be the solution 👍

#

🤷

tulip sleet
#

2pm eastern

#

aagh

errant grail
#

Thanks everyone! Best wishes, @slender iron !

raven canopy
#

Thanks everyone! Have a great holiday, and enjoy a break. Rocking it all the time, like this community does, is tiring.

meager fog
#

happy holidays!

neat folio
#

Happy Holidays all and thanx all 😃 what a great community

meager fog
#

bye scott!!

#

happy holidays!

#

woooo

stuck elbow
#

happy winter solstice

meager fog
#

oh thank goodness

#

dark at like 3pm

#

@slender iron wanna chat fast about memory

#

or you wanna bolt to something else?

raven canopy
#

Later taters!

marble hornet
#

See you later

solar whale
#

👋

fierce girder
#

@tannewt I want to go outside the airport! I've been through Iceland airport twice this month on Berlin flights. The WOW Air in-flight magazine has fully indoctrinated me into needing to spend a week in Iceland sometime 😍

Hope you have an amazing trip!

cunning crypt
#

I am mildly disappointed that the new job prevents me from being part of the CP weeklies. But on the other hand it seems great so far.

#

Anyway, break is over, back to work. Or, more accurately, observing.

neat folio
#

perhaps over time you can convince the employers of the value of the CP community/activities as they pertain to your organization 😃

#

now get back to work!

#

😉

#

(I want one now... thanx 😦 )

#

before people get too excited... (this is humor, it isn't out yet) 😉

#

but I still want one... (now) 😦

raven canopy
#

Been watching Prop2 for a while now. Prop1 was a pure "over-my-head" moment, but I love the cogged design concept.

#

That was the closet I've been to ASM.

neat folio
#

looks like a great way to get into parallel processing at the real-world board/wire level as opposed to the more "theoretical" GPU approach... (which is also typically "fogged" by being several orders of magnitude more complex numerically... i.e. hundreds or thousands of processors)

#

32 is "enough to be useful", but not "so many that you can't see the herd"

#

I think it was 32 "cogs"... (read it more than a few minutes ago... lol)

raven canopy
#

I think 32 is correct. Prop1 was 8 cogs.

marble hornet
#

😅quite blurry. It's running on an m4 a ST7735R and I have not yet added the dma spi. I'm tapping mpr121 buttons to the left but adding tactile switches is easy.

#

@meager fog posted video^^.
And do you have any tips for hand soldering the mpr121 specifically?

buoyant wigeon
#

@meager fog So, I have tried to connect Trinket_m0 and ESP-01 with 1MB memory.
I have found some problems:
a/ after flashing FW "AT_firmware_1.6.2.0.bin" from you, the module was not functional at all. Only blue LED flashed on the module; by chance I have found out that if I had flashed FW to a module with previously flashed MicroPython, the behavior of the module was OK; when I first erased the module, then this "blue craziness" appeared. It means it must be related to the initialization of data structures. I made my own FW "AT_firmware_ESP-01_1MB_1.6.2_target.bin" and with this it has been functional OK even after erase (attachment).
b/ I have been trying testing program "espatcontrol_simpletest.py" only, it is not willing to connect with my AP, I have been looking for the cause...
In the attachment you can find example of output log... I have been thinking about CWMODE_DEF, CWMODE_CUR, CWJAP_DEF a CWJAP_CUR now... because I am able to get connection when I do AT commands manually...do you have any idea?

obtuse ibex
#

I cant seem to see the CIRCUITPY directory on my Adafruit HalloWing M0 Express. Cant tell if I am doing something wrong, missing drivers, etc. (On windows)

I do, however, see HALLOWBOOT when I plug it in.

marble hornet
#

@obtuse ibex I think you need to drag cp onto it. You are in bootloader mode

exotic pumice
marble hornet
#

Or press reset

#

If you haven't already

exotic pumice
#

and drag it onto the mass storage

slender iron
obtuse ibex
#

Thanks @exotic pumice. That did it. 😃

#

@marble hornet I needed the uf2.

exotic pumice
#

@obtuse ibex excellent, happy to help

marble hornet
#

@obtuse ibex awesome! What cha making?

#

@meager fog found one in my desktop bwos. Time to start porting😋😉

solar whale
#

@buoyant wigeon FYI - I just tried using the ESP8266 AT firmware with a feather_m0 express and I also run into lots of issues properly handling the AT responses. Up til now I have on;y been using the M4 and NRF52840 boards. It look like the M0's may need some changes made to some of the command timing.

buoyant wigeon
#

@solar whale Thanks for reply... I'm just playing with it but no results yet... command timing... good inspiration... here is the time on the bed... the brain fails 😔

upbeat plover
#

nvm i can write with slicing but fram i can't... i can't copy paste my lib ={

solar whale
#

@buoyant wigeon FYI -- I just got it to make a good connection after updating tp the latest CP 4.0.0-alpha5 release

#

no idea why

buoyant wigeon
#

..with feather_m0?

solar whale
#

yes

buoyant wigeon
#

OK.... the theme for tomorrow...

solar whale
#

Good luck!

buoyant wigeon
#

Good night 😀

upbeat plover
#

i think i can copy paste okay and just use "for in range" instead of slicing

manic glacierBOT
exotic pumice
#

Catching up on the meeting, had family over today at that time.

In my opinion, I don't think anyone has come up with a way to do multithreading well, in any language period
--@slender iron
Try Go or Rust. 😛

#

I understand where you're coming from about focusing on beginners though

#

I also agree that C does it poorly

obtuse ibex
#

@marble hornet Conbadge

slender iron
#

🎃

exotic pumice
#

I was working on advent of code and someone taught me a cool trick in Rust. If you have an iterator, and you want to do multithreading, you just import a library and run myiterator.into_par_iter() (parallell iterator) and now you have an iterator that takes advantage of multithreading.

raven canopy
#

@upbeat plover for FRAM, construct your buffer however, then just supply the starting address.

data = [1, 2, 3]
fram[10] = data

I initially had slicing for write, but was taken out for good reason that escapes me. 😁

#

also, set property fram.write_wraparound=True if you'll be writing past the last address.

upbeat plover
#

how do you do bytearray(b'\xff\xff\xff\xff\xff') for data in that code?

raven canopy
#

You can pass in a bytearray, list, or tuple.

upbeat plover
#

seems to be working well, using bytearray i can store strings

raven canopy
#

To a point yes. ord() comes in handy with certain characters from what I tested.

tough flax
#

@tulip sleet thanks for the confirmation and details. Have there been any ideas or any progress on a workaround? Telling my users to install a particular text editor is tough

upbeat plover
#

This seems to be about right for Lux from analog 3.3v, its nearly the same as my light meter. Anyone have a GA1A12S202 and want to test this?

import time
import math

GA1A12S202 = analogio.AnalogIn(board.A1)
logRange = 5.0

while True:
    rawval = GA1A12S202.value
    logLux = (rawval * logRange) / 65520
    print(rawval)
    if (math.pow(10, logLux)) > 55000 or (math.pow(10, logLux)) < 3:
        logLux = 'Out of Range'
    else:
        logLux = round(math.pow(10, logLux))
    print(logLux)
    time.sleep(0.5)
solar whale
#

@tulip sleet were there any updates to the SAMD21 UART between 4.0 alpha3 and alpha5? Just curious. Had some start working when I installed alpha5 not sure if it was alpha5 that fixed it or something else.

#

ah I see PR1372 made some changes

karmic notch
#

On bootup, it says merry christmas, lights up and then lights out LED on the back is flashing green yellow then blue

tidal kiln
karmic notch
#

I am using Mu editor, I click the repl button and get a could not find an attached device error.

#

would there be version of circuit python I should "update" to ?

tidal kiln
#

i don't think mu currently supports that board

karmic notch
#

that would make sence.

#

er sense

tidal kiln
#

and i'm guessing it's a circuitpython version issue

karmic notch
#

is there another editor that I could use?

#

that was my guess, I have been looking through the tresslism4 pages to find a link to the right python version

tidal kiln
#

we could just try a firmware update - but would you be up for trying to get to REPL?

#

knowing how to do that will help you in the long run

karmic notch
#

I am up for trying both.

#

I agree 😃

tidal kiln
#

what operating system are you on?

karmic notch
#

Win 10

tidal kiln
karmic notch
#

cool

#

thank youi

#

you*

#

I updated the uf2 and it solved the crashing issue

tidal kiln
#

ha!

#

where'd you get the firmware?

karmic notch
#

I ended up jumping ahead and found it.

tidal kiln
#

cool. no worries. that should work.

#

i saw someone else run into a similar issue

#

same code example / same fix

karmic notch
#

ahh

#

easy fix too

tidal kiln
#

that code uses some newer features of the audioio module

karmic notch
#

oh ho, it seems to have once again crashed

#

I was playing around some buttons !

tidal kiln
#

did it make glitchy noises?

karmic notch
#

I hear a swoosh/shooting star sound

#

I recall something about that linked her within the last week

#

when sound finishes its a high pitch phew sound.

#

I think this is what I am hearing

#

A few seconds/minutes after playing a sound on the NeoTrellis there's a 'peeeeeeeeeeewwwwwwwww' sound - what's that?
You're hearing the output capacitors discharge after not playing audio for a while. This normal, not harmful, and occurs with some headphones/speakers

tidal kiln
#

could be. what was the crash? just the sound, or did it do something else?

karmic notch
#

it shut down the same as before uf2 update.

#

I am not sure what happened

#

I was testing by repeating my button presses

#

still hasn't crashed since.

#

but I think this a job for the repl to discover maybe

tidal kiln
#

were you pressing the buttons at an angle?

karmic notch
#

I can't say, as I was passively pressing buttons while reading. 😃 , since i read about that jus tnow I was trying that intentionally.

tidal kiln
#

it may have been that. next time it happens see if that's what it was.

karmic notch
#

Yeah, I have also gotten into the repl

tidal kiln
#

excellent!

karmic notch
tidal kiln
#

way more info than blinking color lights.

#

can you recreate that repeatably? or is random?

karmic notch
#

seems random

main meteor
#

int object? I'm guessing you have more than one different usage of a variable (or list entry, or somesuch).

karmic notch
#

it looks like it is referring to something in some of the libraries.

#

any way I am going to have dinner and look at this afterward

main meteor
#

Good plan. I had a bug I stared at for 3 days and couldn't find. I went up to NYC for a few days and when I got back, I saw what I'd done wrong (of course, a single character typo).

tidal kiln
#

not sure what would be causing that. but can wait until after dinner 😃

meager fog
#

@solar whale @buoyant wigeon we've made many updates to uart in latest 4.0.0 alpha's - that can make a difference

solar whale
#

@meager fog yeah! -- seems to be OK with alpha5 -- just at simpletest -- no json in m0 so cant run bitcoin

meager fog
#

yah for m0 you'll have to hand parse. icky but at least its no strtok

solar whale
#

yup -- more to add to the todo list!

#

I tried minesptool on m0 -- ran out of memory

meager fog
#

yah thats very not surprising

#

lower the packet count from 1K to maybe 256 bytes

#

also i didnt write miniesptool in a 'good' way'

#

it could be greatly improved 😃

solar whale
#

not a problem ... it works very well as intended

#

I even loade the AT firmware on to an old ESP8266 that has a fried CP2104 -- works great via UART -- back in service

tulip sleet
#

@tulip sleet the delayed-write problem is a biggie. The "workaround" is to use editors that flush to disk when writing, or, use "Eject" (in Windows). It doesn't really make the drive go away but it does force out all the data. https://superuser.com/questions/1197897/windows-delays-writing-fat-table-on-small-usb-drive-despite-quick-removal

#

Also true, but with a shorter interval, in Linux, and in Linux you can just type "sync". Not a problem with MacOS.

manic glacierBOT
stoic stag
#

I just learned about circuitpython today and it definitely looks interesting. I have a few esp32's and a project in mind but if I decide to switch back to Arduino is it as simple as uploading a sketch in the Arduino IDE to get it back to normal?

exotic pumice
#

I believe so @stoic stag

#

keep in mind that esp is mainly going to be supported as a coprocessor going forward

meager fog
#

@solar whale did some tweaks, seems to be improved now with a little more rigorous feedback

#

also i tried a newer ESP8285 compared to my ESP8266 and it works a lot better. which is odd, but it does

meager fog
buoyant wigeon
#

@meager fog @solar whale 👏 I have installed CP 4.0.0 Alpha 5! before I had go to work... 10 attempts = 10 times OK ... with espatcontrol_simpletest.py...nice 👍

pseudo ginkgo
#

I'm having trouble accessing the REPL. I'm using Mu on Windows, and the serial console works fine, but when I press ctrl+c, nothing happens, serial continues to operate as normal.

#

I've now tested it with Putty and on my Mac via terminal with no success, so it doesn't appear to be a Mu issue

stuck elbow
#

@stoic stag for esp32 you probably want to use MicroPython

stuck elbow
solar whale
#

@stuck elbow Thank you -- that looks great -- Looking forward to trying it out.

stuck elbow
#

it uses micropython, but I think it should be easy enough to translate

solar whale
#

Thats OK -- I'm moving back to Micropython on the ESP8266 anyway -- I can practice there then port iit to CP..

#

@meager fog I'm curious about your "tweaks" to ESP_ATcontrol. Let me know if there is somethign I shoud try or I'll just watch for updates to the repo. That MQTT link looks interesting. The next thing I wanted to do was see if I could post to adafruit.io -- I'll try it tonight!

marble hornet
#

C is so cool! and I've only written like 5 lines!

stuck elbow
#

it gets less cool when you write more ;-)

solar whale
#

programming is cool in any language 😉 It's nice to have a selection of tools available.

marble hornet
#

ever use Karel?

solar whale
#

not me.

marble hornet
#

i have a cp and c question

stuck elbow
#

shoot

solar whale
#

ask away

stuck elbow
#

the suspense...

solar whale
#

drum roll...

marble hornet
#

haha

#

at the end of a module .h file i see this line ```#endif // MICROPY_INCLUDED_MYMODULE_MYCLASS_H

#

can i leave off the comment or does cp need it. I ask because...

stuck elbow
#

it's a comment to make it clear to which "#if" it matches

#

the comment is not needed for the computer, but it helps humans

marble hornet
#

okay... 😕

#

ha

#

got it! i haz another one may i?

stuck elbow
#

don't ask to ask, just ask

marble hornet
#
#define MICROPY_INCLUDED_MYMODULE_MYCLASS_H

#include "py/obj.h"

typedef struct{
  mp_obj_base_t base;
  bool deinited;
} mymodule_myclass_obj_t;


#endif // MICROPY_INCLUDED_MYMODULE_MYCLASS_H```
#

okay, so MICROPY_INCLUDED_MYMODULE_MYCLASS_H is defined if it isn't already

#

but then it isn't used or touched right?

stuck elbow
#

the trick here is to make sure the code appears only once even when it's included multiple times

#

C preprocessor is pretty dumb in that way

#

so if you have a header file a.h and a header file b.h that also includes a.h, and then you include both a.h and b.h in your b.c, then a.h would appear twice and cause errors/warnings about redefining the same objects

#

this trick prevents that

marble hornet
#

okay! just gonna double check I understand: you're saying if .h is #includeed in multiple files the #ifndef makes sure it isn't defined after it's first definition ?

stuck elbow
#

yes

#

only the first #include will actually include the code, the later ones will be empty

marble hornet
#

like: if not ('x' in dir()): x = 5

#

so it all becomes one giant c file?

stuck elbow
#

the #something directives work at the level of the preprocessor -- they run before compilation, to produce one big text file to compile

marble hornet
#

👍

stuck elbow
#

things between #if* and #endif only get included in that when the condition is met

solar whale
#

#include is just like a "copy/paste"

stuck elbow
#

so you can have different code depending on some settings or platform

marble hornet
#

neat!

#

different question:

#

do modules in shared-bindings need activation?

#

or are they normally included and need a non included, like nvm in earlier builds

#

or is it in documentation?

#

and thank you @stuck elbow

manic glacierBOT
stuck elbow
#

@marble hornet they need to be included in mpconfigport.h

#

and added to the makefile

marble hornet
#

thnx

#

so for testing should i just put it in shared modules?

#

then move it back when it comes time to pr?

raven canopy
#

@marble hornet shared-modules are for port agnostic functions, iirc.

stuck elbow
#

@marble hornet no matter where you put it, you still have to include it in the makefile and the header files for the compiler to pick it up

marble hornet
#

kk

upbeat plover
#

With further testing i had to add 50% of logLux to LogLux for it to be the exact same as my multimeter's Lux meter. Tested ranges 30-25,000 with white LEDs and warm light fluorescents

I need to test sunlight now but its been super cloudy.

Anyone have one of these and a Lux meter to test this?

meager fog
#

@solar whale hey so I Have Learned Things

#

ESP8266 has crummy SSL, so modern sites dont like it. i think the ESP32 solves it with the bigger RAM and processeor - it can do TLS1.2

#

so ill be moving to supporting ESP32 majority

meager fog
#

can you do me a favor and try to url query...

#

on the argon? does it connect?

solar whale
#

@meager fog Thats too bad - but not surprising ... glad they put the esp32 in the particle.argon (apprently that was a late switch from an esp8285).

#

I can try it this evening -- not at home now

meager fog
#

npnp

#

ill grab an argon too

#

and maybe just hand-wire an ESP32

solar whale
#

I can try it with both the argon and a huzzah esp32 on the M4

meager fog
#

yep thanx

buoyant wigeon
#

@solar whale @meager fog My HW is Trinket_m0 + ESP-01... tests with "espatcontrol_simpletest.py" definitely OK... but with "espatcontrol_webclient.py" no success... ends always with error "No OK response to AT+CIPSEND=66"... sending also log-file... any idea? some advice would be welcome

meager fog
#

not sure, the code is still finicky

#

we'll get there 😃

#

probably some parsing stuff

solar whale
#

that space after the ">" at the end has been a problem for parsing

#

sometimes it is there -- sometimes not

#

I thought ti was being handled either way, but maybe not ....

buoyant wigeon
#

Thanks.. will look at it... btw what particle Xenon and Argon... CP is implemented??? I have received last week some of them ... what is the status?

solar whale
#

CP 4.0.0-alpha5 has builds for them (it is alpha 😉 -- to use the ESP32 on the Argon you have to reflash with a new version of the AT firmware the uses the correct pins.

buoyant wigeon
#

Thanks for info... I didn't know...

solar whale
#

Warning - I have not tried reverting back to the particle.io mesh firmware after flashing for CP - it can probably be done, but I have not tried

buoyant wigeon
#

That's good ... I'm not going to such an adventure 😀

solar whale
#

you also have to flash the uf2 bootloader to the particle board -- need a J-link

buoyant wigeon
#

I have J-link but also a lot of other problems in the solution... I will leave the new problems for the new year 😀

solar whale
#

😉

#

there is a lot of rapid development going on now -- stay tuned...

manic glacierBOT
solar whale
#

@meager fog I get a "CONNECT OK" response but I don't get the response message -- or its not getting parsed. also I had trouble even parsing the CONNECT response so I made a change only to compare reply[0:7] == b'CONNECT' and that seems better. Still -- the parsing for CIPSEND is not working wery reliably. I had the same resuilts from the ESP8266 and the huzzah feather on the M4

#

I'll try to do more with this a little later.

tawny creek
#

@solar whale trying out some wifi coprocessor stuff with esp32 and willing to test out stuff! Tried this out with an esp32 feather:

---> AT+RST
<--- b''
---> AT+RST
<--- b''
---> AT+RST
<--- b'\x00'
---> AT+RST
<--- b''
---> ATE0
<--- b''
---> ATE0
<--- b''
---> ATE0
<--- b''
Traceback (most recent call last):
  File "code.py", line 39, in <module>
  File "adafruit_espatcontrol.py", line 86, in __init__
  File "adafruit_espatcontrol.py", line 368, in echo
  File "adafruit_espatcontrol.py", line 339, in at_response
RuntimeError: No OK response to ATE0
marble hornet
#

@meager fog what have you been hacking into/with the ili? (if you can say)

ruby lake
#

alas after 60,000 hours of uptime, this machine is dying

meager fog
#

@tawny creek something isnt connected right, you should be getting echo chars, check your wiring

buoyant wigeon
#

@meager fog @solar whale stupid question ... can you confirm that the strip function works correctly in CP?

solar whale
#

@buoyant wigeon I have not tested it explicitly but I suspect the problems are in the parsing not in strip.

buoyant wigeon
#

Surelly yes... but I am trying something and ... probably is time to go to bed ...😔

river quest
#

just posted up 2 new circuitpython runnin' boards on the adafruit blog, the grand central and the nrf52840, sign up they'll go fast once in stock https://www.adafruit.com/product/4062 & https://www.adafruit.com/product/4064

tawny creek
#

@solar whale @meager fog the connection looks okay, USB<->USB (Power between feathers), GND<->GND, TX<->RX, RX<->TX, D5 to RST (ESP32) same for the 8266 board.

Free memory: 73.625
---> AT
<--- b'AT\r\n'
---> AT
<--- b'AT\r\n'
---> AT
<--- b'AT\r\n'
---> AT+RST
<--- b'AT+RST\r\n'
---> AT+RST
<--- b'\x00@5E\xd5\n'
---> AT+RST
<--- b'AT+RST\r\n'
---> AT+RST
<--- b'AT+RST\r\n'
---> AT+RST
<--- b'AT+RST\r\n'
---> AT+RST
<--- b'AT+RST\r\n'
---> ATE0
<--- b'\x00'
---> ATE0
<--- b'\x00'
---> ATE0
<--- b'ATE0\r\n'

I do have a particle board, maybe the firmware is specific to the ESP32 on that board? Using a WROOM not a WROVER maybe..?

raven canopy
#

@tawny creek which particle board are you using? if you're using one for that output, at least.

tawny creek
#

@raven canopy am not using one, using an M4 with an ESP32 Wrover

#

I could use one to test though if that's the only combo that works right now

raven canopy
#

k. (but yes, the new particle argon has particle's esp at firmware)

tawny creek
raven canopy
#

jerry would better answer that question, but the filename does hint at the argon. i imagine it is a "standard" ESP32 AT firmware though, because the particle version wasn't working which is why he build that .bin.

solar whale
#

That ESP32 is only for the particle argon.

raven canopy
#

ahh. guide should be updated? (non-judgey question)

tawny creek
#

the file name makes sense! DOH!!!

solar whale
#

“Our ESP32 setup assumes you'll be using the same UART RX/TX pins for uploading firmware as communicating. This is always true on the ESP8266 but not on the ESP32
We only really recommend using ESP32 if its integrated into your board - like the Particle Argon. If not, the ESP8266 above will work just fine.”

#

That is on the previous page. Agreed. The upload page could be clearer.

#

For an external ESP32 you can use Espressif version.

#

Sorry it is so confusing. Still much to be done.

tawny creek
#

not a problem @solar whale ! happy to poke around anyway ☺

solar whale
#

I made a custom build for the argon.

tawny creek
#

I downloaded V1.1.1 off the official site, should that be ok?

solar whale
#

I have not tried it.

#

Do you have a link to what you used?

tawny creek
#
Get bitcoin price online
Free memory: 73.4688
---> AT
<--- b'_\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
---> AT
<--- b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
---> AT
<--- b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
---> AT+RST
<--- b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
---> AT+RST
<--- b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
---> AT+RST
<--- b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
---> AT+RST
<--- b'AT+RST\r\n'
---> AT+RST
<--- b'AT+RST\r\n'
---> AT+RST
<--- b'@T\x05\x00\x100\x80'
---> ATE0
<--- b'\x00'
---> ATE0
<--- b'\x00'
---> ATE0
<--- b'ATE0\r\n'
Traceback (most recent call last):
  File "code.py", line 39, in <module>
  File "adafruit_espatcontrol.py", line 86, in __init__
  File "adafruit_espatcontrol.py", line 368, in echo
  File "adafruit_espatcontrol.py", line 339, in at_response
RuntimeError: No OK response to ATE0
#

Tonight im going to plop back the esp8266 that was working and then run it overnight with serial open so i can log it

#

not concerned about getting the esp32 working but thought to try it 😃

solar whale
#

Does not look like it is. communicating properly.

#

If you have a usb to uart cable you can try to connect dir to the ESP32 tx/rx pins.

tawny creek
#

i do!

solar whale
#

It does the proper end of line. Screen does not.

#

If you connect, juts type AT . The return. Should get OK

tawny creek
#

tried 1.1.1 and 1.1.2 firmware versions btw just in case something in the latest was borked

solar whale
#

I just use a simple script on the M4 to talk to the ESP32 or ESP8266. I can post it if you want it.

tawny creek
#

and not sure why i cant serial in using a cp2104

#

sure, why not~

solar whale
#

Just a minute.

#
Adafruit CircuitPython 4.0.0-alpha.3-43-g80db2cec9 on 2018-12-03; Adafruit Feather M4 Express with samd51j19
>>> import esp8266comm
AT
b'\r\n'
b'OK\r\n'
None

#

I typed AT then Return - the rest are responses

#
AT+GMR
b'AT version:1.6.2.0(Apr 13 2018 11:10:59)\r\n'
b'SDK version:2.2.1(6ab97e9)\r\n'
b'compile time:Jun  7 2018 19:34:26\r\n'
b'Bin version(Wroom 02):1.6.2\r\n'
b'OK\r\n'
None
#

this is an esp8266

tawny creek
#
Adafruit CircuitPython 4.0.0-alpha.5 on 2018-12-10; Adafruit Feather M4 Express with samd51j19
>>> import esp8266comm
AT
None
AT+GMR
None

This is on an esp32 wrover with 1.1.2 AT fw

solar whale
#

now on esp32 ```
Adafruit CircuitPython 4.0.0-alpha.3-43-g80db2cec9 on 2018-12-03; Adafruit Feather M4 Express with samd51j19

import esp8266comm
AT
b'AT\r\n'
b'\r\n'
b'OK\r\n'
None
AT+GMR
b'AT+GMR\r\n'
b'AT version:1.3.0.0-dev(6aafec8 - Dec 7 2018 02:23:19)\r\n'
b'SDK version:v3.3-dev-343-g7fa98593b\r\n'
b'compile time:Dec 15 2018 16:35:53\r\n'
b'\r\n'
b'OK\r\n'
None

#

so you are not communicating

tawny creek
#

yeah will try a different ESP32 board/module

solar whale
#

check rx/tx are crossed

tawny creek
#

yep they are

solar whale
#

I always have to do it atl least twice 😉

#

try it with your esp8266

velvet badger
#

Hey all. For some reason when I plug my Hallowing into my windows 10 PC, and try to open the serial console in Mu it gives me a "Could not find attached device..." error. But I can save the code on it and it shows up as attached. Any ideas?

tawny creek
#

@velvet badger which version of Mu?

velvet badger
#

1.0.0

#

I plug a different microcontroller in and the serial console works fine.

#

Just not working with the Hallowing. Updated the circuitpython uf2 to 3.1.1

solar whale
#

you may need mu 1.0.1

tawny creek
velvet badger
#

Will give it a try. Thanks.

tawny creek
#

not sure why I can't connect to serial @solar whale but can see it's response when I connect and screen to the esp32 via the USB

2600) load
I (206) esp_image: segment 4: paddr=0x00130018 vaddr=0x400d0018 size=0xdf390 (914320) map
I (527) esp_image: segment 5: paddr=0x0020f3b0 vaddr=0x4008d178 size=0x01f14 (  7956) load
I (530) esp_image: segment 6: paddr=0x002112cc vaddr=0x400c0000 size=0x00064 (   100) load
I (542) boot: Loaded app from partition at offset 0x100000
I (542) boot: Disabling RNG early entropy source...
Bin version(Wroom32):1.1.2
I (587) wifi: wifi firmware version: de47fad
I (587) wifi: config NVS flash: enabled
I (587) wifi: config nano formating: disabled
I (599) wifi: Init dynamic tx buffer num: 32
I (599) wifi: Init data frame dynamic rx buffer num: 32
I (599) wifi: Init management frame dynamic rx buffer num: 32
I (603) wifi: wifi driver task: 3ffdee6c, prio:23, stack:3584
I (608) wifi: Init static rx buffer num: 10
I (612) wifi: Init dynamic rx buffer num: 32
I (616) wifi: wifi power manager task: 0x3ffe369c prio: 21 stack: 2560
I (651) wifi: mode : softAP (30:ae:a4:21:77:25)
I (658) wifi: mode : sta (30:ae:a4:21:77:24) + softAP (30:ae:a4:21:77:25)
I (662) wifi: mode : softAP (30:ae:a4:21:77:25)```
solar whale
#

That is the console/debug not the AT firmware

tawny creek
#

yes, that was just to check if the ESP32 was doing anything at all since the screen via it's tx/rx pins looks blank..

#

maybe why i can't connect to it via the m4 , cant even see it directly

#

esp8266 with all these works

velvet badger
#

Upgrading Mu did the trick all. Thanks!

solar whale
#

If you use my build, I think you will see AT on the USB port.

tawny creek
#

@velvet badger yaay!

solar whale
#

But my build was for WROOM not sure if it will work on WROVER

tawny creek
#

I'm using WROOM too

solar whale
#

Then my build should work via USB

#

But it won’t work via tx/rx do it’s not very useful to you.

tawny creek
#

E (547) uart: uart_set_pin(548): tx_io_num error via your build

#

have to get going for now for dinner

solar whale
#

Yeah I see that. Does not seem to hurt

tawny creek
#

but will poke back again if i at least can screen into the board

solar whale
#

Screen will not work.

tawny creek
#

err serial-into

solar whale
#

Good luck!

tidal kiln
tawny creek
solar whale
#

type AT

tawny creek
#

can't

#

It just stays at that cursor until i Quit

solar whale
#

is taht with my build?

tawny creek
#

yep

solar whale
#

hmm -- don't know. what board are you using

tawny creek
#

dis oen

solar whale
#

me too

tawny creek
#

oooh also new learn guide website layout 😮

#

@solar whale thanks sir! shall retire for now

solar whale
#

sorry -- keep at it!

raven canopy
#

@tidal kiln looking

#

@tidal kiln RTD needs to be kicked. last build was from Oct 2017...

tidal kiln
#

so the RTD config is all OK?

solar whale
raven canopy
#

does the webhook need to be updated?

tidal kiln
#

dunno

raven canopy
#

actually...hold on a sec.

#

last built 2 weeks ago.

solar whale
#

@tawny creek aha -- minterm.py does not work on my MAC ...

#

no idea how to make it work -- works fine on linux

solar whale
#

@tawny creek -- FYI - I found an app that does work on the mac and talks to the ESP32 -- https://www.decisivetactics.com/products/serial/ it has a 7 day free trial -- you need to got to the terminal tab and set the baudrate and then in "terminal settings" set "return key" to CR + LF).

#

@tawny creek sorry for all the messages -- but python /usr/bin/miniterm.py /dev/tty.SLABtoUART 115200 does work on my Mac ```[Jerry-desktop-mini-8:~] jerryneedell% python /usr/local/bin/miniterm.py /dev/tty.SLAB_USBtoUART 115200
--- Miniterm on /dev/tty.SLAB_USBtoUART 115200,8,N,1 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---

ERR CODE:0x01030000

ERROR

ERR CODE:0x01030000

ERROR

#

my default python is 2.7.15

solar whale
#

@meager fog here is what I am getting for the https URL request: ```---> AT+CIPSTART="TCP","api.github.com",443,10
<--- b'CONNECT\r\n\r\nOK\r\n'
---> AT+CIPSEND=68
<--- b'\r\nOK\r\n'
<--- b'\r\nRecv 68 bytes\r\n\r\nSEND OK\r\n'
<---: b'C'
<---: b'CL'
<---: b'CLO'
<---: b'CLOS'
<---: b'CLOSE'
<---: b'CLOSED'
<---: b'CLOSED\r'
<---: b'CLOSED\r\n'
Traceback (most recent call last):

#

ihere is waht I get from the "webclient" demo ```---> AT+CIPSTART="TCP","wifitest.adafruit.com",80,10
<--- b'CONNECT\r\n\r\nOK\r\n'
---> AT+CIPSEND=66
<--- b'\r\nOK\r\n'
<--- b'\r\nRecv 66 bytes\r\n\r\nSEND OK\r\n'
<---: b'\r'
<---: b'\r\n'
<---: b'\r\n+'
<---: b'\r\n+I'
<---: b'\r\n+IP'
<---: b'\r\n+IPD'
<---: b'\r\n+IPD,'
<---: b'\r\n+IPD,3'
<---: b'\r\n+IPD,31'
<---: b'\r\n+IPD,318'
<---: b'\r\n+IPD,318:'
[b'HTTP/1.1 200 OK', b'Server: nginx/1.10.3 (Ubuntu)', b'Date: Wed, 19 Dec 2018 03:44:02 GMT', b'Content-Type: text/html', b'Content-Length: 73', b'Last-Modified: Thu, 16 Feb 2017 17:42:29 GMT', b'Connection: keep-alive', b'ETag: "58a5e485-49"', b'Accept-Ranges: bytes', b'', b'This is a test of the CC3000 module!\nIf you can read this, its working :)']
---> AT+CIPCLOSE
<--- b'CLOSED\r\n\r\nOK\r\n'

#

this is with huzzah esp32 on feather m4 -- with my mod to the connect function ```diff --git a/adafruit_espatcontrol.py b/adafruit_espatcontrol.py
index 3c4248c..ed76c9f 100644
--- a/adafruit_espatcontrol.py
+++ b/adafruit_espatcontrol.py
@@ -154,6 +154,7 @@ class ESP_ATcontrol:
# read one byte at a time
response += self._uart.read(1)
# look for the IPD message

  •                print("<---:",response)
                   if (b'+IPD,' in response) and chr(response[-1]) == ':':
                       i = response.index(b'+IPD,')
                       try:
    

@@ -226,7 +227,7 @@ class ESP_ATcontrol:
raise RuntimeError("Connection type must be TCP, UDL or SSL")
cmd = 'AT+CIPSTART="'+conntype+'","'+remote+'",'+str(remote_port)+','+str(keepalive)
reply = self.at_response(cmd, timeout=3, retries=retries).strip(b'\r\n')

  •    if reply == b'CONNECT':
    
  •    if reply[0:7] == b'CONNECT':
           return True
       return False
    
karmic notch
#

is there a circuit python guide that can help with multi-tasking. My goal is simple, I want my circuit playground express to play the LED animation along with an audio clip when I press either A or B. Currently, my clip plays but led animation stops while file is playing.

solar whale
#

@meager fog ah -- if I set the URLt request type to SSL if I do that I get ```---> AT+CIPSTART="SSL","api.github.com",443,10
<--- b'CONNECT\r\n\r\nOK\r\n'
---> AT+CIPSEND=68
<--- b'\r\nOK\r\n'
<--- b'\r\nRecv 68 bytes\r\n\r\nSEND OK\r\n'
<---: b'\r'
<---: b'\r\n'
<---: b'\r\n+'
<---: b'\r\n+I'
<---: b'\r\n+IP'
<---: b'\r\n+IPD'
<---: b'\r\n+IPD,'
<---: b'\r\n+IPD,3'
<---: b'\r\n+IPD,30'
<---: b'\r\n+IPD,304'
<---: b'\r\n+IPD,304:'
Failed to connect, retrying
Failed to read proper # of bytes

#

and if I capture the response ```---> AT+CIPSTART="SSL","api.github.com",443,10
<--- b'CONNECT\r\n\r\nOK\r\n'
---> AT+CIPSEND=68
<--- b'\r\nOK\r\n'
<--- b'\r\nRecv 68 bytes\r\n\r\nSEND OK\r\n'
<---: b'HTTP/1.0 403 Forbidden\nCache-Control: no-cache\nConnection: close\nContent-Type: text/html\n\nRequest forbidden by administrative rules. Please make sure your request has a User-Agent header (http://developer.github.com/v3/#user-agent-required). Check https://developer.github.com for other possible causes.\nC'
Failed to connect, retrying
Failed to read proper # of bytes

tawny creek
#

@solar whale thank you! That worked!

#

Your built + Python 2.x

#

was running it in python3 -- wewps!

solar whale
#

yay! -- too bad you can't use that with the M4

tawny creek
#
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
A
ERR CODE:0x01030000

ERROR
AT

OK
AT+GMR
AT version:1.3.0.0-dev(6aafec8 - Dec  7 2018 02:23:19)
SDK version:v3.3-dev-343-g7fa98593b
compile time:Dec 16 2018 05:38:30```
#

could try again, which version of the ESP AT did you use with the ESP32 feather? (do you have the bin?)

#

I think your build is newer than the one available?

#

AT version:1.3.0.0-dev vs 1.1.2

solar whale
#

I built it from source and flashed it.

tawny creek
#

ill try that, maybe there's enough difference ?

solar whale
#

if you have trouble . I can rebuild it and send you the .bins

#

I'll make sure I can reproduce mine!

tawny creek
#

I'll try building first and bother ya if i have issues, should be okay though -- will report what i find !

solar whale
#

ok -- good practice for me as well.

#

@tawny creek when I build - it complains about missing "xrld" -- if I just type make again -- it continues and completes.. not sure what the issue is but it works. Also I went int make menuconfig (then select AT ) and disable AT BLE since I don't need it

#

ah just needed to install xrld sudo pip2 install xrld worked for me

tawny creek
#

Good tips! Will encounter these too prolly, still cloning...

solar whale
#

@tawny creek -- I do have a single file .bin that can be flashed if you need it.

tawny creek
#

@solar whale sure! I'm still going through building the toolchain 😓

solar whale
#

/usr/local/bin/esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 115200 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0 factory_WROOM-32.bin

tawny creek
#

Wooo!

#

ty sir!

solar whale
#

it has teh full 4Mbytes filled in

tawny creek
#

burning now

#

interestiiing

solar whale
#

I have to get to bed --- I hope it works! 💤

tawny creek
#

night night! thanks again @solar whale

solar whale
#

it taht via tx/rx -- it wont work via USB

tawny creek
#

yep via TX/RX

solar whale
#

hmmm -- try hooking it up to the M4 and use my esp8266comm program

#

if that does not work, I'm stumped

#

I'll be around tomorrow if you are still having trouble -- good luck and good night!

tawny creek
#

psst it worrks @solar whale

#

sleep well!

solar whale
#

does it really work?

tawny creek
#
<--- b'CLOSED\r\n\r\nOK\r\n'
OK
Parsing JSON response...USD per bitcoin: 3770.2
Free memory: 137.078
0
#

oh yeah 😄

#

im scrolling on a charlieplex display too 😃

solar whale
#

yay -- I will sleep well! hanve fun!

manic glacierBOT
manic glacierBOT
#

Hello, I am totally new to this circuitpython stuff.
What I am looking for, is a timer-callback, that will be executed repeatedly after a certain period of time (something like setInterval(callback, period) in JavaScript).
This should run asynchronous, that means, that my program is not sleeping, but could do other stuff meanwhile.
Is that possible with circuitpython? If so, is there any example?

manic glacierBOT
manic glacierBOT
marble hornet
#

How is the dma spi activated?

manic glacierBOT
teal bear
#

should that be CircuitPython ?

solar whale
#

It is part of the "core" common to MicroPython and CircuitPyhohn

teal bear
#

and what I a really looking for is build instructions

solar whale
#

@meager fog I made new .bins for the ESP32 -- I have a single file (all 4Mbytes) for an external ESP32 using the Tx?RX pins and I did a little cleanup on the "argon" build so have a new zip file and I new exable script witht he updated md5 checksums. Do you want me to post them here? and submit a PR for the miniesptool_esp32multifile.py or ido you want to hold off for now? Also, do oyu have some changes you are going to PR to ESP_ATcontrol? I have one change so far for the connect() but did not want to confuse things. I can wait until you have your changes in. I still want to do some more work on send() parsing.

#

what board are you trying to build CP for?

teal bear
#

but first I want to build it for something supported, then unix, then qemu

solar whale
#

ah -- interesting, but out of my area of experince -- I'll let others follow-up

manic glacierBOT
#

Hm, I do not fully understand, why such a MessageQueue model should be easier to understand than callbacks. Maybe it's, because I am used to callbacks ;-)
What is so special with your target customers, that you think, they do not understand callbacks?

I think, you have to invest much more brain in managing a couple of MessageQueues for different types of events (ethernet, i2c, timer, exceptions, spi, .....) or one MessageQueue, where you have to distinguish between different types of even...

teal bear
#

@solar whale pointing me to the readme in ports helped, missed that.

solar whale
#

@teal bear for some ports there are more specific instructions for each board in the boards folder (see the nrf ports and various boards)

tawny creek
#

@solar whale been running the esp32 example overnight and it’s running without issues so far😊

manic glacierBOT
#
[adafruit/circuitpython] New branch created: ladyada\-patch\-1
stuck elbow
#

Did anyone recently test the OLED FeatherWing with CircuitPython?

solar whale
#

how recently -- what problem are you haveing

#

@stuck elbow I have one connected if there is something you want me to try

manic glacierBOT
solar whale
#

@stuck elbow I can write to mine 128x32 OLED featherwing -- using bitmapfont and framebuf.py

idle owl
#

@tulip sleet Did we ever figure out why the new repos aren't showing up on Travis?

#

There is one

#

wait... hold on

#

the link is all wrong

#

it's there.

tulip sleet
#

@idle owl I fixed miniesptool and ATControl. They had webhook integrations with Travis. I deleted the webhooks but they did not show up as available to migrate. I asked travis support and they had me change the list of repos temporarily to specific ones (those) instead of "all". Then they showed up, I migrated them, and then switched back to all. I'll forward you an email.

idle owl
#

Thank you

stuck elbow
#

@solar whale thanks, I had some problems with it, turns out it's related to reset

#

it only works after you reset it once manually

solar whale
#

hmm -- not seeing that on mine

stuck elbow
#

maybe the reset circuit is broken on mine

#

you didn't pass a reset pin, did you?

solar whale
#

just a secon have to look

#

no - no reset pin defined

stuck elbow
#

were there several revisions of that wing?

solar whale
#

If I recall correctly yes -- and a change to RESET was part of it.

stuck elbow
#

ah, that would explain it

solar whale
#

some times they come up as a scatter of pixels

stuck elbow
#

mine is really old

#

yeah, basically they don't accept data

old tangle
#

Is it possible for the Trinket Pro 5V to use circuit python or is it FTDI only?

stuck elbow
#

@old tangle it's Arduino only

#

you need at least Trinket M0 for CircuitPython

old tangle
#

Ah, okay, thanks.

solar whale
#

I think one of mine behaves taht way

manic glacierBOT
#

I like the idea of message queues but I'm not convinced that they're any easier to understand than interrupt handers. Rather I think that conceptually interrupt handlers/callbacks are relatively easy to understand but understanding how to work with their constraints is where it gets a bit more challenging. Message queues are a good way of implementing the "get the operable data out of the hander and work on it in the main loop" solution to the constraints of interrupt handlers but as @deship...

stuck elbow
prime flower
#

@tulip sleet Does the RFM9x build exclude framebuf?

tulip sleet
#

yes because it's non-Express, so no room

prime flower
#

okay

#

thanks, whipping up a ping-pong-y demo and wasnt sure if i could use the ssd1306 with it

tulip sleet
#

could try a feather express + rfm9x wing + display (use a doubler or tripler)

prime flower
#

Yep - going to do that next 😃

solar whale
#

@buoyant wigeon this eample is working on my feather_m0_express with esp8266 AT -- I lowered the baud rate for the ESP8266 after initializing it. esp.baudrate = 9600 ```import time
import board
import busio
from digitalio import DigitalInOut
import adafruit_espatcontrol

MY_SSID = "yourssid"
MY_PASS = "yourpassword"

URL = "http://api.coindesk.com/v1/bpi/currentprice.json"

uart = busio.UART(board.TX, board.RX, baudrate=115200, timeout=0.1)
resetpin = DigitalInOut(board.D5)

print("Get bitcoin price online")

esp = adafruit_espatcontrol.ESP_ATcontrol(uart, 115200, reset_pin=resetpin, debug=True)
esp.baudrate=9600
print("Connected to AT software version", esp.get_version())

while True:
try:
# Connect to WiFi if not already
print("Connected to", esp.remote_AP)
if esp.remote_AP[0] != MY_SSID:
esp.join_AP(MY_SSID, MY_PASS)
print("My IP Address:", esp.local_ip)
# great, lets get the JSON data
print("Retrieving price...", end='')
header, body = esp.request_url(URL)
print("OK")
print(body)
except RuntimeError as e:
print("Failed to connect, retrying")
print(e)
continue

time.sleep(60)
#
<---: b'HTTP/1.1 200 OK\r\nContent-Type: application/javascript\r\nContent-Length: 673\r\nConnection: keep-alive\r\nAccess-Control-Allow-Origin: *\r\nCache-Control: max-age=15\r\nDate: Wed, 19 Dec 2018 21:20:32 GMT\r\nExpires: Wed, 19 Dec 2018 21:21:07 UTC\r\nServer: nginx/1.12.1\r\nX-Powered-By: Fat-Free Framework\r\nAge: 12\r\nX-Cache: Hit from cloudfront\r\nVia: 1.1 0e13fb4d27ad66ea3b1e7f3e7e64b042.cloudfront.net (CloudFront)\r\nX-Amz-Cf-Id: dY6P-qqCLaTowqucvL9a32d79JvYAVlamzxsFrGeyR9jJpWHHf2PCQ==\r\n\r\n'
[b'HTTP/1.1 200 OK', b'Content-Type: application/javascript', b'Content-Length: 673', b'Connection: keep-alive', b'Access-Control-Allow-Origin: *', b'Cache-Control: max-age=15', b'Date: Wed, 19 Dec 2018 21:20:32 GMT', b'Expires: Wed, 19 Dec 2018 21:21:07 UTC', b'Server: nginx/1.12.1', b'X-Powered-By: Fat-Free Framework', b'Age: 12', b'X-Cache: Hit from cloudfront', b'Via: 1.1 0e13fb4d27ad66ea3b1e7f3e7e64b042.cloudfront.net (CloudFront)', b'X-Amz-Cf-Id: dY6P-qqCLaTowqucvL9a32d79JvYAVlamzxsFrGeyR9jJpWHHf2PCQ==', b'', b'']
---> AT+CIPCLOSE
<--- b'20:00 UTC","updatedISO":"2018-12-19T21:20:00+00:00","updateduk":"Dec 19, 2018 at 21:20 GMT"},"disclaimer":"This data was produced from the CoinDesk Bitcoin Price Index (USD). Non-USD currency data converted using hourly conversion rate from openexchangerates.org","chartName":"Bitcoin","bpi":{"USD":{"code":"USD","symbol":"&#36;","rate":"3,755.4933","description":"United States Dollar","rate_float":3755.4933},"GBP":{"code":"GBP","symbol":"&pound;","rate":"2,976.8857","description":"British Pound Sterling","rate_float":2976.8857},"EUR":{"code":"EUR","symbol":"&euro;","rate":"3,301.9762","description":"Euro","rate_float":3301.9762}}}CLOSED\r\n\r\nOK\r\n'
OK
b''
buoyant wigeon
#

@solar whale Thanks.. will test it...

manic glacierBOT
solar whale
#

@buoyant wigeon FYI -my test evetually failed witha memory allocation error

buoyant wigeon
#

@solar whale I had something other to do... but testing now... It seems it is working OK... not all attempts BUT YES

solar whale
#

good -- yes, there will be many retries. Hopfully there will be updates soon to reduce them.

buoyant wigeon
#

@solar whale You are right ... sometimes "MemoryError: memory allocation failed, allocating 1099 bytes"

solar whale
#

yes ... sigh... this is pushing the M0 to it's limits

manic glacierBOT
teal bear
#

circuitpython/ports/unix$ ./micropython
MicroPython 4.0.0-alpha.5-26-g5e4b3a8 on 2018-12-19; linux version

#

what can I do to confirm this is CP and not MP?

tulip sleet
#

@teal bear we don't have a unix port for CircuitPython. What are you trying to do?

teal bear
#

@tulip sleet you do now 😉

#

PR coming once I dig out what was needed - mostly installing packages

#

my short term goal is CP on Arty fpga

tulip sleet
#

@teal bear That sounds great! We have done zero with the unix part of the tree. That's just left over from MicroPython. So it doesn't include all the CircuitPython-specific stuff like GPIO and peripheral support. You might want to start with ports/atmel-samd and gut the common-hal part and replace it with what works on the fpga board.

There are people trying to get TinyUSB running on an FPGA. Scott is helping them and that will bootstrap getting USB support in CPY (if your board has that).

fierce girder
#

@teal bear what soft CPU core is loaded on the FPGA?

teal bear
#

lm32

#

im confused: >>> sys.implementation
(name='circuitpython', version=(4, 0, 0))

#

good.

#

import storage
ImportError: no module named 'storage'

#

all the modules seem to be micropython flavor

fierce girder
#

Are you running the Linux kernel on the lm32 in this configuration?

teal bear
#

I have lots of configs going on right now :p

#

I just got CP to build on linux - that's what I am pasting from above

#

I have MP compiled for lm32, that's running on the fpga

fierce girder
#

It would make more sense to use CPython on Linux and leverage Blinka. Add support for lm32 / Arty to Blinka and then you can use the CircuitPython libraries. I added BeagleBone support to Blinka, so CPython (Python 3) on BeagleBone can now make use of the CircuitPython libraries from PyPI

manic glacierBOT
teal bear
#

@fierce girder how does that get me CP on fpga?

#

er, is CPython Cpython or CircuitPython?

fierce girder
#

I mean CPython, e.g. normal Python

#

Once you have a processor running Linux, there isn't really a point to having CircuitPython. Because you have normal Python implementation (CPython or PyPy). Blinka is a Python 3 library that supports Pi and BeagleBone. Blinka allows CircuitPython libraries to used from Python 3. This means that drivers for sensors can be written as CircuitPython libraries and then used on Pi and BeagleBone by leveraging Blinka.

#

Alternatively, you could port CircuitPython to the lm32 just as MicroPython was ported to the lm32. In which case, that firmware is running on the lm32, not the Linux kernel.

manic glacierBOT
solar whale
#

@meager fog ugh -- now I see that my concern the the connect() function in ESP_ATcontrol was incorrect. its fine. I find that slowing down to 9600 baud helps the reliability a lot. I still think I can imporve the send() parsing, but haven't made any progress. I plan to work on getting a "POST" command working so I can send data to Adafruitio via webhooks. I think I'll concetrate on that for awhile.

teal bear
#

it is only that big 😉

fierce girder
#

Sure. That is a good reason to avoid running Linux kernel on lm32

#

So it does make sense to run a small Python implementation as firmware, like MicroPython, instead of Linux

teal bear
#

more fun too 😉

fierce girder
#

It's unclear to me how much work it would be to add fupy port to CircuitPython

#

It's too bad that fupy isn't in the upstream MicroPython

teal bear
#

it is in my local repo 😉

#

doesn't build yet. but it's on my list

teal bear
#

never mind.. it is getting called, but mpversion.h isn't being used.. I guess

#

juser@gator:~/temp/circuitpython/ports/unix$ ./micropython
MicroPython 4.0.0-alpha.5-28-gca60a034c on 2018-12-19; linux version
juser@gator:~/temp/circuitpython/ports/unix$ grep MICROPY_FULL_VERSION_INFO build/genhdr/mpversion.h
#define MICROPY_FULL_VERSION_INFO ("Adafruit CircuitPython " MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE "; " MICROPY_HW_BOARD_NAME " with " MICROPY_HW_MCU_NAME)

teal bear
#

circuitpython/ports/unix/build/genhdr$ ack MicroPython
qstr.i.last 619974: mp_hal_stdout_tx_str("MicroPython " "4.0.0-alpha.5-28-gca60a034c-dirty" " on " "2018-12-20" ";

#

that. make that not be that. >:

manic glacierBOT
#

I'm not sure how complete this is, it is what I needed, so I'm done for now.

TODO.txt lists 4 issues.
They aren't blockers, and not even worth cluttering up the issue tracker.
But some day someone may wander in here and it will be nice to know the landscape.

and hey, the tests pass.

672 tests performed (19057 individual testcases)
672 tests passed
26 tests skipped: buffered_writer builtin_help builtin_range_binop class_delattr_setattr cmd_parsetree extra_coverage framebuf1 fra...

buoyant wigeon
#

@solar whale Some news about ESP_ATcontrol?

solar whale
#

@buoyant wigeon I have nothing new.

buoyant wigeon
#

@solar whale I have seen something in communication, and it seemed to me that it was something new... OK, I'm still at work 🙁

solar whale
#

I reported last night that one issue I thought I found was actually OK so does not need to be fixed. I have found that lowering the baud rate to 9600 seems to help make it more reliable.

buoyant wigeon
#

@solar whale FYI ... with baudrate=9600 and esp8285 success 😀

gusty topaz
#

Saw the latest post on CP support for Particle Argon (nRF52 + WiFi). Excellent work, you guys are moving fast!. Quick question: any news on supporting the Bluefruit nRF52 currently on Adafruit?. I understand it's in early Alpha, but I'm not sure if bluetooth capabilities are currently available.

main meteor
#

I'm not holding my breath for CP on nRF8001, though!

gusty topaz
solar whale
#

@gusty topaz there has been alpha support for it up to now, but last week it was decided to drop it since it does not support native USB. The focus is on the nrf52840s.

#

I think I'll revert mine back to MyNewt

gusty topaz
#

That's too bad... I was waiting for at least beta support for the nRF52832

#

What's MyNewt?

solar whale
#

really need the JLink to set it up.

gusty topaz
#

What benefit does MyNewt bring to the table?

solar whale
#

just another development environment/RTOS

#

I only did some simple examples with it before switching to CP. Looking forward to finding time to get back to it.

gusty topaz
#

Got it.

#

So, is there currently BLE stack support in the CP alpha for the upcoming nRF52840 Feather Express?

solar whale
#

the bleio module is a "work in progress"

#

yes it is supports the nrf52840

gusty topaz
#

@solar whale thanks!.

solar whale
#

@gusty topaz the support is pretty limited and there are issues to be resolved

gusty topaz
#

got it. I noticed the Particle Argon has an nRF52840 + ESP32.
Are there plans to bring full CP support to it?

solar whale
prime flower
#

experimental 😃

solar whale
#

One warning -- I have installed this on an Argon and it is working well, but I have not attempted to restore the Argon to the Particle mesh firmware it was delivered with -- I don't know if can be done. I would expect so, but can't confirm that. I don't plan to "go back"

#

@gusty topaz FYI -- I had been using an nrf52832 feather for a project and I found that he Particle Xenon board was an excellent replacement -- I expect the new feather 52840 to be the same. Looking forward to getting one.

#

The xenon nad the feather 52840 are much nicer than the feather 52832 in that they have QSPI flash chips and native USB and work with the UF2 Bootloader.

#

For the particle boards, you need to flash a new bootloader with a J-Link.

gusty topaz
#

ohh wait.. you are right!, I hadn't thought of it that way. The Xenon has the same hardware as the upcoming nRF52840 Feather Express, right?. So I could install CP on it? (I already have 2 Xenons).

solar whale
#

yes -- Works great!

#

it is in the Alpha5 release

#

BTW -- particle finally updated their firmware so My (other) xenon is also able to join a mesh network with an (other) Argon -- pretty slick!

#

before it would not work with Xfinity routers...

gusty topaz
#

Wait, when you say the Xenon is capable to join a mesh network with an Argon... none of those boards is running CP, right?

solar whale
gusty topaz
#

that;s what I thought. IF the regular CP for nRF52840 runs smoothly on a Xenon, I might just sacrifice one and install CP on it just to play with it. Have you tried to "go back" to Particle's firmware?

solar whale
#

no - not yet ...

gusty topaz
#

Well.. I think it's worth the risk! 😬

solar whale
#

me too!blinka

gusty topaz
#

Thanks @solar whale , I really appreciate it. You just gave me some ideas for future projects. Hopefully CP will be released as a stable version for these boards soon.

solar whale
#

Good luck with your projects. There is a lot of rapid development underway -- Fun times 😉

manic glacierBOT
#
[adafruit/circuitpython] branch deleted: ladyada\-patch\-1
manic glacierBOT
solar whale
#

@meager fog what's the nrf build issue?

idle owl
#

It's some weird ones.

solar whale
#

I can build for the boards I am using

idle owl
#

@solar whale It builds but they're not working right apparently.

manic glacierBOT
#

yes, regression/testing: having a reference to compare other builds to.

This is part of my plan to port CircuitPython to this FPGA board https://www.crowdsupply.com/sutajio-kosagi/fomu/

I can see it being useful to people writing in CircuitPython - they can quickly edit/test on their laptop or a remote machine, no need to have a device plugged in. But that's just me making stuff up, no idea if it will ever actually happen.

solar whale
#

ah -- OK -- I'll look for details -- I have not had any problems recently.

#

may be on code not yet merged to master

manic glacierBOT
idle owl
#

@solar whale I think it's master... Something with it resetting and making it a single click to the bootloader. They're trying to nail down where the issue started.

#

Which is apparently a big deal because we don't have CircuitPython reset when it borks, we have it hang so we can see what happened.

solar whale
#

interesting -- I had not noticed that - is it the bootloader or CP?

idle owl
#

CP for sure. Bootloader is fine evidently.

#

The single click is presumably because it's already reset once so one click gets you back to the bootloader

#

There was a lot more to the discussion, but that's the easiest bit for me to extract

solar whale
#

OK - thanks -- I wonder if it is only on the new feather nrf52840 or all nrf52s -- I have mostly been using the particle boards and have not noticed a problem.

idle owl
#

Oh.... that might be it yes, it might be related to the new one. That may be why you're not having an issue.

solar whale
#

Thanks for the info. Hope it gets resolved soon.

tidal kiln
#

hey @idle owl how'd workshop go?

idle owl
#

@tidal kiln Really well, apparently! Thanks for asking! I have another one this evening. The first one was at the local hackerspace, this one is for the local Python Users group.

#

There's a video of the one from Monday but I haven't reviewed it yet so it hasn't gone up.

tidal kiln
#

cool cool. good luck with one tonight!

idle owl
#

Thanks! I'm super nervous as always 😄

tidal kiln
#

ha! and it's python users. hopefully it won't digress into pythonic esoterica

idle owl
#

Right?... I had one person arguing how MicroPython compared before my talk even began on Monday 😆

#

I said it was beginnery so we'll see. I'm sure my basic understanding of certain things will catch up with me at tonight's.

tidal kiln
#

"you should use a lambda function with a generator inside a list comprehension!!!"

solar whale
#

You should never user the phrase "you should" ... 😉

manic glacierBOT
#
def script_to_map(test_file):
    r = {"name": chew_filename(test_file)["func"]}
with open(t) as test:

https://github.com/adafruit/circuitpython/blob/master/tools/tinytest-codegen.py#L24-L26

    with open(t) as test:
NameError: name 't' is not defined

obviously this is the fix: with open(test_file, "rb") as f:
but then more things break

   s = s.decode()
AttributeError: 'str' object has no attribute 'decode'

I suspect a merge mixed some python 2 and 3...

idle owl
#

@tidal kiln Ping me when you're around

tidal kiln
#

@idle owl ping

teal bear
idle owl
#

@tidal kiln I need a little help with archiving a library. There's some issues and PRs on it and I'm not sure if they should be merged/addressed/added to CP lib

tidal kiln
#

np. linky?

idle owl
#

The one with examples is probably fine I guess? But the other one changes core code

#

and I think we have the functionality in all the issues, but I'm not certain

tidal kiln
#

ISS 4: not a repo issue, should ask in forums
ISS 6: i fixed that in CP driver
ISS 10: not a repo issue, should ask in forums
PR 1: CP driver takes a different approach, but supports what they are trying to do
PR 2: ask them to resubmit if they want using code with CP version of library

idle owl
#

Ooh well done, better than I would have done. Thank you.

tidal kiln
#

for iss 6, might as well give them links to the work done on the CP side....

idle owl
#

Thank you

tidal kiln
teal bear
#

ports/qemu-arm$ make => build/py/parsenum.o: In function mp_parse_num_integer': parsenum.c:(.text.mp_parse_num_integer+0x6e): undefined reference to translate'

stuck elbow
#

by the way, google summer of code org registration starts 15 Jan, should CP participate?

teal bear
#

how do the supported builds get translate ?

#

im pretty sure I need to put this somwhere: #include "supervisor/shared/translate.h"

river quest
#

hi hi @stuck elbow !

#

we'd like to do that if there was some help to make sure it was done good' if you are interested, let me know pt@adafruit.com

#

we can work out how to make it happen together if ya want

stuck elbow
#

ok, I will try

solar whale
#

@meager fog Do you want to update the .bin files for the ESP32 AT Firmware. I have a new set for the Argon (minor change - just got rid of an annyong erro message by disabling the console UART) and I have a single 4Mbyte file for the ESP32 Huzzah Feather (factory.bin) . I can drop them here and put in a PR for the miniesptool_esp32multifile.py with updated checksums if you want. I don't think there is any functional change. I thought the load file for the standalone ESP32 might be useful if you are going to recommend it for SSL.

manic glacierBOT
#

I've had a longterm goal to try and use i2cslave with async/await since it looked like a simple way of gettting multitasking in CircuitPython.
Inspired by issue #1380 I set out to see what it could look like.

I haven't done much testing, the main purpose at this stage is to serve as an async/await example in the async discussion.

I was pleased to find that uselect had a flexible signalling mechanism for I/O. I think it can also be used for pin interrupts.

This scheduler/eventloop is...

meager fog
#

@solar whale heya i can make you an author of the guide

#

and you can Go To Town

#

wnna do that? 😃

#

id prefer not hvaing a 4BMB file if we can avoid it - since express boards are 2mb

#

sparse is better

solar whale
#

sure -- the 4Mbye is not for miniesptool -- just for flashing via USB

#

I also can make a zip of the sparse files -- I can't test uing miniesptool to an external ESP32 though.

meager fog
#

you'd have to maintain 2 then

#

which is ok by me

#

just FYI

#

you could try trimming' 0xFF's from the end

#

might fit on an argon

solar whale
#

but not needed on argon -- teh zip file has the sparse load for the argon now

meager fog
#

@solar whale are you in the learning system

#

i cant remember :/

solar whale
#

Yes

meager fog
#

can you point me at a guide you did

#

so i can grab yr username

solar whale
#

just a sec -- I just made some adds to a few --

meager fog
#

ok brb

solar whale
#

@meager fog I was kind of thinking that the miniesptool example would only be for loading to the argon and then provide the big.bin for a simple way to flash a feather HuzzahESP32 via USB. Do you also want an example of flashing ann external EPS32 via miniesptool? I'll need to get one of the Espressif boards to be able to test that since it did not work with wires on my Huzzah. I can do that if you want , but it will take some time. I'll work on the rest over this weekend.

#

I have to go for awhile -- will check back later.

meager fog
#

@solar whale ahh ok you're now added

solar whale
#

Thanks. I’ll try not to mess it up 😉

manic glacierBOT
manic glacierBOT
manic glacierBOT
#
  1. RGB led was being used before stack_init(), so assert_heap_ok() was being called too early. Ignore heap check if stack not allocated yet.

  2. Multiple issues with nrf qspi_flash.c:

  • Two bitfield setting bugs: wrong or missing Pos values.
  • read function didn't return false if error
  • minor cleanup.
  • 32 MHz QSPI frequency was too fast when paired with GD25Q16C, even though that chip is supposed to be good up to 104 MHz. Not clear if it was SPI flash chip's fault or an issue ...
tulip sleet
#

@teal bear could we talk about the qemu-arm and other non-supported CPy ports? I want to understand what your goals are; don't want to discourage you, but want to make you aware of the changes we've made relative to MPy.

#

We have a bunch of devices under ports/ that are just left over from forking MicroPython. We haven't brought these up to date, but haven't deleted them either, to make merging from upstream easier.

#

the nrf and atmel-samd ports are active. We are going to discontinue esp8266 in 4.0.

teal bear
#

so I want various 'simpler' ports before I dive into 'that'

#

i not looking for a fully functional CP, just something that builds and boots/runs/doesn't crash

tulip sleet
#

nrf and atmel-samd depend on shared-bindings, shared-modules, and each has their own common-hal. We added that structuring to the source tree. it's not used by the other ports. We've also refactored main.c into a common one (not per port), etc., etc. All the other non-CPy ports don't have all this, and we don't expect them to build. We just keep them around so the merges will happen as fast forwards in those directories.

#

got it - does the fomu support an ARM core, or does it have its own architecture and its own toolchain for its CPU core?

#

ok, I clicked the link - I see a RISC-V core

teal bear
#

it supports lm32 and I think risk-v

tulip sleet
#

are both little-endian? we make that assumption a lot of places

teal bear
#

don't know, but just a sec I have the dev's ear just now...

#

if you do IRC, freenode #timvideos xobs

tulip sleet
#

i don't have irc right now

manic glacierBOT
tulip sleet
#

@teal bear are there gcc-based toolchains for lm32 and risc-v?

teal bear
#

yes

manic glacierBOT
tulip sleet
#

A RISC-V port would be great! We just haven't had anyone start with that yet. THe RISC V chips we know of don't have native USB, so they were less interesting due to not being able to do CIRCUITPY mass storage.

#

The Fomu would just be one board under a general RISC-V port.

#

The way to start would be to, say, copy the atmel-samd tree, and then start replacing all the samd-specific stuff

#

it's not worth trying to start with qemu-arm or something else that hasn't already been adapted to our port style

solar whale
#

@tulip sleet Did not see these
issues on the particle boards. Do they used a different flashchip? Or did I just not trigger the problems?

teal bear
tulip sleet
#

@solar whale i don't know the answer to that. It may be layout or something about the flash chips. Those flash chips are rated 133 MHz, so they would be the highest speed. So these fixes will cut their speed in half.

solar whale
#

Ah- I see that the particle are same as pca10056

tulip sleet
#

I see MX25L. The PCA10056 is MX25R, which is 8 MHz in our table.

solar whale
#

Oops. Sorry.

tulip sleet
#

@teal bear you could reuse parts of the hal layer from micropython for that, same idea as above

teal bear
#

@tulip sleet xobs: They're different endiannesses. I think it's lm32 that's big.

tulip sleet
#

yeah, I think scott mentioned that. oy.

#

we assume stack grows down, etc.

teal bear
#

does that mean I shouldn't bother trying CP on lm32?

tulip sleet
#

there would just be a lot of code to check or conditionalize for endianness

#

it would certianly be possible, but more work - maybe not a huge deal

teal bear
#

sounds like too much work for .. likely no point.

#

the point of the intermediate steps is to have references of things that work, and not a 2nd thing that doesn't work either

tulip sleet
#

yes, it's like a huge problem set, and how many lm32 boards really want to run CPy?

#

what are the flash and ram sizes for the fomu?

teal bear
#

128 and 2m

tulip sleet
#

128kB?

#

flash?

teal bear
tulip sleet
#

other way round?

teal bear
#

er, no.

#

too many tabs :p

tulip sleet
#

that's plenty roomy

#

@solar whale argon is set up as SPI flash, not QSPI for some reason.

manic glacierBOT
solar whale
#

Is xenon the same as argon. I'm not sure where to look.

tulip sleet
#

look in ports/nrf/boards/*/mpconfigboard.mk. QSPI_FLASH_FILESYSTEM vs SPI_FLASH_FILESYSTEM. I seem to remember maybe there were schematic diffs, but I might be making that up.

solar whale
#

Xenon is qspi

tulip sleet
#

it's possible they needed the pins for something else

solar whale
#

In the morning. I can pull the or and try it on argon and xenon if that would be helpful.

tulip sleet
#

sure, it should work. if you've seen that CIRCUITPY is stable on those boards, then good, if not, then this might be the reason. Limor was testing and CIRCUITPY seemed very flaky. It might also be that the GD25Q16C's are flaky, but they work OK on the itsy M4. could be a combination of the nrf chip peripheral and the GD25Q's. I await advice from the more experienced folks on this.

#

@teal bear so see how things go and feel free to circle back for consultations

solar whale
#

I have not noticed any problems and I've been using them a lot this past week.

tulip sleet
#

i just have one Feather 52840 to test with, but Limor saw similar probs. I'm not sure Scott did, he has just one also.

solar whale
#

I'll let you you know if I see any impact with the PR. Should be able to try it in the morning.

tulip sleet
#

thanks

#

i will relax for the rest of the evening 😃

solar whale
#

Well deserved!

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I downloaded this PR and built images for the Particle Xenon and Argon boards. Both appear work normally. No obvious impact.
I also tried changing the setting for the Argon in mpconfigboard.mk from using SPI_FLASH_FILESYSTEM = 1
to
QSPI_FLASH_FILESYSTEM = 1
and rebuilt. This also works normally on the Argon
Was this a "typo". Should it be changed?

FYI - I accidentally loaded the Xenon build to the Argon and it worked fin except for the missing pin definitions...

manic glacierBOT
solar whale
#

@tulip sleet my Argon has been happily running for a few hours with the PR installed (and using QSPI ) no issues -- happliy checking bitcoin prices 😉

waxen basin
#

Hello everyone !! I'm Ben and I just joined the circuitPython family. I got a Huzzah32. It's up and running. Here's my question. I'm kind of new to Python, and I'm use to VS Code for development. I would love to benefit from Intellisense , formatting and llinting wile writing my code. Right now, because MicroPython is not installed on my mac, I don't have any of that. What is your workflow? Should I create a Micropython environment on my mac, or can I just grab all the libraries and add them to my PATH in Python 3? I'm exciting to learn more on Python / MicroPython for Microcontrollers !! Thank you for your help !!

stuck elbow
#

@waxen basin I'm afraid it's non-trivial to get that to work with VS Code

#

@waxen basin part of the problem is that even if you install micropython on your mac, it will be the unix version of micropython, with different libraries than the esp32 micropython

#

(plus, I doubt VS code can use it)

waxen basin
#

ohhhh ... okay, I didn't know that. Thanks gor the info

stuck elbow
#

so one thing that people have done, they made "stub" libraries of all the libs they use, but for python3

#

they only contain all the classes and functions, without actual code

waxen basin
#

I don't know what a "stub" library is, but that sounds like the second option I had in mind

stuck elbow
#

yeah, that's pretty much it

#

except many of the libraries are implemented in C in the micropython itself, so they don't have python code

#

so for those you will have to write "dummy" libraries

#

just to get the code completion working

waxen basin
#

that would be all i need. I'm not planning on using Micropython anywhere else than embedded on a microcontroller

stuck elbow
#

you might try googling around, it's possible someone already did all the work

waxen basin
#

I'm gonna try to find some

#

would be awesome

stuck elbow
#

yeah, though the pyb module is specific to the PyBoard

waxen basin
#

yes, just the first one I found, but I imagine that if it exists for the pyBoard, a more generic version should exists somewhere.🤞

#

what's your worflow?

stuck elbow
#

I just use vim, nothing fancy

manic glacierBOT
manic glacierBOT
manic glacierBOT
solar whale
#

@tulip sleet is it working now on the feather52840?

tulip sleet
#

Yes, for me at 16 MHz. Tried some things to get it back to 32 that didn’t work, so I’ll leave it there for now.

solar whale
#

Good to know -- pulled updated PR and ran on Argon - still happy -- should I put in a PR to change the SPI to QSPI on the Argon?

upbeat plover
#

im stuck on enable second spi, is it needed?

solar whale
#

only if you have the main SPI already tied up.

upbeat plover
#

okay

#

also i did
ls /dev/spi*
and it shows only
/dev/spidev0.0 /dev/spidev0.1

#

pi zero w

#

should it have the
/dev/spidev1.0 /dev/spidev1.1 /dev/spidev1.2
?

solar whale
#

no just 0.0 and 0.1

upbeat plover
#

okay thank you, ill continue on tut and see how it goes

solar whale
#

I don't use the 2nd SPI

upbeat plover
#

im actually not going to be using the SPI, but just wanted to install everything correctly

tidal kiln
#

@upbeat plover yah, you don't need it unless you need it. but what problem did you run into? does guide need fixing?

solar whale
#

good idea -- as long as blinkatest runs its should be OK

upbeat plover
#

enabling second SPI is where i was having issues, i think i followed tut correctly

but when i
sudo nano /boot/config.txt
couldnt find where to place
dtoverlay=spi1-3cs

tidal kiln
#

just add it at the end is fine

upbeat plover
#

okay thanks ill do that

tidal kiln
#

and you have to reboot for them to show up in /dev

#

but, yah, you can skip that for now

upbeat plover
#

that should be added to tut, nothing says something about reboot there

tidal kiln
#

it does 😃

#
to the bottom of /boot/config.txt and rebooting
upbeat plover
#

oh dargh

#

your correct

#

ill see what pops up now for the
ls /dev/i2c* /dev/spi*
now

#

Everything is there. 😃 thank you @tidal kiln & @solar whale

tidal kiln
upbeat plover
#

installing blinka now

#

i hope it works, want to use pi zero w to check stuff in the grow room with VNC from my phone anywhere

#

works well, had a type but other then that works very well... im happy with it. had "budio" instead of

#

"busio"

#

i notice ill have to change some code for my feather m4 stuff to work
board.SCLK
from
board.SCK

tidal kiln
#

hmmm. wonder why that's different on the pi?

upbeat plover
#

i was wondering the same

#

i did a
print(dir(board)) with my blinka test and noticed that SPI is labeled a little differently

tidal kiln
#

not sure, but may just be following existing naming convention already in place for the various boards

upbeat plover
#

its not really a big deal just need to remember it when copying code from other projects

#

hmm didnt realize i need ADC for analog

upbeat plover
#

to read analog i need ADC? and to write analog i need DAC?

stuck elbow
#

yup

#

analog to digital converter, and digital to analog converter, respectively

solar whale
#

@idle owl @raven canopy 🛠 the floodgates are open 😉

idle owl
#

WE ARE DOING THIS

raven canopy
#

mayyyybe 😆

meager fog
#

OMG RIP MY INBOX

idle owl
#

BLOWING IT UP

raven canopy
#

Belated warning: Email boxes will feel pain today. Sowwy! (but its for a good cause)

meager fog
#

@upbeat plover we just did a re-release of blinka, if you can pip3 update it

solar whale
#

Im going to reply to every one of those emails 😉

meager fog
#

@upbeat plover you can help test it 😃

#

me too!

#

@solar whale ill get to wifi stuff again this weekend

#

i have some gfx cleanup i want to do

#

get soft-framebuf implemented, oleds working again

#

then oleds working with pillow on linux

#

then deprecating the old oled lib

raven canopy
#

btw...the flood is not over. i missed a conditional check and we aborted on it.... re-launch in 3, 2, 1... 🚀

solar whale
#

@meager fog np -- I'll try to get guide updates in this weekend as well

#

look forward to framebuf -- I'll be happy to test.

#

upgraded blinka on a RPi 3B+ -- nothing broken ... yet

meager fog
#

thanks, it should now work on pi zero as well

#

and we can do the original pi's next

solar whale
#

cool! I've been using zerow's but not zeros

#

ohh - i have a zero

upbeat plover
#

how do you update?

solar whale
#

@upbeat plover pip3 install --upgrade adafruit-blinka

tidal kiln
#

Mugatu: "That Travis Badge...."

raven canopy
#

😆

#

Did anyone warn the Prime Minister of Malaysia?

solar whale
#

We should forward all the messages to @raven canopy

raven canopy
#

i think its almost over. @solar whale i'm feeling it too. I'm getting the Travis passed/failed plus merge emails. 😄

idle owl
#

Just be glad I'm not taking the time to approve them all before merging 😆

#

I just created a Travis filter. Like... 5 minutes ago. 😄