Powered by Blogger.

Friday, December 2, 2016

Tag: ,

Lesson 8: MagicKits- MagicShield







MagicShield is the plugin solution for connecting your favorite Arduino with the cloud. It is common knowledge that the Arduino ecosystem based on ATMEL microcontroller is the most favored option for hobbyists around the world. Its user friendliness leverages on opensource libraries, large community support and low cost hardware. But when it comes to the Internet of Things, there are significant drawbacks mainly because

  • No integrated hardware for networking at the link layer level or TCP/IP level
  • Limited resources (Flash/RAM) making it difficult to run a fully fledged TCP/IP stack apart from its intended use.
The solution we offer is the MagicShield for Arduino. It is a Arduino pin compatible shield that can be plugged to your Arduino Uno or Mega board. The MagicShield connects to the RX0 & TX0 of your Arduino and anything you write to the TX0 will be carried to the magicblocks.io cloud platform seamlessly. You do not have to write any network related code or server side code to make it happen. All the magic needed to transport your data from the Arduino to the cloud via an ordinary WiFi connection is built into the module. Similarly any information you need to send from the cloud to the Arduino will arrive at the RX0. You only have to do a Serial.read() to read the data from the cloud. 

The beauty of this cloud oriented approach is that you can connect devices with each other using the powerful drag and drop editor at magicblocks.io It relieves you of the hassle of writing the code for network communication. The MagicShield connects to the cloud via WiFi and the GSM based MagicShield module will be available in the future.

The MagicShield operates on both client and access point modes similar to the MagicWiFi. The client part is used to connect to the cloud via an Internet connected WiFi connection while the access point mode is used by the user to configure the device.

Step 1: Configure with Magicblocks

F1FCNMXIUSM1ATA.MEDIUM
pixel[1]
pixel[2]
pixel[3]
WiFi connection with Internet connectivity should be available
  • Plugin the MagicShield to the Arduino board
  • On your PC or phone look for the SSID of the MagicShield to appear. This SSID can be customized if you build the firmware and flash it to the module by yourself. Refer Lesson 6 for more details. What you see here is the SSID of the access point mode of the MagicShield module
  • Connect to MagicShield access point and navigate to http://192.168.4.1/ in your browser
  • Select the WiFi network through which the MagicShield should connect to internet from the dropdown menu
  • Enter the password of the WiFi network selected previously
  • Click 'Submit' and you will receive a message 'Access point saved. Restarting....'
After you click 'Submit' the module will restart. This means the MagicShield access point to which you are connected will be disconnected automatically. 
After about 10 seconds connect to the SSID of the MagicShield module again and navigate to http://192.168.4.1/ again to clarify if the module is connected properly. If so it should indicate 'Connection to <WiFi network name> successful!'

If connection to WiFi is successful, navigate to the Device Manager of your magicblocks account (refresh if already opened) and you should see that the connection is showing a green 'thumbs up' icon.

You can also use the in-built blue LED to get an idea of the connection status of the module with the cloud. Once you power up the module, the LED will be ON. When it connects to the WiFi network it will start blinking. Once it is connected with the cloud platform the LED will turn OFF. If you are using a customized firmware built with the code builder, this can be observed only if the 'Indicate Status' option  is enabled. On the default firmware which comes with the module, this is enabled by default.

Step 2: Features

  • Dimensions: 53mmx 68mm
  • Module: ESP8266
  • 802.11 b/g/n WIFI
  • Integrated 10-bit ADCInterfaces
  • Magicblocks.io support
  • Ardunio IDE support

Step 3: Connecting with Arduino

Now that you have a connected MagicShield you can use it as a bridge to connect your favorite Arduino to the cloud platform. Any data written on the TX0 of the Arduino will be available on the 'Magic Link' node on the magicblocks.io playground as shown in the video below: