Skip to content

A Kotlin application that controlls the MacqueenPlus V2 robot, using http requests, connecting via a wifi modul (ESP-01) connected on the robot.

License

Notifications You must be signed in to change notification settings

noturlee/MicroBit-Remote

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

banner

MacQueen Remote Control App

Table of Contents

  1. Overview
  2. Features
  3. Prerequisites
  4. Getting Started
  5. Code Explanation
  6. Troubleshooting
  7. Roadmap
  8. License

Overview

The MacQueen Remote Control App is an Android application designed to control a MacQueen Plus v2 robot via WiFi. The app enables users to send movement commands to the robot, toggle its LED light, and activate its sound feature. It also provides haptic feedback (vibration) for each button press to enhance user interaction.

Features

  • Robot Movement Control: Move the robot forward, backward, left, or right.
  • LED Control: Toggle the robot's LED light on and off.
  • Sound Control: Activate the robot's sound feature.
  • Haptic Feedback: Vibration feedback for each button press.

Prerequisites

  • Android device running API level 21 or higher.
  • MacQueen Plus v2 robot connected to the same WiFi network as the Android device.

Getting Started

1. Setup the Android App

  1. Clone the Repository

    git clone https://github.com/your-repository/macqueen-remote-control.git
    cd macqueen-remote-control
  2. Open the Project

Open the project in Android Studio.

  1. Update Network Configuration

Ensure that your network_security_config.xml (referenced in AndroidManifest.xml) allows cleartext traffic if using HTTP:

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <domain-config cleartextTrafficPermitted="true">
        <domain includeSubdomains="true">192.168.4.1</domain>
    </domain-config>
</network-security-config>
  1. Add Permissions

Add the following permissions to your AndroidManifest.xml:

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.VIBRATE"/>
  1. Set up Microbit Code

Below is a link to my Code, it is important to understand the concepts of it and how it integrates and works with the Kotlin application, download and add this code to your microbit IDE:

https://makecode.microbit.org/S19893-69610-13178-56347

Technology Stack

Tools and languages used.

Canva
Canva
Kotlin
Kotlin
React
React
TypeScript
TypeScript
  1. Build and Run

Build and run the app on your Android device.

Setup the MacQueen Plus v2 Robot

Ensure the MacQueen Plus v2 robot is connected to the WiFi network. The robot should be reachable at http://192.168.4.1/. Adjust the baseUrl in MainActivity if your robot's IP address is different, The wifi SSID for my code is Spaza-Wifi and the Password is I am speed

Code Explanation

  • Network Requests: The app uses OkHttpClient to send HTTP requests to the robot for controlling various functions. Each button press triggers a specific command sent to the robot.

  • Haptic Feedback: The app utilizes the Vibrator service to provide haptic feedback when a button is pressed, enhancing the user experience.

  • Command Handling: The app handles commands to control robot movement, toggle the LED, and activate sound. The toggleLed method manages the LED state, switching it between on and off with each press.

  • Kotlin App: The app is built using Kotlin and follows standard Android practices for handling UI interactions and network communication.

  • MacQueen Plus v2 Robot: The MacQueen Plus v2 is a programmable robot that can be controlled over WiFi. It supports various commands for movement, LED control, and sound activation. Ensure the robot's firmware supports the commands sent by the app.

Troubleshooting

  • Robot Not Responding: Ensure the robot is connected to the same WiFi network as the Android device and that the IP address is correctly configured in the app.

  • Vibration Not Working: Verify that the Android device has vibration hardware and that the vibration permission is correctly set in the app's manifest.

  • Network Issues: Check network configurations and ensure that the network_security_config.xml permits cleartext traffic if using HTTP.

Roadmap

Phase Description Target Date
Phase 1 Initial Development and Setup July 2024
Phase 2 Core Features Implementation July 2024
Phase 3 Testing and Debugging August 2024
Phase 4 Final Review and Release September 2024
Phase 5 Post-Release Support and Updates September 2024

License

This project is licensed under the MIT License. See the LICENSE file for details.



Happy Coding

image

About

A Kotlin application that controlls the MacqueenPlus V2 robot, using http requests, connecting via a wifi modul (ESP-01) connected on the robot.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published