GithubHelp home page GithubHelp logo

khoih-prog / asyncwebserver_teensy41 Goto Github PK

View Code? Open in Web Editor NEW
9.0 4.0 5.0 934 KB

Async HTTP/WebSocket Server Library for Teensy 4.1 using QNEthernet. This library is one of the Async libraries to support T4.1, such as AsyncHTTPRequest_Generic, AsyncHTTPSRequest_Generic, AsyncMQTT_Generic, AsyncWebServer_Teensy41, AsyncUDP_Teensy41, AsyncDNSServer_Teensy41, etc. Now supporting using CString to save heap to send very large data

License: GNU General Public License v3.0

C++ 73.78% C 25.77% Shell 0.45%
tcp async webserver websocket-server websocket teensy websocket-client tcp-server tcp-client tcp-socket

asyncwebserver_teensy41's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

asyncwebserver_teensy41's Issues

Websocket don´t work

Describe the bug

I can´t use WebSockets with Async_WebServer_Teensy41.

I adopted a Sketch from ESP32 where it works well.

With Teensy 4.1 the Connection establishes but send no Data to the Client (HRESULT: 0x80072F78).

Im using Windows10, "Websocket Debug Tools", Wireshark

Arduino IDE version 1.8.19
Teensyduino Core v1.58 beta3
QNEthernet library version v0.17.0

Steps to Reproduce

I used Async_AdvancedWebServer Example
and added:

AsyncWebSocket ws("/ws");

void onWsEvent(AsyncWebSocket *server, AsyncWebSocketClient *WS_Client, AwsEventType type, void *arg, uint8_t *data, size_t len) {

	if (type == WS_EVT_CONNECT) {

		Serial.println("Websocket client connection received");
		WS_Client->text("Hello from ESP32 Server");
	} else if (type == WS_EVT_DISCONNECT) {
		Serial.println("Client disconnected");

	}
}`

In SETUP:

ws.onEvent(onWsEvent);
server.addHandler(&ws);`

In LOOP:

if (millis() > timer + 5000) {
	ws.textAll(String(millis() / 1000));
	timer = millis();
}

Expected behavior

The Server should send back "Hello from Teensy 4.1 Server".
Every 5s the Server should send millis() / 1000.

Actual behavior

With "Websocket Debug Tools" I get (HRESULT: 0x80072F78)
Using Wireshark it seems the OPCODE for Websocket Connection is Wrong.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.