World Domination Using Arduinos and Websockets


World Domination Using Arduinos and Websockets

by kevinrohling


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
    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://

Controlling an Arduino Robot using Websockets and Pusher

Learn More

Goto Original

TAG : arduino, embedded, json, push notification, pusher, robot, robotics, servo, websocket, ethernet


Please Login to comment
Notify of