Library

Video Player is loading.
 
Current Time 0:00
Duration 6:54
Loaded: 0%
 

x1.00


Back

Games & Quizzes

Training Mode - Typing
Fill the gaps to the Lyric - Best method
Training Mode - Picking
Pick the correct word to fill in the gap
Fill In The Blank
Find the missing words in a sentence Requires 5 vocabulary annotations
Vocabulary Match
Match the words to the definitions Requires 10 vocabulary annotations

You may need to watch a part of the video to unlock quizzes

Don't forget to Sign In to save your points

Challenge Accomplished

PERFECT HITS +NaN
HITS +NaN
LONGEST STREAK +NaN
TOTAL +
- //

We couldn't find definitions for the word you were looking for.
Or maybe the current language is not supported

  • 00:00

    Back in the dark ages of the world wide web, any time you wanted to update anything on
    Back in the dark ages of the world wide web, any time you wanted to update anything on

  • 00:05

    a web page, you had to go get a whole new web page.
    a web page, you had to go get a whole new web page.

  • 00:08

    You had to go to the server and get a new one.
    You had to go to the server and get a new one.

  • 00:10

    It's not just like connecting and getting a webpage.
    It's not just like connecting and getting a webpage.

  • 00:12

    You have to go make a connection to the server the server says okay you're connected, you
    You have to go make a connection to the server the server says okay you're connected, you

  • 00:16

    have to go send a request to the server, the server sends back the data then you have to
    have to go send a request to the server, the server sends back the data then you have to

  • 00:19

    close a connection, just to update anything on a webpage.
    close a connection, just to update anything on a webpage.

  • 00:24

    This is just depressing.
    This is just depressing.

  • 00:25

    Then, someone had the idea of XMLHTTP Requestes.
    Then, someone had the idea of XMLHTTP Requestes.

  • 00:30

    This was amazing.
    This was amazing.

  • 00:32

    This is how ajax worked.
    This is how ajax worked.

  • 00:33

    This is how gmail went to look at the list of who you might be sending emails to.
    This is how gmail went to look at the list of who you might be sending emails to.

  • 00:38

    This is how so many things on the web were made so much nicer.
    This is how so many things on the web were made so much nicer.

  • 00:42

    Now, once you have a connection and you have your webpage, you can send things like a "T"
    Now, once you have a connection and you have your webpage, you can send things like a "T"

  • 00:48

    or an "E" without loading the entire webpage.
    or an "E" without loading the entire webpage.

  • 00:53

    That's how it was, until 2011 when the W3C came out with websockets.
    That's how it was, until 2011 when the W3C came out with websockets.

  • 01:00

    Websockets are unbelievable.
    Websockets are unbelievable.

  • 01:02

    Now, you still have to do the whole thing to get the webpage to begin with, but, rather
    Now, you still have to do the whole thing to get the webpage to begin with, but, rather

  • 01:06

    than making a whole new set of requests and doing that work every time... when your webpage
    than making a whole new set of requests and doing that work every time... when your webpage

  • 01:10

    loads, you connect to the server, say "hey can I talk on a websocket" server says "sure
    loads, you connect to the server, say "hey can I talk on a websocket" server says "sure

  • 01:15

    why not" now, whenever you want to say anything like "T" and "E" say we are autofilling this
    why not" now, whenever you want to say anything like "T" and "E" say we are autofilling this

  • 01:20

    box.
    box.

  • 01:21

    See how it says t and tee and tees and tees whatever.
    See how it says t and tee and tees and tees whatever.

  • 01:25

    You can say "T" and it sends you back some stuff, or you can say "E" and it sends you
    You can say "T" and it sends you back some stuff, or you can say "E" and it sends you

  • 01:28

    back some stuff.
    back some stuff.

  • 01:30

    This is so much.
    This is so much.

  • 01:32

    So so much more efficient.
    So so much more efficient.

  • 01:35

    You may be wondering how fast this websockets is.
    You may be wondering how fast this websockets is.

  • 01:38

    Well, in this case, it's running at around 500 hz.
    Well, in this case, it's running at around 500 hz.

  • 01:43

    What that means is right here, when the website still has to do this connection thing.
    What that means is right here, when the website still has to do this connection thing.

  • 01:50

    It still has to pull this site from the ESP8266.
    It still has to pull this site from the ESP8266.

  • 01:54

    Once it does though, now whenever it says "T" and it gets a response, that can happen
    Once it does though, now whenever it says "T" and it gets a response, that can happen

  • 01:59

    in as little as two or less milliseconds.
    in as little as two or less milliseconds.

  • 02:03

    That's just unbelievable.
    That's just unbelievable.

  • 02:04

    So, some of the features I've been able to add to this is something like an oscilloscope.
    So, some of the features I've been able to add to this is something like an oscilloscope.

  • 02:10

    As you can see when I open up the oscilloscope, the speed slows down.
    As you can see when I open up the oscilloscope, the speed slows down.

  • 02:14

    This right here is using the colorchord version of this system, but I've added this same system
    This right here is using the colorchord version of this system, but I've added this same system

  • 02:20

    to the WS2812 I2S driver for the ESP sorry...
    to the WS2812 I2S driver for the ESP sorry...

  • 02:27

    The ESP8266 WS2812 I2S Driver which I covered in a previous video.
    The ESP8266 WS2812 I2S Driver which I covered in a previous video.

  • 02:33

    So, with ColorChord, we have a little ADC on the chip and that little ADC right here
    So, with ColorChord, we have a little ADC on the chip and that little ADC right here

  • 02:40

    is being displayed, so, with websockets, I'm issuing a command, let's just see what that
    is being displayed, so, with websockets, I'm issuing a command, let's just see what that

  • 02:46

    would look like, a CM command.
    would look like, a CM command.

  • 02:48

    I'm gonna submit it.
    I'm gonna submit it.

  • 02:50

    And, the ESP8266 responds with... unfortunately I'm still not using the newer versions of
    And, the ESP8266 responds with... unfortunately I'm still not using the newer versions of

  • 02:56

    websockets which allow you to respond with binary data -- but still it sends back all
    websockets which allow you to respond with binary data -- but still it sends back all

  • 03:00

    the oscilloscope data for that frame.
    the oscilloscope data for that frame.

  • 03:03

    And, it does this at around 200 Hz.
    And, it does this at around 200 Hz.

  • 03:06

    Means it sends it back and it's updating this canvas right here, this HTML canvas.
    Means it sends it back and it's updating this canvas right here, this HTML canvas.

  • 03:11

    So, if I go play a song.
    So, if I go play a song.

  • 03:14

    Say this, it's off of Brendan Becker's or...
    Say this, it's off of Brendan Becker's or...

  • 03:19

    Inverse Phase's Shuttle Scuttle OST Album, you can see in the browser, in real time,
    Inverse Phase's Shuttle Scuttle OST Album, you can see in the browser, in real time,

  • 03:26

    you can see the information coming off of my audio por here and going into the ESP8266's
    you can see the information coming off of my audio por here and going into the ESP8266's

  • 03:33

    ADC, being updated at 16,000 Hz.
    ADC, being updated at 16,000 Hz.

  • 03:37

    Now you can see the actual wave form inside the browser.
    Now you can see the actual wave form inside the browser.

  • 03:42

    Because it is colorchord, it has to do a DFT, folded, or regular DFT which it fuzzes then
    Because it is colorchord, it has to do a DFT, folded, or regular DFT which it fuzzes then

  • 03:49

    it folds, and based on that it can decide on which notes it thinks are perinent.
    it folds, and based on that it can decide on which notes it thinks are perinent.

  • 03:55

    You can see here, some moving around shortly.
    You can see here, some moving around shortly.

  • 04:00

    And, from there it decides on colors of setting a whole bunch of LEDs it can use on its outputs.
    And, from there it decides on colors of setting a whole bunch of LEDs it can use on its outputs.

  • 04:09

    There's other things that this can do as well.
    There's other things that this can do as well.

  • 04:11

    So, certain things like this right here, you can take the system reflash and drop on new
    So, certain things like this right here, you can take the system reflash and drop on new

  • 04:16

    firmware, or drop on a new webpage.
    firmware, or drop on a new webpage.

  • 04:20

    This is actually the same webpage but I can reload it.
    This is actually the same webpage but I can reload it.

  • 04:24

    And, you can even do something like I have a little interface right here for controlling
    And, you can even do something like I have a little interface right here for controlling

  • 04:29

    the GPIOs.
    the GPIOs.

  • 04:30

    So, here on the ESP8266 board I have here, it's my quadcopter dev board, I can click
    So, here on the ESP8266 board I have here, it's my quadcopter dev board, I can click

  • 04:39

    "5" and turn that little LED on or off.
    "5" and turn that little LED on or off.

  • 04:44

    These are just some of the things you can do.
    These are just some of the things you can do.

  • 04:47

    I've added a couple of these to the other project and I'm adding it to my wiflier project.
    I've added a couple of these to the other project and I'm adding it to my wiflier project.

  • 04:53

    But, you may be wondering how this operates under the hood.
    But, you may be wondering how this operates under the hood.

  • 04:59

    So, under the hood, what's going on here is our javascript is running all the time, and
    So, under the hood, what's going on here is our javascript is running all the time, and

  • 05:05

    there's this little loopback going.
    there's this little loopback going.

  • 05:07

    That whenever it gets new oscope data, it just wants more oscope data and that's what
    That whenever it gets new oscope data, it just wants more oscope data and that's what

  • 05:11

    we were just looking at.
    we were just looking at.

  • 05:12

    So, it calls this function that we wrote called queue operation, which takes on a plain text
    So, it calls this function that we wrote called queue operation, which takes on a plain text

  • 05:18

    command like "CM" and once it's done it calls the function GetOScope and adds this to the
    command like "CM" and once it's done it calls the function GetOScope and adds this to the

  • 05:25

    work queue.
    work queue.

  • 05:26

    The reason that we have a work queue is on the javascript side, we have functions that
    The reason that we have a work queue is on the javascript side, we have functions that

  • 05:31

    execute, in this case it says "hey is anything in the work queue" if there is, go send it
    execute, in this case it says "hey is anything in the work queue" if there is, go send it

  • 05:36

    over to the ESP8266, then take the output and call the callback - and then keep doing
    over to the ESP8266, then take the output and call the callback - and then keep doing

  • 05:42

    this operation again.
    this operation again.

  • 05:43

    So, what we get is we firt, if there's something in the work queue we go send that thing that's
    So, what we get is we firt, if there's something in the work queue we go send that thing that's

  • 05:49

    in the work queue.
    in the work queue.

  • 05:50

    The ESP8266 receives some data.
    The ESP8266 receives some data.

  • 05:54

    Websockets clients actually mask their data, so there has to be some minimal processing
    Websockets clients actually mask their data, so there has to be some minimal processing

  • 05:57

    that's done ahead of time in order to actually get a plain text message back.
    that's done ahead of time in order to actually get a plain text message back.

  • 06:02

    And then it calls custom command.
    And then it calls custom command.

  • 06:04

    Which figures out "ok this is what I figure out this is what I do with the data, in this
    Which figures out "ok this is what I figure out this is what I do with the data, in this

  • 06:07

    case it says "CM" so I'm going to send back 512 samples of oscilloscope data in which
    case it says "CM" so I'm going to send back 512 samples of oscilloscope data in which

  • 06:15

    case the onMessage callback gets called inside of javascript which then it says "ok I was
    case the onMessage callback gets called inside of javascript which then it says "ok I was

  • 06:20

    currently working on that thing in the work queue so I'm going to go call GotOScope which
    currently working on that thing in the work queue so I'm going to go call GotOScope which

  • 06:26

    then updates the HTML5 canvas, and this happens all over again.
    then updates the HTML5 canvas, and this happens all over again.

  • 06:31

    Somehow this entire operation including calling GotOScope and updating the canvas can still
    Somehow this entire operation including calling GotOScope and updating the canvas can still

  • 06:35

    operate at 200 Hz which is just amazing.
    operate at 200 Hz which is just amazing.

  • 06:39

    I love websockets so much.
    I love websockets so much.

  • 06:43

    Isn't it just grand?
    Isn't it just grand?

