-
Notifications
You must be signed in to change notification settings - Fork 910
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
ESP8266 WiFi support #1427
Comments
Just wanted to comment and say how grateful I am for the tinygo project. I am truly terrible at c++, and I don’t like writing It, but I resonate with go. I’m really excited to do a project with an ESP chip and tinygo. WiFi support would is HUGE. If I’m capable I’d be happy to help make it happen. But a major +1 to this request. |
Unless, is it the case that we can use this driver to get WiFi functionality? |
It looks like theoretically you could use one esp8266 to control / use wifi over another esp8266 (over UART). The first esp8266 would use this driver to talk to the second esp8266 with the AT firmware (listed on driver's README). Because I really want to write go on the esp8266, and because they are cheaper than something like the arduino nano 33 IoT, I may actually do this. I'll post code if I do. |
Yes, I totally agree. Also, for networking to work we'll also need:
In other words, it'll require some low-level development. |
Update: compiler-rt and picolibc are now available. But many things are left to do. |
@aykevl I've looked into this a few weeks ago. I've also compiled compiler-rt and picolibc without problems. One problem I ran into was that by the looks of it, at least the ESP32, does not have the ability to run without the RTOS. As far as I understand the current tinygo implementation does not leverage any of the RTOS based SDK. I've looked into options to link against some sort of libraries as possible with the non RTOS version of the ESP8266 development kit but did not succeed. And I found that Espressif discontinued the non RTOS based SDK for the ESP8266 as well. It receives some sort of bugfix update but the users are encouraged to use the RTOS based SDK. If this is the right observation, are you aware of this situation and maybe have some ideas to overcome this? |
I think we can use the TinyGo scheduler as the RTOS, but I haven't looked into this yet. Using FreeRTOS in TinyGo would be very complicated. |
Thats the point, embedding FreeRTOS into TinyGo is not the right path to enter. Espressif supplies some kind of libraries at https://github.com/espressif/esp32-wifi-lib/tree/master/esp32. On my first look this libraries also depend on FreeRTOS and their SDK. I was hoping to find some low level APIs, within the libraries, which allows interacting with the wifi system. IMHO I would like to reuse as most network logic from the standard library of go as possible. But it looks like Espressif is not willing to support such setups. Is TinyGo currently running on a single core in ESP32 setup? Looks like at least for the ESP32 there is an option to get full access to the coprocessor. |
It appears that RIOT has managed to run its RTOS on the ESP8266, with WiFi support: https://doc.riot-os.org/group__cpu__esp8266.html I think we should look into how they do it. |
Thanks for the reference! |
I just watched this Hackaday talk by Uri Shaked (@urish) that may be a way in for the development of an open source driver: |
I also watched that talk and was inspired to have another look into this. Maybe I find some time to dig into the internals again. Thanks for bringing this up again. |
is there any update on the use of WiFi for nodemcU? thanks |
Is there any progress on using WiFi on esp32 and esp8266 thank you |
hello when feature I need pls thank you to sum up the comments above |
Writing here since there haven't been any comments since April, this would be great to have. It is one of the last steps before I can dump cpp for my esp development project |
Hi, what is the current status of this issue? Is there any update on here? |
Is this something that would benefit from additional eyes? I love go and these chips, and would love to see their full stack implemented here. |
Worth noting rust is having similar experimental headway https://github.com/esp-rs/esp-wifi This uses the WiFi drivers from a fork of espressif drivers |
@panbanda ooh that looks really interesting! Thank you for sharing! That should certainly be useful. |
thanks for your hard and great job . also waiting for raspberry pico w |
I really do hope someone implements this within like the next 2 years, it would be incredibly useful |
You could always give it a go. |
Would it be possible to link the c-code for wifi or i2c into a go-project instead of writing it from scratch? |
That's how Rust did it, directly references the ESP c code. The tinygo
maintainers have voiced not wanting to go this route.
…On Sat, May 20, 2023, 3:09 PM Kortenbach ***@***.***> wrote:
Would it be possible to link the c-code for wifi or i2c into a go-project
instead of writing it from scratch?
—
Reply to this email directly, view it on GitHub
<#1427 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQONNLN7HV55HZ4KQZ4KKLXHEQILANCNFSM4SHC7O4A>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Oke, that seems odd. I wonder why that is... |
You can use whatever CGo code you can get to work for you. That does not mean it will necessarily become part of the one the official repos. We're mostly interested in open source, and in pure TinyGo implementations, but there are plenty of places you can find CGo in use in various TinyGo packages. Sensors that are tied to a specific hardware architecture are not too interesting in general for that exact reason the TinyGo drivers repo contains 90+ sensors etc that work on pretty much any architecture. Regarding the ESP32 wifi support, someone could be contributing a PR to add this to the drivers repo and we'd certainly look at it. In the meantime please see #2138 and tinygo-org/drivers#320 |
The ESP8266 is basically dead. Yes, it's still being used in the wild but as far as I can see it can be replaced with ESP32-series chips in almost every case (in particular, the ESP32-C3 for low-cost applications) and Espressif does not appear to continue developing it. Also, as far as I know, the ESP-IDF does not support the ESP8266 so there is that. When it comes to the newer chips (especially the newer RISC-V ESP32-series chips), the proper way to add WiFi support is by using esp32-wifi-lib, which are basically the binary blobs and headers needed for WiFi and BT extracted from the ESP-IDF. This is what is now also used by the Rust people. Actually there are two ways Rust supports WiFi on the ESP32-series chips:
While the first option is possible, it would mean replacing most of the TinyGo runtime with an ESP-IDF version. That is a massive maintenance burden that I'm not willing to take up. It's easy to say "just use the ESP-IDF", it's a whole different story to have to maintain the mess that is called ESP-IDF (and associated support burden). |
Thanks you for your explanation Ayke. |
Just a few clarifications:
How useful would it be to make the effort to support esp8266 wifi now in TinyGo? That I don't know 😅 |
Continuing ESP8266 topic:
|
The docs (https://tinygo.org/microcontrollers/esp8266/) list that the ESP8266 WiFi feature is not supported by TinyGo.
Imo having this support is crucial for this board to make sense. What needs to be done so this can happen?
The text was updated successfully, but these errors were encountered: