Bluetooth

Aus www.wiki.ardumower.de
Wechseln zu: Navigation, Suche

Abstract

Pfodapp menu.png

The Ardumower can be monitored and controlled wirelessly:

  • via phone/tablet (Android App)
  • via USB Bluetooth dongle (PC serial console)

On the phone, you'll need the App 'ArduRemote'. Alternatively, you can use the App 'pfodApp'.

The phone menu includes:

  • Status information (battery voltage, charging current etc.)
  • Settings (Timer etc.)
  • Calibration (Motor, IMU etc.)
  • Remote control (Start/Stop, Switching on/off mower motor, blade modulation etc.)

Bluetooth module

On the robot, you'll need a Bluetooth HC-05 module supporting Bluetooth Serial Port Profile (SPP). SPP uses Bluetooth Service Discovery Protocol (SDP) and the RFCOMM protocol.

Bluetooth HC-05

Wiring:

Bluetooth HC05 VCC --- PCB VCC
Bluetooth HC05 GND --- PCB GND
Bluetooth HC05 TX  --- PCB RX 
Bluetooth HC05 RX  --- PCB TX

For Programming the Module, you must connect the Key Pin from the BT Module to the 3.3 V from the PCB and disconnect after programming.

PC remote control application

We have developed a remote control application for PC (developed in Processing/Java):

  1. Download Windows 32 bit executable (can be run on 64 bit too) and extract it:

https://github.com/Ardumower/ardumower/raw/master/code/Test_und_Entwicklung/processing_remote_binary_win32.zip

  1. Download and install Java runtime: https://java.com/de/download/
  2. Plug-in an USB bluetooth dongle on your PC
  3. In Windows, pair the USB bluetooth dongle with the Ardumower bluetooth module - two new serial ports will be created on your PC (the first for incoming bluetooth connections, the 2nd one for outgoing bluetoth connections)
  4. Run 'processing_remote.exe', all available serial ports will be shown - select the serial port for outgoing connections

Bluetooth module configuration steps

  1. Configuration mode: The Bluetooth module must be in configuration mode for the next step:
    1. for HC05: Connect KEY pin to 3.3V after powering on the module
    2. for HC06/linvor: Do NOT pair/connect (LED must be blinking)
    3. for FBT06/MBTV4: First you have to solder the PIO11 pin to VCC (PIN 12) which is 3.3 Volts using a thin wire.
  2. Baud rate: Blueooth module and Arduino Mega must use the same baud rate (19200) - The baud rate of the BT module can be changed via Ardumower serial console. Connect Ardumower Mega board to your PC (USB), enter the serial console in the Arduino IDE (CTRL+M), and choose baud rate 19200, then choose 'd' to enter the Ardumower menu, '3' for communications menu, and '3' to configure the module to the correct baud rate.
  3. Restart: After your BT module is configured successfully, remove KEY pin connection again (HC05), and restart module.
  4. Pairing: The BT module must be 'paired' with your Android device once (via Android device settings). On the Android device, choose symbol "Settings" (via Android menu). Now choose "Wirless and Networks->Bluetooth Settings" and "Find device". Finally, choose "pair with this device" and enter your pin (very often "1234"). The Bluetooth module should now appear as "paired".
  5. pfodApp: Now you can start pfodApp/ArduRemote to connect to the Ardumower.

Communication protocol

The communication protocol between robot and Android app (the 'pfodSpecification') is defined here: http://www.forward.com.au/pfod/.

All menus (menu items, sliders, buttons) are created inside the robot. The App only visualizes the created menus, and sends back a command if a menu item was clicked by the user.

Example communication:

1. App requests main menu: {.}
2. Robot sends main menu to App: {.title`1000|key1~text1|key2~text2|key3~text3}
   The App will visualize the main menu like this:
   title
   [text1]
   [text2]
   [text3]
3. User clicks menu item 'text1', App sends back to robot the corresponding command: {key1}

You can log the communication to a file (folder 'pfodAppRawData' or 'ArduRemote') on your Android device. For the ArduRemote, press the 'Android menu button' on your device and choose 'Enable logging'.

Sensor logging

For PC data analysis, algorithm modelling and optimization, you can collect robot sensor data using pfodApp like this:

  1. Using your Android pfodApp, connect to your robot and choose 'Log sensors'. The logged sensor data will be displayed. Click 'Back' to stop logging (NOTE: for ArduRemote, press Android menu button before and choose 'Enable logging' to enable file logging).
  2. Connect your Android phone to the PC, if being asked on the phone choose 'Enable as USB device', so you phone shows as a new Windows drive on your PC.
  3. On your PC, launch Windows Explorer and choose the new Android drive, browse to the 'pfodAppRawData' folder (for ArduRemote: 'ArduRemote' folder), and copy the data file to your PC (you can identify files by their Bluetooth name and date).

Videos

  1. menu demo v0.8.8
  2. menu demo live v0.8.8
  3. tutorial video