-
• #127
I've now activated Wi-Fi and generated the firmware.
I've uploaded it to the board, and so far, it seems to be working fine. I've scanned the networks and successfully connected.
I'm using the following S3 board,ESP32-S3 N8R2, for testing, which has two USB connections: one that functions as a serial port like in the ESP32, and the other as USB-CDC.
https://es.aliexpress.com/item/1005004617322170.html
1 Attachment
-
• #128
And now I've tried connecting via Telnet, and so far, it's working fine.
1 Attachment
-
• #129
Hi, can you share the firmware that your ESP32-C3 WIFI can use
-
• #130
Hi, I think there is a small misunderstanding. I've been preparing the firmware for ESP32 S3, and you asked me for the one for ESP32 C3. They are different CPUs from Espressif.
Anyway, I'll prepare the firmware for C3 later with my build system to see if it works well. And I'll share it on the forum.
-
• #131
I've posted in this forum, but it's not the right one.
-
• #132
Hello @user158605 , I'm uploading the two firmware of the latest version of Espruino, both with Bluetooth, Wi-Fi, and Telnet. Let's see if you can test them and if they work correctly for you.
Best regards,
2 Attachments
-
• #133
@rgomezwap does the C3 firmware you compiled connect to WiFi ok? I guess it's possible the 4.4.8 upgrade fixed it?
-
• #134
Wifi is not broken on 4.4.7, we need to understand that if the board is already connected a another connect will break things. The folowing code will check for that situation:
var ssid="SSID"; var password="password"; var wifi=require("Wifi"); wifi.stopAP(()=> { print(wifi.getStatus()); var status = wifi.getStatus(); if (status.ssid == ssid && status.station == "connected"){ print(wifi.getIP()); } else { wifi.connect(ssid, {password: password}, function() { print(wifi.getIP()); }); } });
Line 8 is the breakthrough: Do not connect again if already connected
You can upload this code as ofen as you like and the ESP32 board will not reboot!
Edit:
Wow, tested today and it is broken again ....... -
• #135
Hello @Gordon,
I’ve prepared the firmware for the S3 and C3 and uploaded it to this forum. @user158605 requested it because they wanted to test it.I’ve only tested the S3 myself, and it seems to work fine at first glance. Let's see if another user can give us feedback on the C3 firmware, and if not, I'll test it myself when I have the chance.
-
• #136
I've just been looking into this more with the WiFi logging enabled, and I see (even with
ESP32.enableBLE(0)
):[/home/gw/workspace/Espruino/libs/network/esp32/jswrap_esp32_network.c]:jswrap_wifi_connect: esp_wifi_start NETWORK_SSID_HERE =undefined >I (121817) wifi:new:<4,1>, old:<1,1>, ap:<255,255>, sta:<4,1>, prof:1 I (122117) wifi:state: init -> auth (b0) I (123117) wifi:state: auth -> init (200) I (123117) wifi:new:<4,0>, old:<4,1>, ap:<255,255>, sta:<4,1>, prof:1 [/home/gw/workspace/Espruino/libs/network/esp32/jswrap_esp32_network.c]:wifiReasonToString 5 [/home/gw/workspace/Espruino/libs/network/esp32/jswrap_esp32_network.c]:Wifi: Event(5):SYSTEM_EVENT_STA_DISCONNECTED [/home/gw/workspace/Espruino/libs/network/esp32/jswrap_esp32_network.c]:wifiReasonToString 2 [/home/gw/workspace/Espruino/libs/network/esp32/jswrap_esp32_network.c]:wifiGetEvent: Got event: 5 [/home/gw/workspace/Espruino/libs/network/esp32/jswrap_esp32_network.c]:sendWifiEvent [#ondisconnected](https://forum.espruino.com/search/?q=%23ondisconnected)
With BLE enabled (the default) I see:
wifi:Coexist: Wi-Fi connect fail, apply reconnect coex policy
But the interesting bits are:
[/home/gw/workspace/Espruino/libs/network/esp32/jswrap_esp32_network.c]:wifiReasonToString 5 --> WIFI_REASON_ASSOC_TOOMANY [/home/gw/workspace/Espruino/libs/network/esp32/jswrap_esp32_network.c]:Wifi: Event(5):SYSTEM_EVENT_STA_DISCONNECTED [/home/gw/workspace/Espruino/libs/network/esp32/jswrap_esp32_network.c]:wifiReasonToString 2 --> WIFI_REASON_AUTH_EXPIRE
I tried to google the connection errors for C3 and I actually see this which seems interesting, and implies it's actually broken hardware which might explain why it worked for me initially: https://github.com/esphome/issues/issues/4893
The suggestion is to set the transmit power, but that didn't work for me :(
-
• #137
And these two as well, also blaming faulty supermini boards which I was using:
- https://github.com/adafruit/circuitpython/issues/9208
- https://community.home-assistant.io/t/esp32-c3-super-mini-wifi-signal-booster/657661
Just tried a board @MaBe supplied with no USB on it, and it works great. You just need to stop the Ap first with stopAP:
var wifi = require("Wifi"); wifi.stopAP() WIFI_NAME="xx"; WIFI_OPTIONS={password:"xxx"}; function get(url) { var http = require("http"); http.get(url, function(res) { res.on('data', function(data) { console.log(data); }); }); } wifi.connect(WIFI_NAME, WIFI_OPTIONS, function(err) { if (err) { console.log("Connection error: "+err); return; } console.log("Connected!"); get("http://www.pur3.co.uk/hello.txt"); });
Or once you've done
wifi.save()
to save the wifi state, the automatic AP won't start.... but I've now pushed a change which automatically stops the AP if
connect
is called (on C3) and vice versa, so normal code should work on the C3 now.assuming you don't have a broken ESP32C3 supermini board
- https://github.com/adafruit/circuitpython/issues/9208
-
• #138
i think it has to do with wifi power setting mentioned here
https://github.com/espressif/arduino-esp32/issues/6767#issuecomment-1145661485
-
• #139
It seems like this might be a hardware issue with certain boards. Could you please indicate which boards work well or which ones don't, so that new users can avoid encountering this problem?
Thanks
-
• #140
In the info @MaBe linked it looks like the C3 mini with black ceramic antenna is bad and the red one may be OK? And also the older "Lolin C3 mini" with PCB antenna is bad (some HW fix here) while newer one (V2.1.0) with ceramic antenna is better?
EDIT: by the first C3 mini with red/black antenna I meant something that looks like this board https://www.waveshare.com/esp32-c3-zero.htm but maybe I am wrong?
-
• #141
it looks like the C3 mini with black ceramic antenna is bad and the red one may be OK?
Just FYI I have two superminis with red antenna and they're also bad, so it's not specifically the antenna (I haven't tried C3 mini).
Recent builds now do set the wifi tx power, but that doesn't appear to be enough for my boards. They did at one point connect to wifi ok, so part of me wonders whether without the power setting they were using high power to the mismatched aerial and they've actually now damaged themselves.
-
• #142
The highest power setting is "none" which is onl available when BLE is switched off.
Now, I've started making some changes:
As soon as I have something useful for the community, I'll make a pull request.