All

WebSockets for awesome on the ESP8266

126,569 views

Video Language:

  • English

Caption Language:

  • English (en)

Accent:

  • English (US)

Speech Time:

97%
  • 6:45 / 6:54

Speech Rate:

  • 164 wpm - Fast

Category:

  • Science & Technology

Intro:

Back in the dark ages of the world wide web, any time you wanted to update anything on
a web page, you had to go get a whole new web page.
You had to go to the server and get a new one.. It's not just like connecting and getting a webpage.
You have to go make a connection to the server the server says okay you're connected, you
have to go send a request to the server, the server sends back the data then you have to
close a connection, just to update anything on a webpage.
This is just depressing.. Then, someone had the idea of XMLHTTP Requestes.. This was amazing.. This is how ajax worked.. This is how gmail went to look at the list of who you might be sending emails to.
This is how so many things on the web were made so much nicer.
Now, once you have a connection and you have your webpage, you can send things like a "T"
or an "E" without loading the entire webpage.. That's how it was, until 2011 when the W3C came out with websockets.
Websockets are unbelievable.. Now, you still have to do the whole thing to get the webpage to begin with, but, rather
than making a whole new set of requests and doing that work every time... when your webpage
loads, you connect to the server, say "hey can I talk on a websocket" server says "sure

Video Vocabulary

/wəˈT͟Hout/

adverb conjunction preposition

outside. without it being case that. in absence of.

/rəˈkwest/

noun verb

act of asking politely or formally for something. To ask for, usually politely and formally.

/ˈweb ˌpāj/

noun

One page from a website on the internet.

/kəˈnekt/

verb

To associate a thing with something else.

/ɡet/

verb

To (cause to) do a particular thing.

/ˈsendiNG/

noun verb

unpleasant or evil thing or creature supposedly sent by someone with paranormal or magical powers to warn. To move something quickly in a particular way.

/ˈenēˌTHiNG/

pronoun

A thing of any kind.

/(h)wenˈevər/

adverb conjunction

used for emphasis instead of 'when' in questions. at whatever time.

/kəˈnektiNG/

adjective verb

joining or linking things together. To associate a thing with something else.

/ˈsəmˌwən/

pronoun

Person who is not known or named.

/ˈlōdiNG/

adjective noun verb

loaded in specified way. Act of putting things on a truck, ship, etc.. To put in items for use (e.g. bullets in a gun).

/kəˈnekSH(ə)n/

noun

Changing vehicles when traveling.