World Domination Using Arduinos and Websockets
by kevinrohling
Overview
In this post, Author say that arduinos are tons of fun and recommend remotely controlling robot to you. And, Author recommend solutions how to remotely control robot. It is to use pusher, a real-time push notification service that runs over WebSockets.
Building the WebSocket Client
WebSockets are an interesting hybrid between HTTP and raw TCP connections. They start life very much like a normal HTTP GET request. In the request the client sends a bit information asking for an “upgraded” connection. Once the server sees this, if WebSockets are supported it sends a response back with a status code of 101 indicating that the connection was successfully upgraded. Then, and here’s where things diverge from HTTP, nobody closes the connection. Both the client and the server remain connected to each other. Here’s what this looks like at the socket level:
-
Client Requests a WebSocket Connection
GET /app/yourpusherapikey?client=js&version=1.9.0 HTTP/1.1 Upgrade: WebSocket Connection: Upgrade Host: ws.pusherapp.com:80 Origin: ArduinoWebSocketClient
-
Server responds indicating that the upgrade was successful
HTTP/1.1 101 Web Socket Protocol Handshake Upgrade: WebSocket Connection: Upgrade WebSocket-Origin: ArduinoWebSocketClient WebSocket-Location: ws://ws.pusherapp.com:80/app/yourpusherapikey?client=js&version=1.9.0 Connected
Controlling an Arduino Robot using Websockets and Pusher
Learn More
MidnightCow
위즈네트 칩(W5300, W5200, W7100, W7500) 개발자