Love it or hate it, for many people embedded systems means Arduino. Now Arduino is leveraging its more powerful MKR boards and introducing a cloud service, the Arduino IoT Cloud. The goal is to make it simple for Arduino programs to record data and control actions from the cloud.
It used to be that Web browsing was simple. You asked a server for some text, which was duly sent, and then formatted by your browser. Now a web page is as likely to be a full-blown application that is reading mail, editing text, or lots of other things and may use WebSockets to create a back channel to the server. Thanks to affordable hardware like the ESP8266 one of those things a modern web browser can do is sense and control the real world. [Acrobotic] has an interesting video about using WebSockets to allow a browser to talk to an ESP8266 web server in real time. You can see his simple demo in the video below.
The ESP8266, really showcasing its all-round prowess, hosts both a web server for a HTML5 based joystick and a Websockets server so that a client, such as a phone, could interact with it over a fast, low latency connection. Once the ESP8266 receives the input, it uses interrupts to generate the corresponding PPM (Pule Position Modulation) code which the RC receiver on the quadcopter can understand. Very cool!
What really makes this realtime(ish) control viable is Websockets, a protocol that basically allows you to flexibly exchange data over an “upgraded” HTTP connection without having to lug around headers each time you communicate. If you haven’t heard of Websockets you really should look really check out this library or even watch this video to see what you can achieve.
In the process of making a homemade Mech Combat game that features robot-like piloted tanks capable of turning the cockpit independent of the direction of movement, [Florian] realized that while the concept was intuitive to humans, implementing it in a VR game had challenges. In short, when the body perceives movement but doesn’t feel the expected acceleration and momentum, motion sickness can result. A cockpit view that changes independently of forward motion exacerbates the issue.
To address this, [Florian] wanted to use a swivel chair to represent turning the Mech’s “hips”. This would control direction of travel and help provide important physical feedback. He was considering a hardware encoder for the chair when he realized he already had one in his pocket: his iPhone.
By making an HTML page that accesses the smartphone’s Orientation API, no app install was needed to send the phone’s orientation to his game via a WebSocket in Unity. He physically swivels his chair to steer and is free to look around using the VR headset, separate from the direction of travel. Want to try it for yourself? Get it from [Florian]’s GitHub repository.
Although many of us may have had childhood aspirations to be a famous wrestler in the WWE, not very many of us will ever realize those dreams. You can get close, though, if you have your own epic intro music theme that plays anytime you walk into a room. Although it’s not quite the same as entering a wrestling ring, [Matt]’s latest project will have you feeling just as good whenever you enter a room to your own theme song.
The core of the build consists of a boom box with an auxiliary input. The boom box is fed sound via a Raspberry Pi which also serves as the control center for the rest of the project. It runs Node.js and receives commands via websockets from a publicly accessible control server. The Pi is also running Spotify which allows a user to select a theme song, and whenever that user’s iBeacon is within range, the Pi will play that theme song over the stereo.
The project looks like it would be easy to adapt to any other stereo if you’re looking to build your own. Most of the instructions and code you’ll need are available on the project’s website, too. And, if you’re a fan of music playing whenever you open a door of some sort, this unique project is clearly the gold standard. It might even make Stone Cold Steve Austin jealous.
Our Chrome browser thinks it’s a Chromecast dongle. Here’s a screenshot of it playing a YouTube video. Note the tile banner and onscreen controls which are just like the ones you’d see on the actual hardware. Give it a try yourself by downloading the Leapcast Python package which [dz0ny] programmed.
After cloning the GitHub repo we had a few problems compiling the package. Turns out we needed to install python-dev and that took care of it. Starting the daemon is a simple command, we specified our Chrome binary path as well as added a few flags
leapcast --name HAD --chrome /usr/bin/google-chrome --fullscreen
Once that was running the Android YouTube app automatically detected Leapcast as a Chromecast device. It gave us a tutorial overlay mentioning the new share icon on the interface. Pressing that icon during playback launched an Incognito window which played the video. [dz0ny] links to a device config JSON file in the README. If you check it out you’ll notice that Netflix is listed as “external” while the others are not. This is because the Chromecast protocol uses a binary for Netflix. The others do it with local websockets or a cloud proxy so they work just fine with this setup.
A while back, [Blaise] tried his hand at getting the WebSocket protocol working with PIC microcontrollers, WiFi adapters, and a few pots, knobs, and switches. It was an excellent project for its time, but now [Blaise] has a Raspberry Pi, and the associated GPIO pins and Ethernet connection. He decided it was time to upgrade his build to the Pi, this time with a project he calls PiIO.
The basic idea of [Blaise]’s project requires a Pi, a server, and a computer running a browser for the end user. On the Pi side of the build, [Blaise] connected a Microchip MCP3008 eight input, 10-bit ADC via the SPI bus. The Pi takes the ADC sensor values from pots, buttons, or any other analog source and sends them to a server with the WebSocket protocol.
The server hosts a web site written with Django, Autobahn, and Python to communicate with the Pi and host the web page for the data received from the Pi. There’s support for multiple Pis in [Blaise]’s build, making complicated projects we can’t even conceive very possible.
[Blaise] put up an awesome demo video of PiIO up; you can check that out after the break.