OpenBCI_WIFI icon indicating copy to clipboard operation
OpenBCI_WIFI copied to clipboard

Add websocket server

Open andrewjaykeller opened this issue 8 years ago • 9 comments

Good way to stream JSON to web browser!

Checkout this project: https://github.com/AdySan/ESPSocket/blob/master/ESPSocket/ESPSocket.ino

andrewjaykeller avatar Jun 20 '17 16:06 andrewjaykeller

Socket.io client https://gist.github.com/alexcastillo/e3aca7ba0a3510a4c340b34faeb6d54c

Wensockets use TCP so this could be a good thing to implement the transfer protocol in because of the minimum framing websockets use for streaming. Seems better then raw TCP to be frank. TCP in its raw form fragments packers like crazy and not having a header, a minimum one, is a headache for developers.

andrewjaykeller avatar Jun 20 '17 16:06 andrewjaykeller

GRPC (TCP only right now) might be worth exploring for you too. I want to say for what you're doing that'll work smoother. There's more documentation/maturity with websockets.

stevenaldinger avatar Nov 23 '17 03:11 stevenaldinger

Is this GRPC? Link?

andrewjaykeller avatar Nov 23 '17 03:11 andrewjaykeller

Yeah and I take that back already, just realized you're going to browsers (vs just bidirectional stream)

stevenaldinger avatar Nov 23 '17 03:11 stevenaldinger

We can go to node, python, Java, anything, does this run on ESP8266?

andrewjaykeller avatar Nov 23 '17 03:11 andrewjaykeller

I don't see why it wouldn't. I've got a mature node client if you do, hit me up. GRPC works like databases a little where you depending on what you're doing you might want a connection pool. I use it on an API server and treating it like REST will def break things. :D

stevenaldinger avatar Nov 23 '17 03:11 stevenaldinger

remember the first time we saw promises and were like what the shit is this? :D

stevenaldinger avatar Nov 23 '17 03:11 stevenaldinger

FYI, I knew drone.io switched from websockets to grpc but didn't know why. Donno what half of this means but might be useful to you :P

replaced websockets with server sent events because http/2 does not support websockets, and version 0.8 begins taking advantage of http/2 connections for grpc and includes experimental quic support.

https://github.com/drone/drone/issues/2159

stevenaldinger avatar Nov 23 '17 04:11 stevenaldinger

Is this ticket still valid? I will look into working on it if so

mickmister avatar Jan 10 '24 08:01 mickmister