Bluetooth und App: Unterschied zwischen den Versionen

Aus www.wiki.ardumower.de
Wechseln zu: Navigation, Suche
(Bluetooth Module)
(Die Schritte im Einzelnen)
 
(21 dazwischenliegende Versionen von 3 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
 
=Zusammenfassung=
 
=Zusammenfassung=
 +
 +
[[File: Pfodapp_menu.png | 600px]]
 +
 
Der Ardumower kann drahtlos überwacht und gesteuert werden:
 
Der Ardumower kann drahtlos überwacht und gesteuert werden:
 
* über Handy/Tablet (Android App)
 
* über Handy/Tablet (Android App)
 
* über USB Bluetooth Dongle (PC serial console)
 
* über USB Bluetooth Dongle (PC serial console)
  
Auf den Handy/Tablet benötigst du folgende App [https://play.google.com/store/apps/details?id=au.com.forward.pfodApp 'pfodApp']. alternativ kannst du diese App benutzen [https://play.google.com/store/apps/details?id=de.grauonline.arduremote 'ArduRemote'].
+
Auf den Handy/Tablet benötigst du folgende App [https://play.google.com/store/apps/details?id=de.grauonline.arduremote 'ArduRemote']. alternativ kannst du diese App benutzen [https://play.google.com/store/apps/details?id=au.com.forward.pfodApp 'pfodApp'].
  
 
Das Handy-Menü enthält:
 
Das Handy-Menü enthält:
Zeile 21: Zeile 24:
  
 
=Bluetooth Module=
 
=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:
+
Am Roboter wird das Bluetooth-Modul HC-05 verwendet, welches das das Serial Port Profil (SPP) unterstützt. SPP verwendet das Bluetooth Service Discovery Protocol (SDP) und das RFCOMM protocol.
 
+
*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=
 
=Bluetooth HC-05=
  
 
<gallery>
 
<gallery>
File: Bluetooth_module.jpg | HC-05 module
+
File: Pcb_bluetooth.jpg | PCB and HC-05 module
File: HC-05 schematics.jpg | HC-05 schematics
+
File: Bluetooth_module.jpg | HC-05 Modul
 +
File: HC-05 schematics.jpg | HC-05 Schaltung
 +
File: HC-05.gif | HC-05 mit Taster
 
</gallery>
 
</gallery>
  
The Bluetooth Module will run at 3.3V, you need a voltage divider for RX line and an Pullup Resistor for the TX Line, like showing in Circuit.
+
Zur Programmierung wird der Key-Pin des BT-Modules mit 3,3V vom Arduino verbunden und danach die Verbindung wieder getrennt.
  
For Programming the Module, you must connect the Key Pin from the BT Module, to the 3,3 V from the Arduino and disconect after.
+
Wiring:
  
=Schritte=
+
Bluetooth HC05 VCC --- PCB VCC
# Configuration mode: The Bluetooth module must be in configuration mode for the next step:
+
Bluetooth HC05 GND --- PCB GND
## for HC05:          Connect KEY pin to 3.3V after powering on the module
+
Bluetooth HC05 TX  --- PCB RX
## for HC06/linvor:    Do NOT pair/connect (LED must be blinking)
+
Bluetooth HC05 RX  --- PCB TX
## for FBT06/MBTV4:    First you have to solder the PIO11 pin to VCC (PIN 12) which is 3.3 Volts using a thin wire.
+
 
# 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.
+
Besonderheiten: Je nach Lieferant wird das HC-05 Modul mit 5 Volt VCC betrieben; Aufschrift "Power 3.6-6V"(JP 8 anstelle von JP 9 setzen). Sofern sich am Pin "EN" ein Microtaster befindet (siehe Foto), so muss dieser während der Konfiguration gedrückt sein, da ansonsten das Modul nicht erkannt wird. Key-Pin muss wie beschrieben auf +3,3 Volt gesetzt sein (JP 2). Rx/Tx laufen auch hier mit 3,3 Volt.
# Restart: After your BT module is configured successfully, remove KEY pin connection again (HC05), and restart module.
+
 
# 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".
+
=Die Schritte im Einzelnen=
# pfodApp: Now you can start pfodApp/ArduRemote to connect to the Ardumower.
+
# Konfigurationsmodus: Das Bluetooth-Modul muss für die nächsten Schritte im Konfigurationsmodus sein:
 +
## für HC05:          Nachdem das Modul an die Betriebsspannung angeschlossen wurde, verbinde den KEY-Pin mit 3,3V
 +
## für HC06/linvor:    nicht paaren/verbinden (LED muss blinken)
 +
## für FBT06/MBTV4:    Zuerst muss ein dünner Draht von Pin PIO11 nach VCC (PIN 12)das sind 3.3 Volt gelötet werden.
 +
# Baudrate: Das Bluetooth-Modul und der Arduino Mega müssen die gleiche Baudrate (19200) verwenden - Die Baudrate des Bluetooth-Modules kann über die serielle Konsole des Ardumowers geändert werden. Verbinde das Ardumower Mega Board mit deinem PC (USB), gehe in die serielle Konsole in der Arduino IDE (Strg+M), und wähle dort Baudrate 19200, dann drücke Taste 'd' um ins Ardumower-Menü zu gelangen, dann Taste '3' for Kommunikationsmenü, dann Taste '3' um die richtige Baudrate für das BT-Modul einzustellen.
 +
# Neustart: Nachdem das BT-Modul erfolgreich konfiguriert wurde, muss die Verbindung des KEY-Pins zu 3,3V wieder getrennt werden (HC05). Danach startet man das Modul neu.
 +
# Pairing: Das BT-Modul muss dem Handy oder Tablet (über Android/Einstellungen) bekanntgemacht werden. Diesen Vorgang nennt man Pairing. Wähle auf dem Android-Gerät das Symbol "Einstellungen" (über Android Menü). Nun wähle "Drahtlos und Netzwerke/Bluetooth->Bluetooth Einstellungen" und "Finde Gerät(Scannen)". Wurde der Ardumower in der Liste der gefundenen Geräte angezeigt, wählt man ihn aus und sagt dann -verbinden-. Nach der Eingabe der Sicherheits-PIN (als Vorgabe "1234"), sollte das  Bluetooth-Modul des Arduino mit dem Handy gepaart sein (paired).
 +
# pfodApp: Jetzt kann die APP pfodApp/ArduRemote gestartet werden und sich mit dem Ardumower verbinden.
 +
# Nach erfolgreichem Verbinden leuchtet die Diode D8.
  
 
=Kommunikation-Protokoll=
 
=Kommunikation-Protokoll=
The communication protocol between robot and Android app (the 'pfodSpecification') is defined here: http://www.forward.com.au/pfod/.
+
Das Kommunikation-Protokoll für die Verbindung zwischen Roboter und Androis-App (die 'pfodSpecification') ist hier definiert: 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.
+
Alle Menüs (Menüpunkte, Schieberegler, Taster) werden innerhalb der Robotersoftware definiert. Die App stellt die kreierten Menüs nur dar und sendet einen Befehl zurück, wenn ein Menüpunkt durch den Benutzer angeklickt wurde.
  
Example communication:
+
Beispiel Kommunikation:
  
  1. App requests main menu: {.}
+
  1. App verlangt das Hauptmenü: {.}
  2. Robot sends main menu to App: {.title`1000|key1~text1|key2~text2|key3~text3}
+
  2. Roboter sendet Hauptmenü zur App: {.title`1000|key1~text1|key2~text2|key3~text3}
     The App will visualize the main menu like this:
+
     Die App stellt das Hauptmenü wie folgt dar:
  
 
     title
 
     title
Zeile 63: Zeile 73:
 
     [text3]
 
     [text3]
  
  3. User clicks menu item 'text1', App sends back to robot the corresponding command: {key1}
+
  3. Der Benutzer klickt den Menüpunkt 'text1' an, die App sendetden entsprechenden Befehl {key1} zurück
  
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'.
+
Man kann die Kommunikation protokollieren und in einer Datei auf dem Handy/Tablet speichern (Ordner 'pfodAppRawData' or 'ArduRemote'). In ArduRemote, muss man noch die 'Android Menütaste' drücken und  'Enable logging' wählen.
  
 
<gallery>
 
<gallery>
   File: Android_menu_button.png | Android menu button
+
   File: Android_menu_button.png | Android Menütaste
 
</gallery>
 
</gallery>
  
 
=Sensor-Protokollierung=
 
=Sensor-Protokollierung=
[http://wiki.ardumower.de/index.php?title=Sensor_fusion#Sensor_logging See this section]
+
For PC data analysis, algorithm modelling and optimization, you can collect robot sensor data using pfodApp like this:
 +
 
 +
# 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).
 +
# 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.
 +
# 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).
 +
 
 +
<gallery>
 +
File: Pfodapp_start.png | 1. Start pfodApp
 +
File: Pfodapp_log_sensors.png | 2. Choose 'Log sensors'
 +
File: Pfodapp_log_sensors_exit.png | 3. Choose phone back button or 'Exit'
 +
File: Android_enable_usb device.png | 4. Connect to your PC via USB, choose 'Enable as USB device'
 +
File: log_sensor.png | 5. Using Windows explorer, browse to folder 'pfodAppRawData' on external Android drive to access sensor log file
 +
</gallery>
  
 
=Videos=
 
=Videos=

Aktuelle Version vom 6. April 2017, 09:51 Uhr

Zusammenfassung

Pfodapp menu.png

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 'ArduRemote'. alternativ kannst du diese App benutzen 'pfodApp'.

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

Am Roboter wird das Bluetooth-Modul HC-05 verwendet, welches das das Serial Port Profil (SPP) unterstützt. SPP verwendet das Bluetooth Service Discovery Protocol (SDP) und das RFCOMM protocol.

Bluetooth HC-05

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

Wiring:

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

Besonderheiten: Je nach Lieferant wird das HC-05 Modul mit 5 Volt VCC betrieben; Aufschrift "Power 3.6-6V"(JP 8 anstelle von JP 9 setzen). Sofern sich am Pin "EN" ein Microtaster befindet (siehe Foto), so muss dieser während der Konfiguration gedrückt sein, da ansonsten das Modul nicht erkannt wird. Key-Pin muss wie beschrieben auf +3,3 Volt gesetzt sein (JP 2). Rx/Tx laufen auch hier mit 3,3 Volt.

Die Schritte im Einzelnen

  1. Konfigurationsmodus: Das Bluetooth-Modul muss für die nächsten Schritte im Konfigurationsmodus sein:
    1. für HC05: Nachdem das Modul an die Betriebsspannung angeschlossen wurde, verbinde den KEY-Pin mit 3,3V
    2. für HC06/linvor: nicht paaren/verbinden (LED muss blinken)
    3. für FBT06/MBTV4: Zuerst muss ein dünner Draht von Pin PIO11 nach VCC (PIN 12)das sind 3.3 Volt gelötet werden.
  2. Baudrate: Das Bluetooth-Modul und der Arduino Mega müssen die gleiche Baudrate (19200) verwenden - Die Baudrate des Bluetooth-Modules kann über die serielle Konsole des Ardumowers geändert werden. Verbinde das Ardumower Mega Board mit deinem PC (USB), gehe in die serielle Konsole in der Arduino IDE (Strg+M), und wähle dort Baudrate 19200, dann drücke Taste 'd' um ins Ardumower-Menü zu gelangen, dann Taste '3' for Kommunikationsmenü, dann Taste '3' um die richtige Baudrate für das BT-Modul einzustellen.
  3. Neustart: Nachdem das BT-Modul erfolgreich konfiguriert wurde, muss die Verbindung des KEY-Pins zu 3,3V wieder getrennt werden (HC05). Danach startet man das Modul neu.
  4. Pairing: Das BT-Modul muss dem Handy oder Tablet (über Android/Einstellungen) bekanntgemacht werden. Diesen Vorgang nennt man Pairing. Wähle auf dem Android-Gerät das Symbol "Einstellungen" (über Android Menü). Nun wähle "Drahtlos und Netzwerke/Bluetooth->Bluetooth Einstellungen" und "Finde Gerät(Scannen)". Wurde der Ardumower in der Liste der gefundenen Geräte angezeigt, wählt man ihn aus und sagt dann -verbinden-. Nach der Eingabe der Sicherheits-PIN (als Vorgabe "1234"), sollte das Bluetooth-Modul des Arduino mit dem Handy gepaart sein (paired).
  5. pfodApp: Jetzt kann die APP pfodApp/ArduRemote gestartet werden und sich mit dem Ardumower verbinden.
  6. Nach erfolgreichem Verbinden leuchtet die Diode D8.

Kommunikation-Protokoll

Das Kommunikation-Protokoll für die Verbindung zwischen Roboter und Androis-App (die 'pfodSpecification') ist hier definiert: http://www.forward.com.au/pfod/.

Alle Menüs (Menüpunkte, Schieberegler, Taster) werden innerhalb der Robotersoftware definiert. Die App stellt die kreierten Menüs nur dar und sendet einen Befehl zurück, wenn ein Menüpunkt durch den Benutzer angeklickt wurde.

Beispiel Kommunikation:

1. App verlangt das Hauptmenü: {.}
2. Roboter sendet Hauptmenü zur App: {.title`1000|key1~text1|key2~text2|key3~text3}
   Die App stellt das Hauptmenü wie folgt dar:
   title
   [text1]
   [text2]
   [text3]
3. Der Benutzer klickt den Menüpunkt 'text1' an, die App sendetden entsprechenden Befehl {key1} zurück

Man kann die Kommunikation protokollieren und in einer Datei auf dem Handy/Tablet speichern (Ordner 'pfodAppRawData' or 'ArduRemote'). In ArduRemote, muss man noch die 'Android Menütaste' drücken und 'Enable logging' wählen.

Sensor-Protokollierung

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