tinygo icon indicating copy to clipboard operation
tinygo copied to clipboard

Wifi support for ESP32/ESP8266?

Open Technerder opened this issue 4 years ago • 25 comments

I recently stumbled upon this project and was thrilled to see that some basic features such as I2C and SPI were supported on the ESP32/ESP8266. Are there any plans to support Wifi on the chips and if so when can we expect to see a bare/basic implementation in the main code base?

Technerder avatar Aug 02 '21 19:08 Technerder

I would absolutely love to see WiFi/BT support on these chips! However, it's going to be difficult because it doesn't have a lot of documentation. I've ordered an ESP32C3 which I want to try to add WiFi support to. Specifically the ESP32C3 because it uses the well documented RISC-V architecture instead of the sparsely documented (if at all) Xtensa architecture in the original ESP32. So my idea is that it should be a lot easier for that reason and when that works, I can use that knowledge for the original ESP32.

I can't give you a time for when it will be finished, like I can't give you a time for when anything will be finished. Sorry.

aykevl avatar Aug 03 '21 14:08 aykevl

I hope too...

Dorbmon avatar Aug 05 '21 03:08 Dorbmon

i am also hoping for this...

scroot avatar Aug 15 '21 13:08 scroot

any update on this?

wlwatkins avatar Oct 02 '21 17:10 wlwatkins

Yes, please follow #2138 and https://github.com/tinygo-org/drivers/pull/320.

aykevl avatar Oct 02 '21 17:10 aykevl

thank you @aykevl for your work! Are there any updates on this?

ninanomenon avatar Aug 23 '22 15:08 ninanomenon

is there any news about wifi support on esp8266 / esp32 ?

ngandalf avatar Oct 16 '22 19:10 ngandalf

You would be better off using ESP-AT firmware on your ESP and control it with something well supported like RP2040 (yes, i realize thats 2 chips but at least you can have something that works now). ESP8266/ESP32/ESP32-S2 are no longer actively developed or supported by Espressif, they now only recommend using ESP32-C2/C3 chips.

This is what i ended up doing.

conotto avatar Oct 29 '22 17:10 conotto

@conotto I would love to chat about how you solved this - any chance you could DM me on twitter.com/ericmigi or send me an email ([email protected])?

ericmigi avatar Dec 30 '22 00:12 ericmigi

I found an ESP wifi driver, maybe this helps.

https://github.com/esp-rs/esp-wireless-drivers-3rdparty

CrazyPandar avatar Jan 12 '23 10:01 CrazyPandar

@CrazyPandar yes that's what we should use (see https://github.com/tinygo-org/drivers/pull/320#issuecomment-1284080185).

aykevl avatar Jan 12 '23 14:01 aykevl

In rust, this was implemented: https://github.com/esp-rs/esp-wifi Maybe this could be adopted to TinyGo?

DatanoiseTV avatar Jan 21 '23 13:01 DatanoiseTV

@DatanoiseTV yes, see my comment above (which links to https://github.com/tinygo-org/drivers/pull/320#issuecomment-1284080185). TL;DR: we should indeed use https://github.com/esp-rs/esp-wireless-drivers-3rdparty. But that's a lot of work and nobody has stepped up to do it yet.

aykevl avatar Jan 22 '23 04:01 aykevl

what would be the process of integrating the esp-wireless-drivers-3rdparty code? i could give it a try, but i don't have much embedded experience. are we talking about linking in the .a files and generating go code to wrap functions in the c header files using cgo?

pcting avatar Feb 25 '24 02:02 pcting

@pcting please follow this PR instead: https://github.com/tinygo-org/drivers/pull/650 Once the ESP32-C3 is implemented, we could take a look at supporting the ESP32/ESP8266 but those are going to be a lot more work because they also need Xtensa interrupt support. I spent a few days trying to get Xtensa interrupt support working at some point, but gave up on it.

I recommend following the ESP32-C3 work.

aykevl avatar Feb 25 '24 13:02 aykevl

There seems to have been a significant development on this topic: https://media.ccc.de/v/38c3-liberating-wi-fi-on-the-esp32

mamoit avatar Dec 28 '24 10:12 mamoit

@mamoit true, but it doesn't help us now. Many parts are still missing, so it's not something we can use right now.

(I was there in the room when it was presented, it was an interesting talk!)

aykevl avatar Dec 31 '24 12:12 aykevl

Is it possible to donate to fund work on this issue somehow? It would be awesome.

Thanks for your awesome work btw.

dector avatar Mar 24 '25 01:03 dector

@dector yes, please, and thank you!

https://opencollective.com/tinygo

deadprogram avatar Mar 24 '25 08:03 deadprogram

@dector yes, please, and thank you!

https://opencollective.com/tinygo

Awesome. I will use it.

But as I understand - that's generic contribution to the project. I was wondering if you are generally considering possibility to accept funds for focused work of specific feature (if enough people will want to contribute for such common goal). I know that not all OSS contributors want do it, so just asking - no pressure.

dector avatar Mar 24 '25 12:03 dector

Excuse me, is there any progress on this problem?

JunBys avatar Jul 06 '25 02:07 JunBys

Yes, please follow #2138 and tinygo-org/drivers#320.

@JunBys please follow the above PRs. I'll post an update when I get to work on it again.

aykevl avatar Jul 06 '25 17:07 aykevl

@dector yes, please, and thank you!

https://opencollective.com/tinygo

Just became a monthly contributor as well. It's not much at all, but at least it's one more voice towards radio support in cheap and widely available boards, as that tends to be the deal breaker for many use cases. ESP32 S/C and RP2040/2350 are probably some of the most interesting candidates in that regard, at the moment.

Thanks for your long term work in TinyGo.

niemeyer avatar Sep 18 '25 17:09 niemeyer

Hey @aykevl , I have some free bandwidth and wanted to spend it on this feature. If you wanted to onboard a developer that you just hired, how would you guide him? To be honest, just looking at the PRs is not enough and I would need some help in order to help back.

I do want to write go on my esp boards and connect them to internet, just how I do it using python, jealousy is my fuel:)

Looking forward to a reply.

officer47p avatar Oct 04 '25 20:10 officer47p

Hi @officer47p thank you for your interest! You can perhaps message me in the Gophers Slack? Or message me in some other way: https://aykevl.nl/about Then I can get you started with wifi support, at least as far as I got last time.

aykevl avatar Oct 05 '25 07:10 aykevl