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

Use new websocket from OTF #275

Merged
merged 4 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions opensprinkler_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#define OTF_PARAMS_DEF const OTF::Request &req,OTF::Response &res
#define OTF_PARAMS req,res
#define FKV_SOURCE req
#define handle_return(x) {if(x==HTML_OK) res.writeBodyChunk((char *)"%s",ether_buffer); else otf_send_result(req,res,x); return;}
#define handle_return(x) {if(x==HTML_OK) res.writeBodyData(ether_buffer, strlen(ether_buffer)); else otf_send_result(req,res,x); return;}

#else

Expand Down Expand Up @@ -218,7 +218,7 @@ void rewind_ether_buffer() {

void send_packet(OTF_PARAMS_DEF) {
#if defined(ESP8266)
res.writeBodyChunk((char *)"%s",ether_buffer);
res.writeBodyData(ether_buffer, strlen(ether_buffer));
#else
m_client->write((const uint8_t *)ether_buffer, strlen(ether_buffer));
#endif
Expand Down
3 changes: 1 addition & 2 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ lib_deps =
sui77/rc-switch @ ^2.6.3
https://github.com/ThingPulse/esp8266-oled-ssd1306/archive/4.2.0.zip
knolleary/PubSubClient @ ^2.8
https://github.com/OpenThingsIO/OpenThings-Framework-Firmware-Library/archive/refs/heads/master.zip
https://github.com/Links2004/arduinoWebSockets/archive/refs/tags/2.3.5.zip
https://github.com/OpenThingsIO/OpenThings-Framework-Firmware-Library @ ^0.1.0
; ignore html2raw.cpp source file for firmware compilation (external helper program)
build_src_filter = +<*> -<html/*>
upload_speed = 460800
Expand Down