Close
0%
0%

1Sheeld in 0$

Save $ on bluetooth serializer and enjoy 1Sheeld for free on MKR1000 or any Arduino with WiFi Shield 101

Similar projects worth following
1Sheeld is an amazing project that allow the usage of all of Android smartphone's capabilities such as LCD Screen, Gyroscope, Switches, LEDs, Accelerometer, Magnetometer, GSM, Wi-Fi, GPS …etc. into your Arduino sketch.

Normally 1Sheeld consists of two parts:
1) Physical Board, with a microcontroller and a bluetooth module to transmit data between Arduino and your smartphone
2) Mobile App, that opens your phone's sensors and capabilities to be used as virtual shields for Arduino

The whole idea is to let you prototype with Arduino on the cheap. The Physical Board mentioned above does costs around 55$, excluding shipping and taxes.

I thought why not replace the wireless middle-man physical board with WiFi-Direct functionality built into Atmel ATWINC1500 chip that powers MKR1000 board and WiFi Shield 101.

WiFi-Direct connectivity opens up other interesting opportunities, like using Arduino as IOIO board, or collecting high speed trace data wirelessly.

The objective of 1Sheeld http://1sheeld.com/ is to provide faster and cheaper ways of prototyping your Arduino projects. My idea is, if you already own a board with buit-in WiFi like Arduino MKR1000 or own WiFi Sheild-101 then you can use 1Sheeld for free wihout buying the physical board that attaches to your Arduino. The physical board talks to Android over Bluetooth. WiFi-Direct will can easily replace that.


1Sheeld library for Arduino and its Android application are open source which should allow replacing the transport layer without too much trouble.


This opens up other interesting opportunities as well. You could use your MRK1000 board as a replacement for IOIO board, which is targeted to Java developer looking to add advanced hardware I/O capabilities to their Android application. Alternatively you can use the high speed wireless link to collect trace data. I actually used this to tune PID controller in my robot car.

  • Implementing WiFi-Direct in Arduino library WiFi101

    Asad Zia05/17/2016 at 11:17 3 comments

    Atmel website says that the chip WINC1500 supports WiFi-Direct. The WiFi101 software library that comes with Arduino IDE has no API that indicate WiFi-Direct support. The first step is to add WiFi-Direct functionality into WiFi101 library.

    I forked the WiFi101 on github and soon discovered that the file WiFi.cpp is the best place to implement the additional APIs needed to connect to WiFi-Direct. I added the follwing APIs:

     /*
    
    * Start Wifi as P2P device. P2P is also known as Wi-Fi Direct.
    
    *
    
    * param name: Set your device name which will be shown in the peer device.
    
    * param channel: Wifi channel to use. Valid values are 0, 5 and 10.	*
    
    */
    
    uint8_t beginP2P(const char *name);
    
    
    uint8_t beginP2P(const char *name, uint8_t channel);

    This follows the same design pattern as the other APIs for configuring WiFi in station mode or Access Point mode.

    There is already an infrastructure in place to handle callbacks. I reused the same logic and implemented the WiFi-Direct API. I added a new example to demonstrate how to connect to WiFi-Direct, it is:

    #include <WiFi101.h>
    
    char name[] = "wifi101-p2p"; // P2P device name
    
    void setup() {
    
      // attempt to connect to Wifi-Direct:
      if ( WiFi.beginP2P(name) != WL_CONNECTED) {
        // don't continue:
        while (true);
      }
    
      // you're connected now, so print out the data:
      printCurrentNet();
      printWifiData();
    }
    
    void loop() {
      // communicate normally
    }
    

    When I coded everything and ran it, it did not connect. On investigation it turned out that I cannot use channel values between 1 to 12 as is the case for Access Point mode. The only allowed channel values are 0, 5 and 10. On using the correct channels it worked like a charm. Please see the connection dialog from Android below:

    You can find the updated library and working example at github https://github.com/asadziach/WiFi101

View project log

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates