Shop our Airplanes Products Drone Products Sales
Thread Tools
Sep 15, 2012, 09:59 AM
Advanced Monkey
nebstress's Avatar
Quote:
Originally Posted by Endlesslag
Where does that code go? I tried it at the top, bottom, and with the GPS stuff and it won't compile with the initialization code in it.
It needs to be pasted in the "Serial GPS only variables" section, here is a copy of mine, the code you need to add is in blue.

Code:
  calibratingG = 400;
  #if defined(POWERMETER)
    for(uint8_t i=0;i<=PMOTOR_SUM;i++)
      pMeter[i]=0;
  #endif
  #if defined(ARMEDTIMEWARNING)
    ArmedTimeWarningMicroSeconds = (ARMEDTIMEWARNING *1000000);
  #endif
  /************************************/
   
#if defined(GPS_SERIAL)
 
  #if defined(UBLOX)
   UBLOX_init();
   delay(200);
  #endif

#if defined(MTK)
   MTK_init();
   delay(200);
#endif

    SerialOpen(GPS_SERIAL,GPS_BAUD);
Sign up now
to remove ads between posts
Sep 15, 2012, 10:38 AM
Registered User

For a old numpty


Do you just type that details in as per the way you have type it,many thank's,Marty.
Sep 15, 2012, 11:10 AM
Registered User
KevinBuckley70's Avatar

Bluetooth pairing


I am still having a problem getting anything to pair with the Crius BT module. It doesn't stay in 'pairing mode' long enough (see video):

Crius AIOP/BT module - pairing (0 min 30 sec)

If I am really fast I can get a bluetooth scan to find it &, if I am lucky, request a pairing code. But I can't enter the code fast enough to complete the action before the red LED on the BT module stops flashing which I guess means pairing has timed-out?

Is that what it looks like for other users of this module?

I am running MPNG, latest version. But I think the pairing activity happens without any action from the AIOP. I think the BT module does that on its own. Does anyone know if that is correct? Or why my module is behaving this way?
Sep 15, 2012, 11:15 AM
ShopCzar
Endlesslag's Avatar
Still getting a

GPS:478: error: expected declaration before '}' token
On line 479 in your GPS.ino
Sep 15, 2012, 11:17 AM
Advanced Monkey
nebstress's Avatar
Quote:
Originally Posted by KevinBuckley70
I am still having a problem getting anything to pair with the Crius BT module. It doesn't stay in 'pairing mode' long enough (see video):

http://www.youtube.com/watch?v=X6MyqYSmNuE
If I am really fast I can get a bluetooth scan to find it &, if I am lucky, request a pairing code. But I can't enter the code fast enough to complete the action before the red LED on the BT module stops flashing which I guess means pairing has timed-out?

Is that what it looks like for other users of this module?

I am running MPNG, latest version. But I think the pairing activity happens without any action from the AIOP. I think the BT module does that on its own. Does anyone know if that is correct? Or why my module is behaving this way?
When the LED stops flashing it means that it is connected.

You should only have to Pair it once with your PC, after that it will connect automatically.
Sep 15, 2012, 11:23 AM
Advanced Monkey
nebstress's Avatar
Quote:
Originally Posted by Endlesslag
Still getting a

GPS:478: error: expected declaration before '}' token
On line 479 in your GPS.ino

Again, this is a bit more from mine including the code added in blue:
(you might have to delete a line if it appears twice after adding the code)
Code:
  /************************************/
   
#if defined(GPS_SERIAL)
 
  #if defined(UBLOX)
   UBLOX_init();
   delay(200);
  #endif

#if defined(MTK)
   MTK_init();
   delay(200);
#endif

    SerialOpen(GPS_SERIAL,GPS_BAUD);  
    delay(400);  
    for(uint8_t i=0;i<=5;i++){
      GPS_NewData(); 
      LEDPIN_ON
      delay(20);
      LEDPIN_OFF
      delay(80);
    }
    if(!GPS_Present){
      SerialEnd(GPS_SERIAL);
      SerialOpen(0,SERIAL_COM_SPEED);
    }      
    #if !defined(GPS_PROMINI)
      GPS_Present = 1;
    #endif
    GPS_Enable = GPS_Present;    
  #endif
  /************************************/
Sep 15, 2012, 11:24 AM
Registered User
KevinBuckley70's Avatar
Quote:
Originally Posted by nebstress
When the LED stops flashing it means that it is connected.

You should only have to Pair it once with your PC, after that it will connect automatically.
In that video, it was not connected to anything. There were no other BT enabled devices around.
Sep 15, 2012, 11:28 AM
Advanced Monkey
nebstress's Avatar
Quote:
Originally Posted by KevinBuckley70
In that video, it was not connected to anything. There were no other BT enabled devices around.
What was the point in the video then, after you power the BT on you need to open the Mission Planner & Click Connect.
Sep 15, 2012, 11:32 AM
ShopCzar
Endlesslag's Avatar
Quote:
Originally Posted by nebstress
Again, this is a bit more from mine including the code added in blue:
(you might have to delete a line if it appears twice after adding the code)



