-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Wemos Lolin C3 Mini Board #6256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I am working to bring up the C3 Mini on CircuitPython and we'll need a PID. PR for that work here: adafruit/circuitpython#6256
Hi, looking forward to testing this out later this afternoon! Regarding your second question, I would think it would be 'Lolin', based on their ESP32-S2 board which is supported https://circuitpython.org/board/lolin_s2_mini/ |
Yeah the Company appears to be called Wemos and the RTD url is Wemos. The Aliepxress store is Lolin. But sometimes the boards have Lolin in the name on the Wemos RTD site, and in the silkscreen, sometimes they don't. https://www.wemos.cc/en/latest/index.html 🤷♂️ -- I'm going to leave it as Lolin unless someone corrects it. |
I'm going to park this PR as a draft unless someone has an idea on how to get a CPY file onto the board without BLE workflow. If you'd rather I close it and re-open later, that's OK too. |
NVM about being blocked... |
I am working to bring up the C3 Mini on CircuitPython and we'll need a PID. PR for that work here: adafruit/circuitpython#6256
Pin 2 an 8 are always pulled high according to the schematic so I'm checking those off the test list since I see that this is true when testing. |
I'm flipping this to ready for review. It might not be perfect, but I think its working well. The one open item is the Creations ID and Repo, but I think when Scott is back that will be cleaned up and be implemented as I suggested and have it in the files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One request. Wemos creations repo should be ready for a PR too.
Thanks for adding this board!
Your pin naming isn't right. Circuitpython uses whatever the silkscreen says, in this case matching the IO# numbering. So IO0-IO10 should be D0-D10, etc. |
@prplz I'm back from my trip and hoping to finish this up ASAP. Now the I'm looking at the board, I don't see any "D" labels on the silscreen, so I'm confused. If you want to "@" me on Discord, we can do that too. Thanks for your help! |
Right, on the silkscreen they are just numbers. The naming in pins.c should match the silk, for example you have { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO0) },
- { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO0) },
+ { MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_GPIO0) },
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO1) },
- { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO1) },
+ { MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) }, and so on. |
There might be an argument for retaining an alternate "D" pin notation to match that of the D1 mini board, as there's an existing ecosystem of shields with markings matching those on the D1 board. |
I see, maybe keep the D names and add IO as well? |
OK, I wasn't understanding this 100%, but I took a picture of the board, zoomed in, followed the traces and I get it now. In the passing of time, I have no idea why I used those D Mappings. Latest commit maps the silkscreen numbers to the correct pins (D to GPIO). The IO:GPIO mappings are 1:1 aligned. There are always the same according to my reading of the schematic. With two possible extraneous extra IOs. IO20, IO21 are not on the schematic for GPIO20, GPIO21, they are labeled RX and TX instead. Let me know if those IO mappings should be removed or if they are also valid. thank so much! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the build is failing because your fork is a ways behind the main branch. If you fetch the upstream, it may fix the build issues.
I was able to confirm this by forking adafruit:main with the most recent commits and applying the changes made by askpatrickw:lolin-c3-mini. Everything built successfully here |
This board seems to have a hardware issue that it needs to have TX power explicitly adjusted away from default for wifi to function (I've verified this in Micropython - won't connect at default power but after adjusting it works fine and a similar caveat exists in Wemos' arduino documentation). I don't believe the circuitpython wifi library for ESP32 has a runtime setting for this (Micropython has sta_if.config(txpower=xxx) but an equivalent does not appear to exist in Circuitpython) so it might have to be set in board.c |
Interesting, that explains why my build wouldn't connect to Wi-Fi. Here's a link to their documentation regarding this for MicroPython |
14f54b5
to
d9a6fb4
Compare
Thanks @kylefmohr this PR got old... I appreciate the reminder. |
Thank you @todbot! I'll try that later tonight or tomorrow night. |
ooof I'm looking in: esp-idf/componenents/esp_phy/esp32s2/include/phy_init_data.h and similar files grepping for "TX_POWER" and am really wishing CircuitPython had access to |
Feel free to add it! It makes sense that Radio would have a tx_power attribute. |
I opened a Feature request for wifi.radio.tx_power() #6540 |
dde15b3
to
c3cf9ba
Compare
OK, if this build works, and it should, I just tested wifi.radio.connect with the wifi.radio.tx_power, this is ready for final review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
This is board definition for the Lolin C3 Mini
TODO:
(Reworking all this based on a different baseline board defition (QtPyC3)
Wemos Lolin C3 Mini Testing
Snippet of the Schematic
Some helper docs: