Architecture @ wifi controlled mecanum robot

Last year I made a mecanum robot controlled by a Spectrum DX8 radio transmitter. Goal of my next project is to control the bot with a tablet. Plan also is to add a video camera on the bot and plaback the video stream on the tablet.

First step is to get the mechanism working on a plain web page on my laptop. I have ordered an Arduino WiFi shield and configured a local web server on my laptop (Xampp). There are many examples on the Internet for sending commands to the Arduino, for example to controll a led. But I haven't found examples in combination with a "return stream"; eg. a periodicaly measurement of a sensor (eventually my video stream). 

Need some help / thoughts here. What setup / design can you advise me? Do I for example need two webservers (one on my laptop and on the on the SD-card of the wifi shield)? Do you know examples that I can study?

I now am in the thinking phase. If the wifi shield arrives I physically start the project.

Presentatie1.jpg

Push it

Here some thoughts about the data (not video):

1. Use a Relay Server

To make shure you can access the data from everywhere and get a full history of all sensed values the relay server could be a good solution. Look at yaler.net and spark.io on how they do it.
Basically on the Arduino you read the sensor value and them make a HTTP POST call to the relay server where the data gets stored in a database. Now as soon as you want to check the data request the data from the relay server and visualize it on the tablet using HTML5.


Source https://www.yaler.net

2. Pushing the Data

In HTML5 the Websocket got introduced. On the net there seems to emerge some Arduino Websocket implementations that makes it possible to push data from the Arduino directly into your tablet’s website. In the website you need JavaScript and a Websocket binding. There is many examples on how to do that. Look out for AngularJS examples.

3. Polling the Data

If you are in HTML4 and lower then you may have to poll the data in a time interval from the website on the tablet.

 

I would try to go with idea 1 or 2.
Do you want to break it down from here or shall LMR assist?

Stream it but don’t touch it

The video is another level of complexity.

Don’t touch the data
If you use an IP camera the camera can stream the data through a given camera ethernet port. You then access this port from the website. You may have a camera that supports WebRTC. Then the integration into the website is less difficult. Check here.
Some cameras have a cloud service that acts as a relay server for you. The website integration might be more difficult here since the cloud service might not be hackable.
But the premise here is to not touch the image/video data. Use the existing infrastructure for that. 

Make the data
If you have an old digital camera and want to make a webcam with it then there is more to do. But I do not go any further here.

Raspberry Pi?
I can easily figure out possible ways to use WiFi to communicate to and from an Arduino. However, I can’t figure out how to send back the video information via the Arduino, mainly because the Arduino’s RAM is too small to hold much video data.

If you were using something like the Raspberry Pi or similar small Linux device, there are applications freely available for you to steam video.

I’m doing a cam bot too

Right now i use raspberry as a server and a GoPro with wifi to get data streaming. I tried streaming with raspberry pi but runs hot fast, so better use some kind of cooling before loading a server and video streaming.

Websocket implemenation @ Arduino or @ NodeJS + Firmata

The last couple of days I looked into websockets and Arduino.

I experimented with NodeJS + socket.io and implemented a small chat application, fun!

Now I want to move on to the Arduino. Goal is to realize a real-time connection between my Uno and a browser, for giving instructions to the Arduino and getting status information from the Arduino. I learned from the Intenet that there are two strategies to implement this:

  1. Implement a websocket client and server on the Arduino itself
  2. implement a websocket client and server @ NodeJS and make a serial connection between NodeJS and the Arduino with Firmata.

First way seems most direct to me. What is the benefit of the second manner? Why should I consider doing it this way?

If I go for the first approach, what’s the best library to use? So far I found these three libraries:

 

 

But I haven’t found any reviews or examples, other than included in the library. What would you recommend me?

Websocket implemenation @ Arduino or @ NodeJS + Firmata

There seems to be something wrong with my comment => repost to be certain.

The last couple of days I looked into websockets and Arduino.

I experimented with NodeJS + socket.io and implemented a small chat application, fun!

Now I want to move on to the Arduino. Goal is to realize a real-time connection between my Uno and a browser, for giving instructions to the Arduino and getting status information from the Arduino. I learned from the Intenet that there are two strategies to implement this:

  1. Implement a websocket client and server on the Arduino itself
  2. implement a websocket client and server @ NodeJS and make a serial connection between NodeJS and the Arduino with Firmata.

First way seems most direct to me. What is the benefit of the second manner? Why should I consider doing it this way?

If I go for the first approach, what’s the best library to use? So far I found these three libraries:

But I haven’t found any reviews or examples, other than included in the library. What would you recommend me?