Page 1 sur 1

Bluetooth et nanowii

Posté : jeu. 6 nov. 2014 13:15
par Malik77
Bonjour,
J'envisage de connecter mes nanowii en bluetooth avec le modul Hk, plus simple pour régler les PID avec son phone, mais je cherche un tuto ou
si quelqu'un à déjà réalisé les connections. J'ai un doute sur les branchements.
Merci

Re: Bluetooth et nanowii

Posté : jeu. 6 nov. 2014 13:52
par Ticasso
Lo,

Regardes ce document
ça se trouve dans les fichiers liés à la nanowii chez Hk

En espérant que cela puisse t'aider.
@+

Re: Bluetooth et nanowii

Posté : jeu. 6 nov. 2014 14:18
par Malik77
Merci, cela confirme les premières info que j'ai trouvé.
@++

Re: Bluetooth et nanowii

Posté : jeu. 6 nov. 2014 14:23
par Tomdu38
Salut,
Très simplement

Côté Nanowii => Bluetooth

+5V => +5V
GND => GND
TX => RX
RX => TX


Sur la Nanowii (doc nanowii hk .pdf (cf Google)), c'est au niveau du connecteur blanc que tu as +5V, GND et RX (spek.sat sur la doc)
La pin TX est sur le côté.

A+

Re: Bluetooth et nanowii

Posté : jeu. 6 nov. 2014 14:32
par Malik77
Merci Tom,
Tiens justement, c'est pour peaufiner les réglage de mon tri HK.
Bon, je vais souder et tester.
Merci @++

Re: Bluetooth et nanowii

Posté : jeu. 6 nov. 2014 19:45
par Tomdu38
Re,

Fait nous un retour si tout marche comme il faut !

A+

Re: Bluetooth et nanowii

Posté : jeu. 6 nov. 2014 19:53
par Malik77
ok, pour l'instant j'ai juste mis l'appli sur mon phone. Ce week je teste.
Merci @++

Re: Bluetooth et nanowii

Posté : sam. 8 nov. 2014 17:20
par Malik77
Hello, alors connexion bluetooth ok, mais le programme reçois aucune info.
J'ai chargé deux programme pour tester, le premier Naze32 configuration, rien, alors j'ai testé avec Multiwii EZ pour Gui, rien. il y divers programmes sur play store ? :pascontent:
Savez-vous quel programme je dois prendre pour communiquer avec une nano ?? :gene2:
Merci

Re: Bluetooth et nanowii

Posté : sam. 8 nov. 2014 17:30
par Jean des Biolles
Salut, contrôle tes connections. RX - TX croisé. Même baud rate pour le port série de la fc ( se règle dans le config.h) et le module BT.

Jo

Re: Bluetooth et nanowii

Posté : sam. 8 nov. 2014 17:47
par Malik77
Merci, mais excuse, je comprend pas 8| le passage : Même baud rate pour le port série de la fc ( se règle dans le config.h) et le module BT. Pour les connection RX-TX
croisé ok.
Merci

Re: Bluetooth et nanowii

Posté : sam. 8 nov. 2014 20:09
par Jean des Biolles
Le baud rate est la vitesse a lequel les port serie travaillent. si ton module bluetooth ne travail pas à la même vitesse que le port du contrôleur de vole la communication ne se fait pas. Mais cela ne t'empèche pas de te connecter au module via bluetooth, la communication est just bloquée entre le module et la FC.
Dans le config.h cherche ces lignes:

Code : Tout sélectionner

 
 /******                Serial com speed    *********************************/
    /* This is the speed of the serial interfaces */    /* This is the speed of the serial interfaces */
    /* This is the speed of the serial interfaces */
    /* This is the speed of the serial interfaces */

    #define SERIAL0_COM_SPEED 115200
    #define SERIAL1_COM_SPEED 115200
    #define SERIAL2_COM_SPEED 38400
    #define SERIAL3_COM_SPEED 57600

Chez moi le module bluetooth est branché sur le port 2. Avec la nanowii c'est peut-être différent.
Tu peux peut-être trouver la vitesse du module bluetooth chez le fabricant ou le revendeur ou sur la doc.
Tu peut aussi changer la vitesse du port serie du module, mais il te faut un ftdi.

Lorsque j'avais fait des recherche pour configurer mon multi j'ai recopier un peu d'aide dans un document. je le partage ici, si cela pose problème dite le moi.
Connect the FTDI USB Adaptor to a PC. The BT adaptor should now be powered with a blinking red led. Before using it with an Arduino running muliwii software, the baud rate of the BT adaptor has to be changed to 115200 from the default 9600. Now this is the part that stumped me for ages and sent me off looking up forums, updating bluetooth stacks etc etc until I figured out what I was doing wrong. To configure the BT adaptor, you need it physically connected to the PC via the FTDI USB adaptor but you don't want to connect the PC to the BT adaptor .... yet. The BT adaptor can only be configured when it's in an un-connected state. In your "Bluetooth Places" you should be able to see the device (by default called "Linvor") but it should show "not connected") and the red light should be flashing on the BT adaptor.
I used Advanced Serial Port Terminal to connect to FTDI USB. The AT commands must be copy and pasted to send to the device because it constantly polls and if you can't type fast enough to complete a command before it reads it in.
Send the "AT" command. BT responds with "OK"
Send "AT+NAMEMultiWiiCopter" to change the default from Linvor.
Send "AT+BAUD8" to change the Baud rate to 115200.
Now connect to the Arduino as per the connections in the table above.
Run the MultiWiiConf software and choose the BT COM port.
Now you can fly around and see the gyro and accelerometer inputs change while in flight!
I found a page with quite a lot of detailed information on the BT adaptor during my searches. While it's native language looks Chinese, the Google Chrome browser seems to do a pretty good job translating it.

Change the Baudrate

The example below shows how to set the baudrate to 4800 bps

Send the command (case sensitive!)

AT+BAUD3

the Bluetooth will reply:

OK4800

As shown in the figure below



Now, since the Baudrate of the Bluetooth has been changed, you need to change the Baudrate of the terminal program to 4800 in order to talk to the Bluetooth again.

The index after the command AT+BAUD corresponds to the following Baudrate:

1----1200bps
2----2400bps
3----4800bps
4----9600bps
5----19200bps
6----38400bps
7----57600bps
8----115200bps
9----230400bps
A----460800bps
B----921600bps
C----1382400bps

The change of Baudrate takes effect immediately after the command is sent. So if you want to keep configuring the Bluetooth module, you need to set the Baudrate of your terminal program to the new Baudrate the Bluetooth is using. To test it, send AT again, you should receive 'OK'.

NOTE: some MAX 232 chips cannot work reliably for Baudrates faster than 115200bps, therefore, we don't recommend to set the Bluetooth to a Baudrate that is faster than 115200bps.



Change name

This example show you how to change the name of the Bluetooth module to hobbyist:

In the terminal program, send the command (case sensitive):

AT+NAMEhobbyist

The Bluetooth should reply:

OKsetname

as shown in the figure below



The Bluetooth needs to be reboot (power off then on) for the name to be changed

Please note that the length of the name cannot exceed 20 characters!



Change pairing code

The following example shows how to change the pairing code to 5566

In the terminal program, send the command (case sensitive):

AT+PIN5566

The Bluetooth should reply:

OKsetPIN

as shown in the figure below



The change of pairing code takes effect immediately.
Voilà, j'espère que cela t'aidera :super:

Jo

Re: Bluetooth et nanowii

Posté : dim. 9 nov. 2014 09:30
par Malik77
Merci Jo, :super:
extra les explications, je vais chercher dans ce sens.
-m- Malik