nope, didn't make a difference, even copying and pasting the whole section.
For now I might just go without the GPS...everything else seems to work fine.
Sep 15, 2012, 11:34 AM
Advanced Monkey
nebstress's Avatar
Quote:
Originally Posted by Endlesslag
nope, didn't make a difference, even copying and pasting the whole section.
For now I might just go without the GPS...everything else seems to work fine.
Have you changed the GPS Baud to 57600 in Config.h?


Code:
#define GPS_SERIAL 2 // should be 2 for flyduino v2. It's the serial port number on arduino MEGA
    #define GPS_BAUD   57600
[EDIT]

What GPS Module are you using?
Last edited by nebstress; Sep 15, 2012 at 11:42 AM.
Sep 15, 2012, 12:15 PM
Registered User
KevinBuckley70's Avatar
Quote:
Originally Posted by nebstress
What was the point in the video then, after you power the BT on you need to open the Mission Planner & Click Connect.
The point of the video was that it is easier to show what the module is doing rather than trying to explain it in words.

It doesn't stay in pairing mode long enough for me to pair it with anything - assuming that red LED flashing means it IS in pairing mode (& that when it stops flashing it is NOT in pairing mode anymore). If I have my BT device already scanning when I apply power to the module, it IS recognised. But then it drops out of pairing before I can get to the point of clicking 'pair with this device'. This is not the usual behaviour of a BT peripheral.

I believe that you can only connect mission planner to a device which has already been paired?
Sep 15, 2012, 12:22 PM
Advanced Monkey
nebstress's Avatar
Quote:
Originally Posted by KevinBuckley70
The point of the video was that it is easier to show what the module is doing rather than trying to explain it in words.

It doesn't stay in pairing mode long enough for me to pair it with anything - assuming that red LED flashing means it IS in pairing mode (& that when it stops flashing it is NOT in pairing mode anymore). If I have my BT device already scanning when I apply power to the module, it IS recognised. But then it drops out of pairing before I can get to the point of clicking 'pair with this device'. This is not the usual behaviour of a BT peripheral.

I believe that you can only connect mission planner to a device which has already been paired?
Yes you are correct "you can only connect mission planner to a device which has already been paired".

Are you sure that it is connected correctly, TX to RX & RX to TX?
Sep 15, 2012, 12:48 PM
Registered User
KevinBuckley70's Avatar
Quote:
Originally Posted by nebstress
Yes you are correct "you can only connect mission planner to a device which has already been paired".

Are you sure that it is connected correctly, TX to RX & RX to TX?
Yes. You can see from the colours of the wire (and Black/Brown on the AIOP are connected together to Black on the BT module).

EDIT: Whoops - scratch that. The image doesnt help as the colours are swapped where they join!
Sep 15, 2012, 12:58 PM
Advanced Monkey
nebstress's Avatar
Quote:
Originally Posted by KevinBuckley70
Yes. You can see from the colours of the wire (and Black/Brown on the AIOP are connected together to Black on the BT module).

EDIT: Whoops - scratch that. The image doesnt help as the colours are swapped where they join!
You say "Black/Brown on the AIOP are connected together to Black"

You only need 4 connections to the CRIUS AIOP, TX, RX, VCC & GND, you can remove the other two wires from the '6 way molex' connector.
Sep 15, 2012, 01:04 PM
Registered User
KevinBuckley70's Avatar
Quote:
Originally Posted by nebstress
You say "Black/Brown on the AIOP are connected together to Black"

You only need 4 connections to the CRIUS AIOP, TX, RX, VCC & GND, you can remove the other two wires from the '6 way molex' connector.
Yes. I guess there is no harm from doubling-up the two grounds though? I did it that way so that, if I need that connector for something else in the future, it still has also it's wires!

Better image attached.


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Mini-HowTo Arduino and HobbyKing Multi-Rotor Control Board V3.0 or KKmulticontroller v5.5 pprioverde Multirotor Drone Talk 33 May 28, 2017 11:40 AM
Discussion New updated Crius Multiwii SE flight controller SGsoar Multirotor Drone Electronics 72 May 15, 2013 08:36 PM
Discussion Jim, any plans for more multi rotor flight controller? chris24g Xtreme Power Systems 12 Jun 25, 2012 08:11 PM
Sold One New, one used ArduPilot 2560 APM1.0 Flight Controlls/autopilots wingspinner FPV Equipment (FS/W) 3 May 28, 2012 12:55 AM
Question Quad Build Using HobbyKing Multi-Rotor Control Board V3.0 (Atmega328 PA) SJackson Multirotor Drone Talk 27 Apr 30, 2012 08:51 PM