Internet of Things Skull #ElectronicHalloween

from Internet of Things Skull #ElectronicHalloween

by Jessica

NewImage


Check out this great Halloween project from Javier Hernandez in the Element 14 community.



The skull was working great connected usb to the PC. But I wanted it to be wireless. Since I have an Adafruit CC3000 breakout board available, decided to stick it in. Also a few years ago I made my own Arduino compatible board, based on the usbasp project and got the inspiration from the metaboard. My board end up beein a 5cm x 5cm board with Atmega328p which can run Arduino code…


With this architecture the laptop is just another trigger mechanism similar to a phone. On my last post the laptops was used to send information directly to the Arduino board but now the skull is free to play around. The Skull is completely wireless and receives power via a usb. It is connected to the closest usb plug I could find at the desired location. We got wifi in the entire office so it can be moved around without problem.


At home the Skull worked really good, every now and then the mqtt libraries got disconnected from the server but I was able to reconnect via the code and everything was good. But when got into the office the skull got disconnected and failed to connect again. I didn’t had much time during work hours to debug and fix the situation, so I went for a quick and dirty trick. Whenever the device got disconnected I just soft reset the Atmega, that makes the board to reset and re-connect to the wifi and mqtt service. After the soft reset all starts working again. This solution is far from pretty, mostly because the skull stop working for a while until the reset completes. Wifi connection and DHCP takes some time to complete and that is horrible for the user that wants to see the skull respond to its commands. But is better than unplug and plug back. Also it didn’t took much time to “fix”.


The software reset is a simple hack I found on Instructables. There are two ways, I went with the all software way.


Seems that if you define a pointer to a function in address 0 and issue a call to it it restarts the program, how would have thought?



Read more.





Featured Adafruit Product!


NewImage


Adafruit CC3000 WiFi Breakout with Onboard Ceramic Antenna: For years we’ve seen all sorts of microcontroller-friendly WiFi modules but none of them were really Adafruit-worthy. Either they were too slow, or too difficult to use, or required signing an NDA, or had limited functionality, or too expensive, or too large. So we shied away from carrying any general purpose microcontroller-friendly WiFi boards.


NO LONGER!


The CC3000 hits that sweet spot of usability, price and capability. It uses SPI for communication (not UART!) so you can push data as fast as you want or as slow as you want. It has a proper interrupt system with IRQ pin so you can have asynchronous connections. It supports 802.11b/g, open/WEP/WPA/WPA2 security, TKIP & AES. A built in TCP/IP stack with a “BSD socket” interface. TCP and UDP in both client and server mode, up to 4 concurrent sockets. It does not support “AP” mode, it can connect to an access point but it cannot be an access point. Read more.




Adafruit electronic halloween dark HAPPY HALLOWEEN! Each weekday this month we’ll be bringing you ideas and projects for an Electronic Halloween! Expect wearables, hacks & mods, costumes and more here on the Adafruit blog! Working on a project for Halloween this year? Share it with us on Google+, in the comments below, the Adafruit forums, Facebook, or Twitter– we’d love to see what you’re up to and share it with the world (tag your posts #ElectronicHalloween). Tune in to our live shows, Wearable Electronics with Becky Stern, 3D hangouts with Matt, Pedro, and Noe, and Ask an Engineer, featuring store discount codes, ideas for projects, costumes, and decorations, and more!



Comments