XdkExtensionPort

This example demonstrates the capabilities when using the extension bus of the XDK. It provides the possibility to communicate with external attached devices over UART, SPI, I2C or simply over GPIO. Furthermore, the example is configurable to use only one of the previously mentioned communication modules or all at once.

Programming

  1. Find the files placed under AwsSendDataOverMQTT (4 files)

    1. Modify the config.txt with ssid, password, serverurl, brokerurl and broker port as shown below in config.txt. picture.

    2. Go to “IoT Core” available under “Services”, after logging into http://console.aws.amazon.com/.  If you don’t have an existing account you have to create a new AWS account. Afterwards The Home page will open as shown below

    • XDK
    • USB cable (USB A to USB micro)
    • Windows 7 or greater/Linux/MAC PC with XDK-Workbench version 3.4.0 or later installed
    • Available wireless network
    1. Connect the XDK to the PC via USB cable

    2. Open the XDK-Workbench

    3. From the Welcome Screen, open the BoschXDKCloudConnectivity example

    4. From the Project Explorer, expand the project and then open the AppController.h file

    5. Edit the WLAN_SSID_DEFAULT field to match the available networks name

    6. Edit the WLAN_PASSWORD_DEFAULT field to match the available networks password

    7. Clean and Build the project

    8. Flash the project to your XDK

    • XDK
    • USB cable (USB A to USB micro)
    • Windows 7 or greater/Linux/MAC PC with XDK-Workbench version 3.4.0 or later installed
    • Available wireless network
    1. Connect the XDK to the PC via USB cable

    2. Open the XDK-Workbench

    3. From the Welcome Screen, open the HttpExampleClient example

    4. From the Project Explorer, expand the project, open the source folder and then open the AppController.h file.

    5. Edit the WLAN_SSID field to match the available networks name

    6. Edit the WLAN_PSK field to match the available networks password

    7. Save the file

    8. Clean and build the project

    9. Flash the project to the XDK

    • Push Button 1 Pressed

      • Red LED State - ON
      • Orange LED State - OFF
      • Yellow LED State - ON
    • Push Button 1 Released

      • Red LED State - OFF
      • Orange LED State - ON
      • Yellow LED State - OFF
    • Push Button 2 Pressed

      • Red LED State - ON
      • Orange LED State - ON
      • Yellow LED State - OFF
    • Push Button 2 Released

      • Red LED State - OFF
      • Orange LED State - OFF
      • Yellow LED State - ON
    • XDK

    • USB cable (USB A to USB micro)

    • Windows 7 or greater/Linux/MAC PC with XDK-Workbench version 3.4.0 or later installed

    1. Connect the XDK to the PC via USB cable

    2. Open XDK-Workbench

    3. From the Welcome Screen, open the LedsAndButtons example

    4. Clean and build the project

    5. Flash the project to the XDK

    • XDK
    • USB cable (USB A to USB micro)
    • Windows 7 or greater/Linux/MAC PC with XDK-Workbench version 3.4.0 and later installed
    • Available wireless network
    1. Connect the XDK to the PC via USB cable

    2. Open the XDK-Workbench

    3. From the Welcome Screen, open the Lwm2mExampleClient example

    4. From the Project Explorer, expand the project, open the source folder and then open the AppController.h file

    5. Edit the WLAN_SSID field to match the available networks name

    6. Edit the WLAN_PSK field to match the available networks password

    7. Clean and build the project

    8. Flash the project to the XDK

    • XDK
    • USB cable (USB A to USB micro)
    • Windows 7 or greater/Linux/MAC PC with XDK-Workbench version 3.4.0 or later installed
    • Available wireless network
    1. Connect the XDK to the PC via a USB cable

    2. Open the XDK-Workbench

    3. From the Welcome Screen, open the PpmpUnide example

    4. From the Project Explorer, expand the project, open the source folder and then open the AppController.h file

    5. Edit the WLAN_SSID field to match the available networks name

    6. Edit the WLAN_PSK field to match the available networks password

    7. Edit the SNTP_SERVER_URL field to match the available SNTP server address

    8. Edit the PPMP_SERVER_URL field to match the available PPMP server address

    9. Edit the PPMP_POST_URL_MESSAGE field to match the URI where the message payload should be sent to

    10. Edit the PPMP_POST_URL_MEASUREMENT field to match the URI where the measurement payload should be sent to

    11. Edit the APP_PPMP_DEVICE_ID field to set the unique XDK PPMP node

    12. Save the file

    13. Clean and build the project

    14. Flash the project to the XDK

    • XDK
    • USB cable (USB A to USB micro)
    • Windows 7 or greater/Linux/MAC PC with XDK-Workbench version 3.4.0 or later installed
    • Micro SD card (formatted to FAT/FAT32 with a data size of 32 GB or less)
    1. Insert the Micro SD card into the XDK

    2. Connect the XDK to the PC via USB cable

    3. Open the XDK-Workbench

    4. From the Welcome Screen, open the SdCardExample example

    5. Insert the stop timer with the following line as shown in the screenshot below

      xTimerStop(sdCardWriteReadHandle, WRITEREAD_BLOCK_TIME);
      

      Image

    6. Clean and build the project

    7. Flash the project to the XDK

    • XDK
    • USB cable (USB A to USB micro)
    • Windows 7 or greater/Linux/MAC PC with XDK-Workbench version 3.4.0 or later installed
    • Mobile Android/iOS device with Bluetooth Low Energy (BLE) and the BLE scanner application
    1. Connect the XDK to the PC via USB cable

    2. Open the XDK-Workbench

    3. From the Welcome Screen, open the SendAccelerometerDataOverUdpAndBle example

    4. Clean and build the project

    5. Flash the project to the XDK

    • XDK
    • USB cable (USB A to USB micro)
    • Windows 7 or greater/Linux/MAC PC with XDK-Workbench version 3.4.0 or later installed
    • Mobile Android/iOS device with Bluetooth Low Energy (BLE) and the BLE scanner application
    1. Connect the XDK to the PC via USB cable

    2. Open the XDK-Workbench

    3. From the Welcome Screen, open the SendAccelerometerDataOverBle example

    4. Clean and build the project

    5. Flash the project to the XDK

    • XDK
    • USB cable (USB A to USB micro)
    • Windows 7 or greater/Linux/MAC PC with XDK-Workbench version 3.4.0 or later installed
    • Available wireless network and an own UDP server
    1. Connect the XDK to the PC via USB cable

    2. Open the XDK-Workbench

    3. From the Welcome Screen, open the SendDataOverMQTT example

    4. From the Project Explorer, expand the project, click at the source folder and open the AppController.h file

    5. Edit the WLAN_SSID field to match the available networks name

    6. Edit the WLAN_PSK field to match the available networks password

    7. Edit the SNTP_SERVER_URL field to match the URL the XDK will get its SNTP timestamp

    8. Edit the APP_MQTT_BROKER_HOST_URL field to match the URL of the destination MQTT broker

    9. Edit the APP_MQTT_BROKER_HOST_PORT field to match the MQTT broker port number on which the destination MQTT broker will listen

    10. Edit the APP_MQTT_CLIENT_ID field to match your client ID, which will be used to identify the XDK as publishing and subscribing MQTT client

    11. Edit the APP_MQTT_TOPIC field to match the topic, the XDK will publish data to and subscribe from

    12. Clean and Build the project

    13. Flash the project to your XDK

    • XDK
    • USB cable (USB A to USB micro)
    • Windows 7 or greater/Linux/MAC PC with XDK-Workbench version 3.4.0 or later installed
    • Available wireless network and an own UDP server
    1. Connect the XDK to the PC via USB cable

    2. Open the XDK-Workbench

    3. From the Welcome Screen, open the SendDataOverUdp example

    4. From the Project Explorer, expand the project, open the source folder and then open the AppController.h file

    5. Edit the WLAN_SSID field to match the available networks name

    6. Edit the WLAN_PSK field to match the available networks password

    7. Edit the DEST_SERVER_IP field to match the IP address of the destination server

    8. Edit the DEST_SERVER_PORT field to match the server port number on which the destination server will listen

    9. Clean and Build the project

    10. Flash the project to your XDK

    • Rotation

    • Compass

    • Absolute Humidity

    • Calibrated Accelerometer

    • Calibrated Gyroscope

    • Calibrated Magnetometer

    • Gravity

    • StepCounter

    • Fingerprint

    • Linear Acceleration

    • Gestures

    • XDK

    • USB cable (USB A to USB micro)

    • Windows 7 or greater/Linux/MAC PC with XDK-Workbench version 3.4.0 or later installed

    1. Connect the XDK to the PC via USB cable

    2. Open the XDK-Workbench

    3. From the Welcome Screen, open the SendVirtualSensorDataOverUsb example

    4. Open the project in the Project Explorer and navigate to the file AppController.c

    5. Enable the sensor you want to use in the struct VirtualSensors.

    6. Clean and build the project

    7. Flash the project to the XDK

    • XDK
    • USB cable (USB A to USB micro)
    • Windows 7 or greater/Linux/MAC PC with XDK-Workbench version 3.4.0 or later installed
    1. Connect the XDK to the PC via USB cable

    2. Open the XDK-Workbench

    3. From the Welcome Screen, open the StreamSensorDataOverUsb example

    4. Clean and build the project

    5. Flash the project to the XDK

    • XDK
    • USB cable (USB A to USB micro)
    • Windows 7 or greater/Linux/MAC PC with XDK-Workbench version 3.4.0 or later installed
    • Mobile Android/iOS device with Bluetooth Low Energy (BLE)
    1. Connect the XDK to the PC via USB cable

    2. Open the XDK-Workbench

    3. From the Welcome Screen, open the VirtualXdkDemo example

    4. Install the Virtual XDK app on the mobile device (from the iTunes Store on iOS or the Play Store on Android)

    5. Open the app on the mobile device

    6. Turn the mobile device’s Bluetooth on

    7. Clean and build the project

    8. Flash the project to the XDK

    • XDK
    • USB cable (USB A to USB micro)
    • Windows 7 or greater/Linux/MAC PC with XDK-Workbench version 3.4.0 or later installed
    • Available wireless network
    1. Connect the XDK to the PC via USB cable

    2. Open the XDK-Workbench

    3. From the Welcome Screen, open the WlanNetworkManagement example

    4. Open the project and navigate to the file WlanNetworkManagment.h file

    5. Configure the network and DHCP setting as desired

    6. Clean and build the project

    7. Flash the project to the XDK

    • XDK
    • USB cable (USB A to USB micro)
    • Windows 7 or greater/Linux/MAC PC with XDK-Workbench version 3.4.0 or later installed
    • External attachable device, which communicates over UART, SPI, I2C or GPIO
    1. Connect the XDK to the PC via USB cable

    2. Open the XDK-Workbench

    3. From the Welcome Screen, open the XdkExtensionPort example

    4. From the Project Explorer, expand the project, open the source folder and then open the AppController.h file.

    5. Edit the EXTENSION_PORT_UART_FEATURE field to enable or disable communication over UART

    6. Edit the EXTENSION_PORT_I2C_FEATURE field to enable of disable communication over I2C

    7. Edit the EXTENSION_PORT_SPI_FEATURE field to enable of disable communication over SPI

    8. Edit the EXTENSION_PORT_GPIO_FEATURE field to enable of disable communication over GPIO

    9. Save the file

    10. Clean and build the project

    11. Connect an external device which communicates over UART, SPI, I2C or GPIO over the extension bus to the XDK

    12. Flash the project to the XDK