Search found 10 matches

by jhsrennie
Thu Aug 08, 2024 5:01 am
Forum: ESP32 Arduino
Topic: Built in LED blinks when using WiFi.h
Replies: 4
Views: 1209

Re: Built in LED blinks when using WiFi.h

Thanks, but the LED flashes in the same way even if I use this program: #include <WiFi.h> #define MY_SSID "foo" #define MY_PWD "bar" void setup() { WiFi.begin(MY_SSID, MY_PWD); } void loop() { delay(1000); } I have uploaded a video to show how the LED starts flashing as soon as WiFi.begin() is calle...
by jhsrennie
Wed Aug 07, 2024 3:58 pm
Forum: General Discussion
Topic: ESP32 WiFi.h Constantly Blinking Onboard LED
Replies: 2
Views: 1607

Re: ESP32 WiFi.h Constantly Blinking Onboard LED

A rather late reply, but I have a similar problem. I haven't found any way to stop WiFi.begin() from messing with the builtin LED, but I managed to get the WiFi enabled using just the ESP API. This code enables the WiFi without affecting the built in LED: #include <WiFi.h> #include "esp_system.h" #i...
by jhsrennie
Wed Aug 07, 2024 2:56 pm
Forum: ESP32 Arduino
Topic: Built in LED blinks when using WiFi.h
Replies: 4
Views: 1209

Re: Built in LED blinks when using WiFi.h

Thanks, but that is not what I'm asking. It seems like the WiFi object already does does something similar to what you suggest. If I turn on the WiFi using: void connectWiFi() { WiFi.begin(MY_SSID, MY_PWD, 6); int loopcnt = 0; while (WiFi.status() != WL_CONNECTED) { Serial.printf("%d WiFi status = %...
by jhsrennie
Tue Aug 06, 2024 9:42 am
Forum: ESP32 Arduino
Topic: Built in LED blinks when using WiFi.h
Replies: 4
Views: 1209

Built in LED blinks when using WiFi.h

I have a generic ESP32-WROOM-32D dev board that I'm using to learn ESP32 programming using the Arduino IDE. I've noticed that when I use the WiFi object from WiFi.h the built in LED illuminates to show the state of the connection. When I call WiFi.begin() the LED turns on solid, then once the WiFi c...
by jhsrennie
Wed Jul 17, 2024 3:38 am
Forum: ESP32 Arduino
Topic: Can we use WiFiServer to accept connections in blocking mode?
Replies: 4
Views: 1832

Re: Can we use WiFiServer to accept connections in blocking mode?

Thanks again. It turns out you can use sockets even in Arduino mode. If anyone is interested, this code works: #include <lwip/sockets.h> #include "WiFi.h" void ConnectWiFi() { WiFi.begin("myssid", "mypassword", 6); int loopcnt = 0; while (WiFi.status() != WL_CONNECTED) { Serial.printf("Connecting: t...
by jhsrennie
Tue Jul 16, 2024 4:59 am
Forum: ESP32 Arduino
Topic: Can we use WiFiServer to accept connections in blocking mode?
Replies: 4
Views: 1832

Re: Can we use WiFiServer to accept connections in blocking mode?

Thanks :-)

A delay will certainly stop the task calling WiFiServer.available() from using 100% CPU so that would be a solution, but is there no way to make WiFiServer.available() block?
by jhsrennie
Mon Jul 15, 2024 3:32 pm
Forum: ESP32 Arduino
Topic: Best Frequency Meter ever made with ESP32 - awesome!
Replies: 96
Views: 130173

Re: Best Frequency Meter ever made with ESP32 - awesome!

Solved. I needed to #include "esp32/rom/gpio.h". Apparently this changed going from v2 to v3. ------------------------------------------------------------------------------------------------------------------- Thanks for posting this :-) When I try to compile it I get errors: D:\rhs\ESP32\Frequency\...
by jhsrennie
Sun Jul 14, 2024 10:18 am
Forum: ESP32 Arduino
Topic: Can we use WiFiServer to accept connections in blocking mode?
Replies: 4
Views: 1832

Can we use WiFiServer to accept connections in blocking mode?

In unix we would typically code a server using something like: listen(sock_srv, 1); while (true) { sockaddr addr_client; int sock_client = accept(sock_srv, &addr_client, NULL); The call to accept() blocks until a connection is received, at which point it springs back into life and returns a socket w...
by jhsrennie
Sun Jul 14, 2024 5:53 am
Forum: ESP32 Arduino
Topic: Using the sockets API I get an error related to sockaddr_in
Replies: 3
Views: 1381

Re: Using the sockets API I get an error related to sockaddr_in

Oh no! Just a stupid typo!

A thousand thanks :-) I've been staring at that for hours and failed to see the typo.
by jhsrennie
Sat Jul 13, 2024 6:31 pm
Forum: ESP32 Arduino
Topic: Using the sockets API I get an error related to sockaddr_in
Replies: 3
Views: 1381

Using the sockets API I get an error related to sockaddr_in

Mainly for fun I wanted to see if I could write a server using the good old BSD sockets API. This appears to be supported on the ESP32 but when I try to compile a simple program I get errors that I cannot understand. The code is very short and simple: #include "lwip/sockets.h" void setup() { Serial....