#circuitpython-dev
1 messages · Page 218 of 1
l8r!
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
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?
@solar whale i had to revert back some of the uart.read(1)'s cause readine one byte at a time cuases buff overruns
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.
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
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.
np
the M4 can handle the code lines, but the uart isn't big
we'll get the nrf52 uart caught up eventually
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
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.
@gleaming magnet is it the same main.py as in the remote control ornament guide?
are you using the .mpy version of adafruit_irremote?
Yes and I am using ir 389. I am using the py version of adafruit_irremote
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.
OK thank you for the help! Very much appreciated. Sorry for the newbie questions.
no problem! - there's a lot to learn up front. Circle back if you have problems.
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?
@tawny creek I have not seen that. I do get many retries but it recovers. What boards are you using?
@solar whale an m4 feather express with an esp8266
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.
@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
*.ldfiles. - 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.)
@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?
@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.
@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 😃
@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
@meager fog Thanks! ok! shall see what i can find :)! #detective-mode 🕵
Ok, thanks for looking into it. I'll try to compare with micropython as well next time I work on this.
I too want to get this to work, because we could use the space, especially on the nRF528325 build.
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
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.
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)
This is exactly my problem (reading history now - I may bug @tulip sleet tomorrw) https://github.com/adafruit/circuitpython/issues/111
I have had problems writing to the onboard filesystem from Windows. I sometimes see complete filesystem corruption, and sometimes just problems with one file. See https://forums.adafruit.com/viewto...
<@&356864093652516868> Meeting notes for tomorrow are here: https://docs.google.com/document/d/1DhFiFKPp-k4LKHvd0f5AdB3Zq_IF1MjqvHdZPplVhAQ/edit?usp=sharing Talk with you soon!
CircuitPython Weekly December 17th, 2018 Next meeting will be Thursday December 27th and then January 7th, 2019 to start the new year. Join us on Discord any time: adafru.it/discord. State of CircuitPython + Libraries Overall Core Libraries Hug reports @tannewt @jerryn ...
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?
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...
I'm not sure if you tried that already, but you can also remove the parts that you are not using from the CircuitPython image. I discovered that, for example, removing AnalgoIO saves a lot of space. Then HID might fit?
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
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...
@marble hornet try running make translate before building firmware.
I think it's translate. goes looking
Yep!
@jerryneedell heya is this issue resolved?
@robmarkcole fyi i've been using ujson on m4 builds, seems to work well! try it out :)
@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
FYI , On voice, but lurking today.
Lurking too
text only
<@&356864093652516868> meeting starting in a minute
lurking
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...
@meager fog Feel free to post your hug reports and status updates, we're about there 😃
@slender iron Brennen's in the notes.
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
I will be lurking today, group hug
@slender iron Congrats
text only for now
- @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!
@marble hornet do you have hug report and/or status?
Happy Holidays to all
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"
i'll post a link to my repo! (100% cp)
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
ok thanks!
Great suggestion @inland tusk !
oops typo, sorry
Dan, we could have web scraped that! :D
@meager fog gladly
nothing from me
@meager fog status update?
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'
thanks!
WOO WHOO! nrf52840!!
@meager fog 's new guide is excellent!
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.
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,
You got to where I was going with threads. 😄
dan has an issue with discussion
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
people also say "I need interrupts", but sometimes they need what interrupts can do, and not necessarily the mechanism
Pointers aren't a positive? 😆
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
multi processor is an interesting approach to multi threading 😉
you can signup for the propeller 2 😉
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.
okay, I know what you mean! There are many solutions to one problem! i'll give it some more thought
@fathom lava No worries! I've added your reports to the notes 😃
Thanks everyone! Best wishes, @slender iron !
Thanks everyone! Have a great holiday, and enjoy a break. Rocking it all the time, like this community does, is tiring.
happy holidays!
Happy Holidays all and thanx all 😃 what a great community
happy winter solstice
oh thank goodness
dark at like 3pm
@slender iron wanna chat fast about memory
or you wanna bolt to something else?
Later taters!
See you later
👋
@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!
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.
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!
😉
ok... how soon will CircuitPython be running on https://www.parallax.com/product/propeller-2 ? 😉 lol
(I want one now... thanx 😦 )
before people get too excited... (this is humor, it isn't out yet) 😉
but I still want one... (now) 😦
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.
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)
I think 32 is correct. Prop1 was 8 cogs.
😅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?
@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?
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.
@obtuse ibex I think you need to drag cp onto it. You are in bootloader mode
@obtuse ibex you can download a uf2 of cpy here https://github.com/adafruit/circuitpython/releases
and drag it onto the mass storage
<@&356864093652516868> Here is the recording of today's meeting: https://youtu.be/pbCp57K3Rs8
Notes with time codes are available here: https://github.com/adafruit/adafruit-circuitpython-weekly-meeting/blob/master/2018/2018-12-17.md Thanks to @kattni ...
@obtuse ibex excellent, happy to help
@obtuse ibex awesome! What cha making?
@meager fog found one in my desktop bwos. Time to start porting😋😉
@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.
@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 😔
nvm i can write with slicing but fram i can't... i can't copy paste my lib ={
@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
..with feather_m0?
yes
OK.... the theme for tomorrow...
Good luck!
Good night 😀
i think i can copy paste okay and just use "for in range" instead of slicing
looks good, can you toss me a UF2 and ill test it on the nRF52840 feather?
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
@marble hornet Conbadge
🎃
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.
@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.
how do you do bytearray(b'\xff\xff\xff\xff\xff') for data in that code?
You can pass in a bytearray, list, or tuple.
seems to be working well, using bytearray i can store strings
To a point yes. ord() comes in handy with certain characters from what I tested.
@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
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)
@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
Goof evening all. @river quest , thanks for the awesome neotresllis M4 for adabox 10. Though, I am having a problem with one of the examples from the site.
On bootup, it says merry christmas, lights up and then lights out LED on the back is flashing green yellow then blue
@karmic notch it sounds like the code is erroring out for some reason. the blinking lights are coded message:
https://learn.adafruit.com/welcome-to-circuitpython/troubleshooting#circuitpython-rgb-status-light-18-18
it would be easier to tell what is happening if you can access the REPL - do you know how to do that?
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 ?
i don't think mu currently supports that board
and i'm guessing it's a circuitpython version issue
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
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
what operating system are you on?
Win 10
here's the general how to for windows:
https://learn.adafruit.com/welcome-to-circuitpython/advanced-serial-console-on-windows
I ended up jumping ahead and found it.
cool. no worries. that should work.
i saw someone else run into a similar issue
same code example / same fix
that code uses some newer features of the audioio module
did it make glitchy noises?
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
could be. what was the crash? just the sound, or did it do something else?
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
were you pressing the buttons at an angle?
I can't say, as I was passively pressing buttons while reading. 😃 , since i read about that jus tnow I was trying that intentionally.
it may have been that. next time it happens see if that's what it was.
Yeah, I have also gotten into the repl
excellent!
New Crash
way more info than blinking color lights.
can you recreate that repeatably? or is random?
seems random
int object? I'm guessing you have more than one different usage of a variable (or list entry, or somesuch).
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
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).
not sure what would be causing that. but can wait until after dinner 😃
@solar whale @buoyant wigeon we've made many updates to uart in latest 4.0.0 alpha's - that can make a difference
@meager fog yeah! -- seems to be OK with alpha5 -- just at simpletest -- no json in m0 so cant run bitcoin
yah for m0 you'll have to hand parse. icky but at least its no strtok
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 😃
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 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.
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?
I believe so @stoic stag
keep in mind that esp is mainly going to be supported as a coprocessor going forward
@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 @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 👍
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
@stoic stag for esp32 you probably want to use MicroPython
I wrote a small tutorial about controlling those little OLED displays directly, without a library: https://hackaday.io/page/5722-driving-oled-displays-directly
@stuck elbow Thank you -- that looks great -- Looking forward to trying it out.
it uses micropython, but I think it should be easy enough to translate
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!
C is so cool! and I've only written like 5 lines!
it gets less cool when you write more ;-)
programming is cool in any language 😉 It's nice to have a selection of tools available.
ever use Karel?
not me.
i have a cp and c question
shoot
ask away
the suspense...
drum roll...
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...
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
don't ask to ask, just ask
#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?
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
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 ?
yes
only the first #include will actually include the code, the later ones will be empty
the #something directives work at the level of the preprocessor -- they run before compilation, to produce one big text file to compile
👍
things between #if* and #endif only get included in that when the condition is met
#include is just like a "copy/paste"
so you can have different code depending on some settings or platform
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
implement #1043 . I only tested this with a simple Arduino sketch toggling gpio. It may contain bugs and/or incorrect reading, a proper testing e.g reading from IR sensor should be run to make sure this function probably.
thnx
so for testing should i just put it in shared modules?
then move it back when it comes time to pr?
@marble hornet shared-modules are for port agnostic functions, iirc.
@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
kk
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?
@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 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
I can try it with both the argon and a huzzah esp32 on the M4
yep thanx
@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
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 ....
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?
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.
Thanks for info... I didn't know...
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
That's good ... I'm not going to such an adventure 😀
you also have to flash the uf2 bootloader to the particle board -- need a J-link
I have J-link but also a lot of other problems in the solution... I will leave the new problems for the new year 😀
OK, sent by email ... and the branch is at https://github.com/nickzoic/micropython/tree/nickzoic/circuitpython-nrf-touchin-1048 if you want to build it yourself. I tested it on the dev kit board with the pad PCB pictured above hooked up by short hookup wires.
@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.
@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
@meager fog what have you been hacking into/with the ili? (if you can say)
alas after 60,000 hours of uptime, this machine is dying
@tawny creek something isnt connected right, you should be getting echo chars, check your wiring
@meager fog @solar whale stupid question ... can you confirm that the strip function works correctly in CP?
@buoyant wigeon I have not tested it explicitly but I suspect the problems are in the parsing not in strip.
Surelly yes... but I am trying something and ... probably is time to go to bed ...😔
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
The Adafruit Feather nRF52840 Express is the new Feather family member with Bluetooth Low Energy and native USB support featuring the nRF52840! It's our take on an ...
@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..?
@tawny creek which particle board are you using? if you're using one for that output, at least.
@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
k. (but yes, the new particle argon has particle's esp at firmware)
sorry, to clarify — the firmware here:
https://learn.adafruit.com/adding-a-wifi-co-processor-to-circuitpython-esp8266-esp32/firmware-upload
for the ESP32, is that only tested on the particle boards?
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.
That ESP32 is only for the particle argon.
ahh. guide should be updated? (non-judgey question)
the file name makes sense! DOH!!!
“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.
not a problem @solar whale ! happy to poke around anyway ☺
https://github.com/espressif/esp32-at. This is what I used. The default build will work for the Huzzah feather ESP32
I made a custom build for the argon.
I downloaded V1.1.1 off the official site, should that be ok?
@solar whale https://www.espressif.com/en/support/download/at
Downloads: SDK & Demos, APKs, Tools and Documents for Espressif Systems products and solutions
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 😃
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.
i do!
On Linux use miniterm.py /dev/ttyUSB0 115200
It does the proper end of line. Screen does not.
If you connect, juts type AT . The return. Should get OK
tried 1.1.1 and 1.1.2 firmware versions btw just in case something in the latest was borked
I just use a simple script on the M4 to talk to the ESP32 or ESP8266. I can post it if you want it.
Just a minute.
use for esp8266 or esp32
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
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
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
yeah will try a different ESP32 board/module
check rx/tx are crossed
yep they are
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?
@velvet badger which version of Mu?
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
you may need mu 1.0.1
@velvet badger https://github.com/mu-editor/mu/releases
Try 1.0.1
Will give it a try. Thanks.
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)```
That is the console/debug not the AT firmware
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
Upgrading Mu did the trick all. Thanks!
If you use my build, I think you will see AT on the USB port.
@velvet badger yaay!
But my build was for WROOM not sure if it will work on WROVER
I'm using WROOM too
Then my build should work via USB
But use miniterm.py
But it won’t work via tx/rx do it’s not very useful to you.
E (547) uart: uart_set_pin(548): tx_io_num error via your build
have to get going for now for dinner
Yeah I see that. Does not seem to hurt
but will poke back again if i at least can screen into the board
Screen will not work.
err serial-into
Good luck!
RTD / sphinx question - why aren't the properties being documented for this library? example:
https://github.com/adafruit/Adafruit_CircuitPython_ADS1x15/blob/master/adafruit_ads1x15/ads1x15.py#L71
isn't showing up:
https://circuitpython-ads1x15.readthedocs.io/en/latest/api.html
miniterm
type AT
is taht with my build?
yep
hmm -- don't know. what board are you using
dis oen
me too
oooh also new learn guide website layout 😮
@solar whale thanks sir! shall retire for now
sorry -- keep at it!
@tidal kiln looking
@tidal kiln RTD needs to be kicked. last build was from Oct 2017...
so the RTD config is all OK?
@tidal kiln according to what i'm seeing in github, yeah. but the build info from the last build shows the old sphinx config. https://readthedocs.org/api/v2/build/6113512.txt
does the webhook need to be updated?
dunno
actually...hold on a sec.
@tidal kiln here is the "correct" link: https://circuitpython.readthedocs.io/projects/ads1x15/en/latest/
last built 2 weeks ago.
@tawny creek aha -- minterm.py does not work on my MAC ...
no idea how to make it work -- works fine on linux
@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
@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
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.
@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
@solar whale thank you! That worked!
Your built + Python 2.x
was running it in python3 -- wewps!
yay! -- too bad you can't use that with the M4
--- 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
I built it from source and flashed it.
ill try that, maybe there's enough difference ?
if you have trouble . I can rebuild it and send you the .bins
I'll make sure I can reproduce mine!
I'll try building first and bother ya if i have issues, should be okay though -- will report what i find !
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
Good tips! Will encounter these too prolly, still cloning...
@tawny creek -- I do have a single file .bin that can be flashed if you need it.
@solar whale sure! I'm still going through building the toolchain 😓
/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
it has teh full 4Mbytes filled in
I have to get to bed --- I hope it works! 💤
night night! thanks again @solar whale
it taht via tx/rx -- it wont work via USB
yep via TX/RX
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!
does it really work?
<--- 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 😃
yay -- I will sleep well! hanve fun!
I've attached UF2 builds for the development kit and for the much awaited feather 52840!
firmware_uf2_pca10056.zip
firmware_uf2_feather_nrf52840_express.zip
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?
I had several attempt at writing a driver for those, but somehow I can't get them to work, even if I reproduce the Arduino logic exactly. There is some black magic at work in there, possibly having to do with timings.
By the way, is there a datasheet available for the 168x144 one somewhere? I couldn't find anything.
How is the dma spi activated?
@framlin - sorry, we don't have callbacks or other asynchronous features right now (they are in MicroPython but we're not using them). We're working on coming up with simpler concurrency mechanisms that are easy to understand, e.g. https://github.com/adafruit/circuitpython/issues/1380.
https://github.com/adafruit/circuitpython/blob/master/README.rst#core "mpy-cross A cross compiler that converts Python files to byte code prior to being run in MicroPython"
should that be CircuitPython ?
It is part of the "core" common to MicroPython and CircuitPyhohn
similar question about the MicroPython listed under https://github.com/adafruit/circuitpython/blob/master/README.rst#ports
and what I a really looking for is build instructions
@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.
@teal bear there is a guide here https://learn.adafruit.com/building-circuitpython or there are buil instruction for specific ports in the repostories for each port https://github.com/adafruit/circuitpython/tree/master/ports/atmel-samd#building
what board are you trying to build CP for?
@solar whale eventually https://github.com/fupy/micropython/tree/master/ports/fupy
but first I want to build it for something supported, then unix, then qemu
fupy on Arty, and later https://www.crowdsupply.com/sutajio-kosagi/fomu/
ah -- interesting, but out of my area of experince -- I'll let others follow-up
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...
@solar whale pointing me to the readme in ports helped, missed that.
@teal bear for some ports there are more specific instructions for each board in the boards folder (see the nrf ports and various boards)
@solar whale been running the esp32 example overnight and it’s running without issues so far😊
docs and reality don't match:
https://github.com/adafruit/circuitpython/tree/master/ports/atmel-samd#building
To build for the Arduino Zero:
make
carl@twist:~/src/circuitpython/ports/atmel-samd$ make
Makefile:3: *** You must provide a BOARD parameter. Stop.
carl@twist:~/src/circuitpython/ports/atmel-samd$
Did anyone recently test the OLED FeatherWing with CircuitPython?
how recently -- what problem are you haveing
@stuck elbow I have one connected if there is something you want me to try
@stuck elbow I can write to mine 128x32 OLED featherwing -- using bitmapfont and framebuf.py
@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.
@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.
Thank you
@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
hmm -- not seeing that on mine
were there several revisions of that wing?
If I recall correctly yes -- and a change to RESET was part of it.
ah, that would explain it
some times they come up as a scatter of pixels
Is it possible for the Trinket Pro 5V to use circuit python or is it FTDI only?
Ah, okay, thanks.
I think one of mine behaves taht way
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...
Got it to work with my tutorial, now I just need to change all the code examples.
@tulip sleet Does the RFM9x build exclude framebuf?
yes because it's non-Express, so no room
okay
thanks, whipping up a ping-pong-y demo and wasnt sure if i could use the ssd1306 with it
could try a feather express + rfm9x wing + display (use a doubler or tripler)
Yep - going to do that next 😃
Added to Expectations FAQ.
closin' cause i think dox are now clear. please reopen if its still not right :)
@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":"$","rate":"3,755.4933","description":"United States Dollar","rate_float":3755.4933},"GBP":{"code":"GBP","symbol":"£","rate":"2,976.8857","description":"British Pound Sterling","rate_float":2976.8857},"EUR":{"code":"EUR","symbol":"€","rate":"3,301.9762","description":"Euro","rate_float":3301.9762}}}CLOSED\r\n\r\nOK\r\n'
OK
b''
@solar whale Thanks.. will test it...
ok tested with a repl - works! do you want to start a PR?
@buoyant wigeon FYI -my test evetually failed witha memory allocation error
@solar whale I had something other to do... but testing now... It seems it is working OK... not all attempts BUT YES
good -- yes, there will be many retries. Hopfully there will be updates soon to reduce them.
@solar whale You are right ... sometimes "MemoryError: memory allocation failed, allocating 1099 bytes"
yes ... sigh... this is pushing the M0 to it's limits
Adds touchio.TouchIn to the NRF port. Works by driving an analog-capabile pin high and then measuring the rate of discharge through a 1Mohm resistor to ground. See #1048 for details of implementation.
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?
@teal bear we don't have a unix port for CircuitPython. What are you trying to do?
@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
@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).
@teal bear what soft CPU core is loaded on the FPGA?
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
Are you running the Linux kernel on the lm32 in this configuration?
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
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
I opened https://github.com/adafruit/circuitpython/pull/1412 but I
should do some minor code cleanup of stuff like comments.
@fierce girder how does that get me CP on fpga?
er, is CPython Cpython or CircuitPython?
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.
@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.
@fierce girder not sure linux+cPython will fit on https://www.crowdsupply.com/sutajio-kosagi/fomu/
it is only that big 😉
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
more fun too 😉
I guess an issue is that fupy has a fork of MicroPython. https://github.com/fupy/micropython/tree/master/ports/fupy
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
https://github.com/adafruit/circuitpython/blob/master/py/py.mk#L292 calls makeversionhdr.py to make $(HEADER_BUILD)/mpversion.h
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)
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. >:
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...
@solar whale Some news about ESP_ATcontrol?
@buoyant wigeon I have nothing new.
@solar whale I have seen something in communication, and it seemed to me that it was something new... OK, I'm still at work 🙁
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.
@solar whale FYI ... with baudrate=9600 and esp8285 success 😀
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.
I'm not holding my breath for CP on nRF8001, though!
I meant CP support for this feather: https://www.adafruit.com/product/3406
The Adafruit Feather nRF52 Bluefruit is another easy-to-use all-in-one Bluetooth Low Energy board, with a native-Bluetooth chip, the nRF52832! It's our take on an ...
@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
That's too bad... I was waiting for at least beta support for the nRF52832
What's MyNewt?
https://www.adafruit.com/product/3574 same board - with a SWD header ,DFU button and MyNewt Firmware.
really need the JLink to set it up.
What benefit does MyNewt bring to the table?
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.
Got it.
So, is there currently BLE stack support in the CP alpha for the upcoming nRF52840 Feather Express?
the bleio module is a "work in progress"
yes it is supports the nrf52840
@solar whale thanks!.
@gusty topaz the support is pretty limited and there are issues to be resolved
got it. I noticed the Particle Argon has an nRF52840 + ESP32.
Are there plans to bring full CP support to it?
The nrf52840 support is the the full CP -- same as the other 52840 boards. Right now hte only way to use the ESP32 is to flash the AT firrmware to it and use the new ESP_ATControll library. https://learn.adafruit.com/adding-a-wifi-co-processor-to-circuitpython-esp8266-esp32 It is also a "work in progress" but it is functional.
experimental 😃
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.
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).
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...
Wait, when you say the Xenon is capable to join a mesh network with an Argon... none of those boards is running CP, right?
no -- those are with the Particle.io firwmare installed
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?
no - not yet ...
Well.. I think it's worth the risk! 😬
me too!
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.
Good luck with your projects. There is a lot of rapid development underway -- Fun times 😉
hiya - thanks for the PR - i'm not sure why you'd want CircuitPython on unix since you can get full Python so easily :) is this for regression/testing purposes?
thanks, we're having a lil nrf52 build issue but as soon as the builds work i can test this on hardware :)
@meager fog what's the nrf build issue?
It's some weird ones.
I can build for the boards I am using
@solar whale It builds but they're not working right apparently.
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.
ah -- OK -- I'll look for details -- I have not had any problems recently.
may be on code not yet merged to master
ooh that's interesting! with tinyusb support for the fomu and us using tinyusb as the core usb library for circuitpython, it might work out nicely :) might be a couple weeks till we get to reviewing PRs, since its holiday break time, but please keep sending 'em!
@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.
interesting -- I had not noticed that - is it the bootloader or CP?
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
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.
Oh.... that might be it yes, it might be related to the new one. That may be why you're not having an issue.
Thanks for the info. Hope it gets resolved soon.
hey @idle owl how'd workshop go?
@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.
cool cool. good luck with one tonight!
Thanks! I'm super nervous as always 😄
ha! and it's python users. hopefully it won't digress into pythonic esoterica
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.
"you should use a lambda function with a generator inside a list comprehension!!!"
You should never user the phrase "you should" ... 😉
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...
@tidal kiln Ping me when you're around
@idle owl ping
does someone want to review Kattni's video? review = https://github.com/CarlFK/veyepar/wiki/Reviewer
@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
np. linky?
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
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
Ooh well done, better than I would have done. Thank you.
Thank you
still open in arduino land if anyone wants to fix it there :)
https://github.com/adafruit/Adafruit_MPR121/issues/20
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'
by the way, google summer of code org registration starts 15 Jan, should CP participate?
how do the supported builds get translate ?
im pretty sure I need to put this somwhere: #include "supervisor/shared/translate.h"
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
ok, I will try
@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.
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...
See #1415 for an async/await example.
@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
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.
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
but not needed on argon -- teh zip file has the sparse load for the argon now
Yes
just a sec -- I just made some adds to a few --
ok brb
and some additions to this one https://learn.adafruit.com/adafruit-bme280-humidity-barometric-pressure-temperature-sensor-breakout
@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.
@solar whale ahh ok you're now added
Thanks. I’ll try not to mess it up 😉
Add CP files to micropython's Makefile.
It builds, it runs, but tests aren't happy. - see TODO.txt for notes about that.
tools/tinytest-codegen.py
allows this to run:
ports/qemu-arm $ make -f Makefile.test test
-
RGB led was being used before
stack_init(), soassert_heap_ok()was being called too early. Ignore heap check if stack not allocated yet. -
Multiple issues with nrf
qspi_flash.c:
- Two bitfield setting bugs: wrong or missing
Posvalues. - 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 ...
@CarlFK I'm sorry to say we don't want to support the qemu-arm build. It has no CircuitPython features added to it. We took it out of our build several months ago because it wasn't useful to us at all.
@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.
@tulip sleet - my long term goal is CP on https://www.crowdsupply.com/sutajio-kosagi/fomu/
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
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
it supports lm32 and I think risk-v
are both little-endian? we make that assumption a lot of places
don't know, but just a sec I have the dev's ear just now...
if you do IRC, freenode #timvideos xobs
i don't have irc right now
maybe we should check for NRFX_RETURN for spi_flash_write_command and spi_flash_read_command as well
@teal bear are there gcc-based toolchains for lm32 and risc-v?
yes
need an eagle eye to catch this typo :+1:
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
@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?
we have micropythron running on lm32 on Arty https://github.com/timvideos/litex-buildenv/wiki/HowTo-FuPy-on-a-Digilent-Arty-A7
@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.
Ah- I see that the particle are same as pca10056
I see MX25L. The PCA10056 is MX25R, which is 8 MHz in our table.
Oops. Sorry.
@teal bear you could reuse parts of the hal layer from micropython for that, same idea as above
@tulip sleet xobs: They're different endiannesses. I think it's lm32 that's big.
does that mean I shouldn't bother trying CP on lm32?
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
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
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?
128 and 2m
yes - heres the specs https://www.crowdsupply.com/sutajio-kosagi/fomu#comparisons
other way round?
that's plenty roomy
@solar whale argon is set up as SPI flash, not QSPI for some reason.
@jerryneedell points out this will affect the Particle boards too. It will cut their QSPI speed in half. They are using MX25L which has 133 MHz max, so they'll run at 16 MHz instead of 32 MHz.
I don't know why they appear to work but the Feather does not.
Is xenon the same as argon. I'm not sure where to look.
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.
Xenon is qspi
it's possible they needed the pins for something else
In the morning. I can pull the or and try it on argon and xenon if that would be helpful.
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
I have not noticed any problems and I've been using them a lot this past week.
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.
I'll let you you know if I see any impact with the PR. Should be able to try it in the morning.
Well deserved!
Here's the output of a run: https://gist.github.com/notro/6e1028f000dd7d54de07a868d7519181
These are the i2c requests from that run:
$ i2cget -y 1 0x30 0x02
0x00
$ i2cset -y 1 0x30 0 1
- New translations for 4.x
- Updated modified translations
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...
@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 😉
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 !!
@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)
ohhhh ... okay, I didn't know that. Thanks gor the info
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
I don't know what a "stub" library is, but that sounds like the second option I had in mind
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
that would be all i need. I'm not planning on using Micropython anywhere else than embedded on a microcontroller
you might try googling around, it's possible someone already did all the work
I'm gonna try to find some
would be awesome
something like that : https://github.com/dastultz/micropython-pyb
yeah, though the pyb module is specific to the PyBoard
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?
I just use vim, nothing fancy
The particle argon and xenon eagle files spec different flash chips. Not clear what is actually on the PCBs or if this matters (flash on both boards works with CP, but I tested with slower speeds than the CP repo).
Would it be feasible to check which chip is actually on the board, rather than getting this information from a configuration file?
@bboser We do actually check the chip id. We just list the possible chips for each board in mpconfigboard.mk, and we only include the settings for chips known to be on the board in the firmware for that board. That saves a little space. For many boards, it's just one chip, for some of our boards, we've used more than one chip.
I tried setting the pin drives to high and it didn't help. Leaving at 16 MHz for now. Did a new push with some minor cleanup.
@tulip sleet is it working now on the feather52840?
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.
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?
im stuck on enable second spi, is it needed?
only if you have the main SPI already tied up.
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
?
no just 0.0 and 0.1
okay thank you, ill continue on tut and see how it goes
I don't use the 2nd SPI
im actually not going to be using the SPI, but just wanted to install everything correctly
@upbeat plover yah, you don't need it unless you need it. but what problem did you run into? does guide need fixing?
good idea -- as long as blinkatest runs its should be OK
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
just add it at the end is fine
okay thanks ill do that
and you have to reboot for them to show up in /dev
but, yah, you can skip that for now
that should be added to tut, nothing says something about reboot there
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
np. getting the blinkatest.py to run is the important thing.
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
hmmm. wonder why that's different on the pi?
i was wondering the same
i did a
print(dir(board)) with my blinka test and noticed that SPI is labeled a little differently
not sure, but may just be following existing naming convention already in place for the various boards
so, rpi has SCLK:
https://pinout.xyz/#
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
to read analog i need ADC? and to write analog i need DAC?
@idle owl @raven canopy 🛠 the floodgates are open 😉
WE ARE DOING THIS
mayyyybe 😆
OMG RIP MY INBOX
BLOWING IT UP
Belated warning: Email boxes will feel pain today. Sowwy! (but its for a good cause)
@upbeat plover we just did a re-release of blinka, if you can pip3 update it
Im going to reply to every one of those emails 😉
@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
btw...the flood is not over. i missed a conditional check and we aborted on it.... re-launch in 3, 2, 1... 🚀
@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
how do you update?
@upbeat plover pip3 install --upgrade adafruit-blinka
Mugatu: "That Travis Badge...."
We should forward all the messages to @raven canopy
i think its almost over. @solar whale i'm feeling it too. I'm getting the Travis passed/failed plus merge emails. 😄