Bluetooth und App

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

Zusammenfassung

Der Ardumower kann drahtlos überwacht und gesteuert werden:

  • über Handy/Tablet (Android App)
  • über USB Bluetooth Dongle (PC serial console)

Auf den Handy/Tablet benötigst du folgende App 'pfodApp'. alternativ kannst du diese App benutzen 'ArduRemote'.

Das Handy-Menü enthält:

  • Statusinformationen (Akku-Spannungg, Ladestrom usw.)
  • Einstellungen (Timer usw.)
  • Abgleich (Motor, IMU etc.)
  • Fernsteuerung (Start/Stop, Ein/Aus Mähmotor, Messermodulation usw.)

Bluetooth Module

Der Roboter benötigt ein Bluetooth-Modul das das Serial Port Profil (SPP) unterstützt. SPP verwendet das Bluetooth Service Discovery Protocol (SDP) und das RFCOMM protocol. Abhängig von der gefoderten Reichweite kann man unterschiedliche Bluetooth-Klassen verwenden:

  • Bluetooth class 2 (bis ca. 50m Reichweite), z.B. HC03/04/05/06
  • Bluetooth class 1 (bis ca. 100m Reichweite), z.B. BTM220, erfordert eine Zusatzschaltung

Bluetooth HC-05

Das Bluetooth-Modul wird mit 3,3V betrieben. Man benötigt deshalb einen Spannungsteiler an der RX-Leitung und einen PullUp-Widerstand an der TX-Leitung so, wie es in der Schaltung zu sehen ist.

Zur Programmierung wird der Key-Pin des BT-Modules mit 3,3V vom Arduino verbunden und danach die Verbindung wieder getrennt.

Schritte

  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 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.

Kommunikation-Protokoll

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-Protokollierung

See this section

Videos

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