0

I'm looking to build my a wirelessly controlled lamp and have a few questions. Would I be able to use the Adafruit HUZZAH CC3000 breakout board to receive commands from a website and control a connected lamp?

I just set up a NodeJS server with webpage on my PC and using socket.io and Firmata I was able to communicate with the Arduino using the webpage over a serial connection. Could I set up similar implementation except instead of communicating over serial I'd communicate using Wifi? Would I need to host a web server on the Wifi board itself to communicate with the Arduino or is there some way to just use the wifi board as a communication between external site and Firmata?

  • 1
    A good source would be Adafruit's website. They detail many projects involving this board, here is one that lights up a tree: learn.adafruit.com/… – Omer Jan 22 '15 at 0:09
2

I happen to have received the CC3000 shield yesterday and have been playing with it today...

What do you mean by "receive commands from a website"?

If you mean "can it serve a simple website and act upon HTTP requests" (e.g. requests to http://arduino.local/on would turn a lamp off and http://arduino.local/off would turn if off), then yes it can. You make the HTTP requests using javascript's XMLHTTPRequest if you want to be able to communicate from within a web page without having to re-render a page.

There is an example sketch of an HTTP server included in the CC3000 library that would get you started. Note that the example HTTP server sketch can only handle one HTTP request/response at a time.

You will obviously also need some way of controlling a relay of you want to control a lamp.

Update: Since you updated your question to include how you are currently communicating:

I'm not familiar with socket.io or Firmata, but I'm guessing socket.io is a way of getting your web client (browser) to talk directly Firmata which talks to your Arduino over the USB-Serial connection? If so, then I'm not sure if it's possible to use the Firmata protocol over wireless, but it is possible for the CC3000 to act as a generic TCP server and act on data that it receives wirelessly, so it might be possible to communicate between socket.io and the TCP server. The EchoServer sketch shows how to set up a TCP server to receive raw data.

If you're only turning a lamp on/off you basically only need to control 1 pin. Isn't Firmata a bit overkill for that? Be careful about sketch size. I'm not sure how big Firmata compiles to, but the wireless library with some kind or server is over 22,000 byes (of a possible 32,000) on an Uno, so you might struggle to fit both on.

  • Added some detail to my question about sockets specifically. – Vian Esterhuizen Jan 25 '15 at 5:40
  • @VianEsterhuizen: Updated my answer now you put more detail in your question, but I'm not sure how much help it will be now as I'm not familiar with some of the technology that you are using. – Grezzo Jan 25 '15 at 11:05
1

Have you heard of aREST.io? There is a wifi library that supports the CC3000 (http://arest.io/wifi/) that sounds like it might do a similar thing to Firmata

  • That looks interesting but I'm really hoping to get this working with sockets. This is really good backup plan though. – Vian Esterhuizen Jan 26 '15 at 14:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.