Skip to content
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

"Hot fix" for ESP82XX #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

MattWestb
Copy link

Adding patch for ESP8XX so its possible compiling the firmware. I do not have the knowledge off writing C++ so i have adding it as comment and the user must comment the ESP32 out and un-commented lines fro ESP82XX for changing arch. Im very sure some one can doing it automatic detecting if ESP 32 or 82XX and dont need my hack.

Looks working OK on my test setup with one "IKEA Marcus2 EZSP 6.10.3.0 one one D1 Mini clone.

PS: Some extra spaces is taken away.

Adding patch for ESP8XX so its possible compiling the firmware.
I do not have the knowledge off writing C++ so i have adding it as comment and the user must comment the ESP32 out and un-commented lines fro ESP82XX for changing arch.
Im very sure some one can doing it automatic detecting if ESP 32 or 82XX and dont need my hack.

Looks working OK on my test setup with one "IKEA Marcus2 EZSP 6.10.3.0 one one D1 Mini clone.
@MattWestb
Copy link
Author

Status report from testing:

One WeMos D1 Mini clone with one "Markus EZSP" 6.10.3.0 is the stream server status connected for over one week and the ZHA is running on my laptop (Windows 10 and HA core containered) and have no error reported in the log and looks working fine all the time.

Perhaps shall testing with RCP and see if it also working OK (without hardware flow control then HW is not supported in the ESP hardware) ;-))

I have one more D1 Mini flashed but its being for testing and have not being active all the time.

Comment on lines +47 to +55

// For ESP-32
this->socket_->setsockopt(SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout, sizeof(timeout));
this->socket_->setsockopt(SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout, sizeof(timeout));

//
// For ESP82XX
// this->socket_->setsockopt(SOL_SOCKET, LWIP_SO_RCVTIMEO, (char *)&timeout, sizeof(timeout));
// this->socket_->setsockopt(SOL_SOCKET, LWIP_SO_RCVTIMEO, (char *)&timeout, sizeof(timeout));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking through the esphome repo I believe you can do like this

#ifdef USE_ESP8266
this->socket_->setsockopt(SOL_SOCKET, LWIP_SO_RCVTIMEO, (char *)&timeout, sizeof(timeout));
this->socket_->setsockopt(SOL_SOCKET, LWIP_SO_RCVTIMEO, (char *)&timeout, sizeof(timeout));
#endif

#ifdef USE_ESP32
this->socket_->setsockopt(SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout, sizeof(timeout));
this->socket_->setsockopt(SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout, sizeof(timeout));
#endif

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI there's also #ifdef USE_RP2040

@cenobitedk
Copy link

I believe this part in stream_server.h should also be changed:

// stream_server.h, lines 23-29
#ifdef ARDUINO_ARCH_ESP8266 // -> should be #ifdef USE_ESP8266
#include <ESPAsyncTCP.h>
#else
// AsyncTCP.h includes parts of freertos, which require FreeRTOS.h header to be included first
#include <freertos/FreeRTOS.h>
#include <AsyncTCP.h>
#endif

@MattWestb
Copy link
Author

Thanks @cenobitedk for comments on the "PR" !!
I is not one code warrior and i dont knowing hos putting the changes in code and getting it working and not braking the current code. I also need testing if its working before posting the updated code and its only possible getting the syntax OK.

Can you pleas posting OK formatted code that is possible putting in current code without braking it then i can doing the testing.
Also possible making on pull to my patch https://github.com/MattWestb/esphome-stream-server-v2/tree/patch-1.

Thanks in advance !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants