OpenXSensor GPS project 101

Development & General Chat for the superb openxvario project.

Moderator: rainer

Richard
Posts: 183
Joined: Sat Mar 29, 2014 10:44 pm
Country: United States
Location: Coral Springs, FL

OpenXSensor GPS project 101

Post by Richard »

I quite new to openXsensor and I am ready to start a DIY project to replace FrSky GPS with a more precise, and faster device.
Following suggestions from experts in this forum, the replacement will be an system implemented with an Arduino board and a Ublox GPS.
Therefore, my first step was to put together a shopping list, which is open to suggestions, just in case I got the advises all wrong.

Arduino nano.
Ublox NEO 7M
FTDI USB to serial converter

I think this is all in the hardware side. (do I need another cable to configure the NEO?). Now, I am really confused about the NEO device. I have seen the NEO 7M for specific boards, but no one for the pro mini. Therefore, I need on this one a link to the specific device I need to buy.
Couple of other questions:
1) Given that the nano board has a USB jack, I assume that the FTDI cable is used to connect it to the PC for fw or scripts. This means that I have to have an RS 232 DB9 connector in my PC? How do I hook up the board to a USB in my computer? Or otherwise what kind of cable do I need?
2) Is there a schematics showing the connections between the nano and the NEO 7M?
3) I understand that one the NEO losses power, it goes back to the default configuration. Is there anyway to auto upload the configuration each time the unit is powered on? (if yes, we will go to the details when I start to deal with the fw, unless additional hw is required).
Thanks for your help in advance.
Richard

User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: OpenXSensor GPS project 101

Post by jhsa »

It's not a FTDI Cable.. It is an FTDI Adapter.. It's a USB serial adapter
If you have the Arduino Nano, it should already have the FTDI chip on it. You just connect it to the PC via USB.
Some Nanos have another chip instead, but it should work the same..

The Arduino Pro Mini doesn't have it, so you would need one.

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor GPS project 101

Post by mstrens »

An arduino nano has already a converter usb/serial. So there is no need for a FTDI.

With openXsensor (oXs) there is no need to configure the neo7M (or the neo6 or neo8) because at every startup oXs assume that the gps uses the default configuration from Ublox and send some code to the gps to upload the config required by oXs it self.

I would recommend to use an arduino pro mini instead of a nano because with the nano it could be that there would be some conflict on the Tx/Rx pins (not sure about this).

For more explanation on how to setup oXs, please read the file oXs_config_description.h that is available on github with the whole package.
The rate of the GPS can be changed editing the file oXs_gps.cpp.
One of the 3 folowing lines must be uncommented (here 5 hz is uncommented)
// 0xB5,0x62,0x06,0x08,0x06,0x00,0xE8,0x03,0x01,0x00,0x01,0x00,0x01,0x39, // NAV-RATE for 1 hz
0xB5,0x62,0x06,0x08,0x06,0x00,0xC8,0x00,0x01,0x00,0x01,0x00,0xDE,0x6A, // NAV-RATE for 5 hz
// 0xB5,0x62,0x06,0x08,0x06,0x00,0x64,0x00,0x01,0x00,0x01,0x00,0x7A,0x12, // NAV-RATE for 10 hz
Carbo
Posts: 467
Joined: Fri Aug 02, 2013 6:55 pm
Country: Germany
Location: Freinsheim RP

Re: OpenXSensor GPS project 101

Post by Carbo »

A quick overview:
(detailed description: please read the file oXs_config_description.h that is available on github with the whole package)

Hardware:

Arduino pro mini 328 5V
FTDI USB-UART adaptor
Ublox GPS M6N, or M7N or recommended today M8N

Connections:
Receiver GND --> Arduino GND
Receiver VCC --> Arduino VCC (max. 5.5V !)
SPort --> Arduino PIN 4

GPS RX --> resistor 10k --> Arduino PIN 6
GPS TX --> Arduino RX
GPS VCC --> Arduino VCC (do not exceed 5.5V!)
GPS GND --> Arduino GND

Software: Arduino IDE and eventually notepad++ to edit the config files (advanced users)

Flashing the Arduino without soldering: Plug the USB-UART adaptor pins in the corresponding holes of the Arduino and apply some pressure. The weight of the USB cable is usually enough to ensure a safe contact:
oXs_FTDI.jpg
oXs sketch for a 10Hz SPort GPS with 3d GPS speed, (the one, i used for the delay test):
openXsensor.zip
(218.38 KiB) Downloaded 493 times
From oXs_config_description.h: "So, when you connect the usb to serial adapter to the Arduino, you should disconnect at least the GPS TX pin from the Arduino Rx pin" There is a little risk of damaging the GPS when flashing! Or disconnect GPS completely, if you use a 4pin connector.

Doubleclick on openXsensor.ino in the extracted openXsensor folder to start the Arduino IDE, select the Arduino pro mini board and the COM-port of your USB-UART in the tools-tab, connect the Arduino and hit the --> upload button.

Connect the oXs GPS to your SPort RX, wait for a satellite fix (about 1 min outside) and search sensors in OpenTX. Eventually change the GPS speed unit in the telemetry tab.
Raythegreat
Posts: 284
Joined: Sat Apr 16, 2016 11:33 pm
Country: -

Re: OpenXSensor GPS project 101

Post by Raythegreat »

Thanks Carbo

RTG

mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor GPS project 101

Post by mstrens »

FYI, Carbo can also confirm that oXs can support a GPS with an Arduino nano (and so not only with the pro mini)
Richard
Posts: 183
Joined: Sat Mar 29, 2014 10:44 pm
Country: United States
Location: Coral Springs, FL

Re: OpenXSensor GPS project 101

Post by Richard »

Carbo wrote: Sun Sep 03, 2017 10:36 am A quick overview:
(detailed description: please read the file oXs_config_description.h that is available on github with the whole package)

Hardware:

Arduino pro mini 328 5V
FTDI USB-UART adaptor
Ublox GPS M6N, or M7N or recommended today M8N

Connections:
Receiver GND --> Arduino GND
Receiver VCC --> Arduino VCC (max. 5.5V !)
SPort --> Arduino PIN 4

GPS RX --> resistor 10k --> Arduino PIN 6
GPS TX --> Arduino RX
GPS VCC --> Arduino VCC (do not exceed 5.5V!)
GPS GND --> Arduino GND

Software: Arduino IDE and eventually notepad++ to edit the config files (advanced users)

Flashing the Arduino without soldering: Plug the USB-UART adaptor pins in the corresponding holes of the Arduino and apply some pressure. The weight of the USB cable is usually enough to ensure a safe contact:

oXs_FTDI.jpg

oXs sketch for a 10Hz SPort GPS with 3d GPS speed, (the one, i used for the delay test):

openXsensor.zip

From oXs_config_description.h: "So, when you connect the usb to serial adapter to the Arduino, you should disconnect at least the GPS TX pin from the Arduino Rx pin" There is a little risk of damaging the GPS when flashing! Or disconnect GPS completely, if you use a 4pin connector.

Doubleclick on openXsensor.ino in the extracted openXsensor folder to start the Arduino IDE, select the Arduino pro mini board and the COM-port of your USB-UART in the tools-tab, connect the Arduino and hit the --> upload button.

Connect the oXs GPS to your SPort RX, wait for a satellite fix (about 1 min outside) and search sensors in OpenTX. Eventually change the GPS speed unit in the telemetry tab.
Carbo, I opened the IDE from the openXsensor.zip and I got a number or errors (Be aware I did not connect the FTDI/ProMini), as follows:

#if ! defined(PROTOCOL)
#error The parameter PROTOCOL in config_basic.h is not defined
#elif ! ( (PROTOCOL == FRSKY_SPORT) or (PROTOCOL == FRSKY_HUB) or (PROTOCOL == FRSKY_SPORT_HUB) or (PROTOCOL == HOTT) or (PROTOCOL == MULTIPLEX) or (PROTOCOL == JETI))
#error The parameter PROTOCOL in config_basic.h is NOT valid
#endif

#if defined(VARIO) and (! defined(VSPEED_SOURCE))
#error The parameter VSPEED_SOURCE in config_basic.h is not defined while a type of baro sensor is defined
#elif defined(VARIO) and defined(VSPEED_SOURCE) and ( ! ( (VSPEED_SOURCE == FIRST_BARO) or (VSPEED_SOURCE == SECOND_BARO) or (VSPEED_SOURCE == AVERAGE_FIRST_SECOND) \
or (VSPEED_SOURCE == AIRSPEED_COMPENSATED) or (VSPEED_SOURCE == BARO_AND_IMU) or (VSPEED_SOURCE == PPM_SELECTION) ) )
#error The parameter VSPEED_SOURCE in config_basic.h is NOT valid
#endif

#if defined( PIN_CURRENTSENSOR ) and defined(ADS_MEASURE) and defined(ADS_CURRENT_BASED_ON)
#error It is not allowed to ask for current calculation based both on arduino Adc and on ads1115; define only or PIN_CURRENTSENSOR or ADS_CURRENT_BASED_ON
#endif

#if defined (PIN_PPM ) && defined ( USE_6050 ) && ( PIN_INT_6050 == PIN_PPM )
#error Error in oXs_config_advanced.h : PIN_PPM may not be equal to PIN_INT_6050
#endif

#if defined( VFAS_SOURCE ) && ( ! ( ( VFAS_SOURCE == VOLT_1) || ( VFAS_SOURCE == VOLT_2) || ( VFAS_SOURCE == VOLT_3) || ( VFAS_SOURCE == VOLT_4) || ( VFAS_SOURCE == VOLT_5) || ( VFAS_SOURCE == VOLT_6) || ( VFAS_SOURCE == ADS_VOLT_1) || ( VFAS_SOURCE == ADS_VOLT_2) || ( VFAS_SOURCE == ADS_VOLT_3) || ( VFAS_SOURCE == ADS_VOLT_4)) )
#error When defined, VFAS_SOURCE must be one of following values VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6, ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4
#endif
#if defined( FUEL_SOURCE ) && ( ! ( ( FUEL_SOURCE == VOLT_1) || ( FUEL_SOURCE == VOLT_2) || ( FUEL_SOURCE == VOLT_3) || ( FUEL_SOURCE == VOLT_4) || ( FUEL_SOURCE == VOLT_5) || ( FUEL_SOURCE == VOLT_6) || ( VFAS_SOURCE == ADS_VOLT_1) || ( VFAS_SOURCE == ADS_VOLT_2) || ( VFAS_SOURCE == ADS_VOLT_3) || ( VFAS_SOURCE == ADS_VOLT_4)) )
#error When defined, FUEL_SOURCE must be one of following values VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6, ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4
#endif
#if defined( A3_SOURCE ) && ( ! ( ( A3_SOURCE == VOLT_1) || ( A3_SOURCE == VOLT_2) || ( A3_SOURCE == VOLT_3) || ( A3_SOURCE == VOLT_4) || ( A3_SOURCE == VOLT_5) || ( A3_SOURCE == VOLT_6) || ( A3_SOURCE == ADS_VOLT_1) || ( A3_SOURCE == ADS_VOLT_2) || ( A3_SOURCE == ADS_VOLT_3) || ( A3_SOURCE == ADS_VOLT_4) ) )
#error When defined, A3_SOURCE must be one of following values VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6, ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4
#endif
#if defined( A4_SOURCE ) && ( ! ( ( A4_SOURCE == VOLT_1) || ( A4_SOURCE == VOLT_2) || ( A4_SOURCE == VOLT_3) || ( A4_SOURCE == VOLT_4) || ( A4_SOURCE == VOLT_5) || ( A4_SOURCE == VOLT_6) || ( A3_SOURCE == ADS_VOLT_1) || ( A3_SOURCE == ADS_VOLT_2) || ( A3_SOURCE == ADS_VOLT_3) || ( A3_SOURCE == ADS_VOLT_4) ) )
#error When defined, A4_SOURCE must be one of following values VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6, ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4
#endif
#if defined( ACCX_SOURCE ) && ( ! ( ( ACCX_SOURCE == VOLT_1) || ( ACCX_SOURCE == VOLT_2) || ( ACCX_SOURCE == VOLT_3) || ( ACCX_SOURCE == VOLT_4) || ( ACCX_SOURCE == VOLT_5) || ( ACCX_SOURCE == VOLT_6) \
|| ( ACCX_SOURCE == ADS_VOLT_1) || ( ACCX_SOURCE == ADS_VOLT_2) || ( ACCX_SOURCE == ADS_VOLT_3) || ( ACCX_SOURCE == ADS_VOLT_4) \
|| ( ACCX_SOURCE == TEST_1) || ( ACCX_SOURCE == TEST_2) || ( ACCX_SOURCE == TEST_3) || ( ACCX_SOURCE == GLIDER_RATIO) || ( ACCX_SOURCE == SECONDS_SINCE_T0) || ( ACCX_SOURCE == AVERAGE_VSPEED_SINCE_TO) || ( ACCX_SOURCE == PITCH) || ( ACCX_SOURCE == ROLL) || ( ACCX_SOURCE == YAW) ) )
#error When defined, ACCX_SOURCE must be one of following values TEST_1, TEST_2, TEST_3, GLIDER_RATIO , SECONDS_SINCE_T0 ,AVERAGE_VSPEED_SINCE_TO , VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6, ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4, PITCH, ROLL, YAW
#endif
#if defined( ACCY_SOURCE ) && ( ! ( ( ACCY_SOURCE == VOLT_1) || ( ACCY_SOURCE == VOLT_2) || ( ACCY_SOURCE == VOLT_3) || ( ACCY_SOURCE == VOLT_4) || ( ACCY_SOURCE == VOLT_5) || ( ACCY_SOURCE == VOLT_6) \
|| ( ACCY_SOURCE == ADS_VOLT_1) || ( ACCY_SOURCE == ADS_VOLT_2) || ( ACCY_SOURCE == ADS_VOLT_3) || ( ACCY_SOURCE == ADS_VOLT_4) \
|| ( ACCY_SOURCE == TEST_1) || ( ACCY_SOURCE == TEST_2) || ( ACCY_SOURCE == TEST_3) || ( ACCY_SOURCE == GLIDER_RATIO) || ( ACCY_SOURCE == SECONDS_SINCE_T0) || ( ACCY_SOURCE == AVERAGE_VSPEED_SINCE_TO) || ( ACCY_SOURCE == PITCH) || ( ACCY_SOURCE == ROLL) || ( ACCY_SOURCE == YAW) ) )
#error When defined, ACCY_SOURCE must be one of following values TEST_1, TEST_2, TEST_3, GLIDER_RATIO , SECONDS_SINCE_T0 ,AVERAGE_VSPEED_SINCE_TO , VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6, ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4, PITCH, ROLL, YAW
#endif
#if defined( ACCZ_SOURCE ) && ( ! ( ( ACCZ_SOURCE == VOLT_1) || ( ACCZ_SOURCE == VOLT_2) || ( ACCZ_SOURCE == VOLT_3) || ( ACCZ_SOURCE == VOLT_4) || ( ACCZ_SOURCE == VOLT_5) || ( ACCZ_SOURCE == VOLT_6) \
|| ( ACCZ_SOURCE == ADS_VOLT_1) || ( ACCZ_SOURCE == ADS_VOLT_2) || ( ACCZ_SOURCE == ADS_VOLT_3) || ( ACCZ_SOURCE == ADS_VOLT_4) \
|| ( ACCZ_SOURCE == TEST_1) || ( ACCZ_SOURCE == TEST_2) || ( ACCZ_SOURCE == TEST_3) || ( ACCZ_SOURCE == GLIDER_RATIO) || ( ACCZ_SOURCE == SECONDS_SINCE_T0) || ( ACCZ_SOURCE == AVERAGE_VSPEED_SINCE_TO) || ( ACCZ_SOURCE == PITCH) || ( ACCZ_SOURCE == ROLL) || ( ACCZ_SOURCE == YAW) ) )
#error When defined, ACCZ_SOURCE must be one of following values TEST_1, TEST_2, TEST_3, GLIDER_RATIO , SECONDS_SINCE_T0 ,AVERAGE_VSPEED_SINCE_TO , VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6, ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4, PITCH, ROLL, YAW
#endif
#if defined( T1_SOURCE ) && ( ! ( ( T1_SOURCE == PPM) || ( T1_SOURCE == GLIDER_RATIO) || ( T1_SOURCE == SECONDS_SINCE_T0) || ( T1_SOURCE == AVERAGE_VSPEED_SINCE_TO) || ( T1_SOURCE == SENSITIVITY) \
|| ( T1_SOURCE == VOLT_1) || ( T1_SOURCE == VOLT_2) || ( T1_SOURCE == VOLT_3) || ( T1_SOURCE == VOLT_4) || ( T1_SOURCE == VOLT_5) || ( T1_SOURCE == VOLT_6) \
|| ( T1_SOURCE == ADS_VOLT_1) || ( T1_SOURCE == ADS_VOLT_2) || ( T1_SOURCE == ADS_VOLT_3) || ( T1_SOURCE == ADS_VOLT_4) \
|| ( T1_SOURCE == TEST_1) || ( T1_SOURCE == TEST_2) || ( T1_SOURCE == TEST_3) ) )
#error When defined, T1_SOURCE must be one of following values TEST_1, TEST_2, TEST_3, GLIDER_RATIO , SECONDS_SINCE_T0 ,AVERAGE_VSPEED_SINCE_TO , SENSITIVITY , PPM , VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6, ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4,
#endif
#if defined( T2_SOURCE ) && ( ! ( ( T2_SOURCE == PPM) || ( T2_SOURCE == GLIDER_RATIO) || ( T2_SOURCE == SECONDS_SINCE_T0) || ( T2_SOURCE == AVERAGE_VSPEED_SINCE_TO) || ( T2_SOURCE == SENSITIVITY) \
|| ( T2_SOURCE == VOLT_1) || ( T2_SOURCE == VOLT_2) || ( T2_SOURCE == VOLT_3) || ( T2_SOURCE == VOLT_4) || ( T2_SOURCE == VOLT_5) || ( T2_SOURCE == VOLT_6)\
|| ( T2_SOURCE == ADS_VOLT_1) || ( T2_SOURCE == ADS_VOLT_2) || ( T2_SOURCE == ADS_VOLT_3) || ( T2_SOURCE == ADS_VOLT_4) \
|| ( T2_SOURCE == TEST_1) || ( T2_SOURCE == TEST_2) || ( T2_SOURCE == TEST_3) ) )
#error When defined, T2_SOURCE must be one of following values TEST_1, TEST_2, TEST_3, GLIDER_RATIO , SECONDS_SINCE_T0 ,AVERAGE_VSPEED_SINCE_TO , SENSITIVITY , PPM , VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6, ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4,
#endif
#if defined ( ADS_AIRSPEED_BASED_ON ) && ( ! ( ( ADS_AIRSPEED_BASED_ON == ADS_VOLT_1) || ( ADS_AIRSPEED_BASED_ON == ADS_VOLT_2) || ( ADS_AIRSPEED_BASED_ON == ADS_VOLT_3) || ( ADS_AIRSPEED_BASED_ON == ADS_VOLT_4) ) )
#error When defined, ADS_AIRSPEED_BASED_ON must be one of following values ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4
#endif

My configuration includes a FrSky X8R, SPORT, and just one GPS connected to the Arduino. Other sensors will be FrSky standard SPORT. Therefore, is there a config_basic.h and oXs_config_advanced.h for my application or should I open the files and modify the config? Also, there are some errors, like

#error It is not allowed to ask for current calculation based both on arduino Adc and on ads1115; define only or PIN_CURRENTSENSOR or ADS_CURRENT_BASED_ON

that I don't know how to solve it.

Can you help me please?
Richard
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor GPS project 101

Post by mstrens »

your config basic and advanced does not seem OK.
can you add your 2 files and I will correct them.
Richard
Posts: 183
Joined: Sat Mar 29, 2014 10:44 pm
Country: United States
Location: Coral Springs, FL

Re: OpenXSensor GPS project 101

Post by Richard »

Here you have.
Attachments
oXs_config_basic.h
(11.02 KiB) Downloaded 507 times
oXs_config_advanced.h
(17.88 KiB) Downloaded 463 times
Richard
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor GPS project 101

Post by mstrens »

Take care that the config files you are using are not foreseen for the latest version of oXs. I think they where foreseen for a previous version.

Based on this previous version, I noticed one mistake in you config_advanced.
You have :
#define ADS_MEASURE A0_TO_GND , ADS_OFF , ADS_OFF , ADS_OFF // uncomment when ADS1115 is used; select 4 values between A0_TO_A1, A0_TO_A3, A1_TO_A3, A2_TO_A3, A0_TO_GND, A1_TO_GND, A2_TO_GND, A3_TO_GND, ADS_OFF seems ok but are not valid for the latest version of oXs.

This line should be put as comment (adding // in front of the line) because you do not use an ADS1115.

The errors that you put in yellow in your message are part of the code foressen to give error messages for some inconsistencies in the config.
They are just foreseen to help the user.
They should appears while compiling only when the error really exist.

I would recommend you to try with the latest version currently available on github (https://github.com/openXsensor/openXsensor)

In attachment, I put this latest version with the config files to be used just for a GPS.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor GPS project 101

Post by mstrens »

I do not know why but attachment was not added.
Here a new trial
Attachments
openXsensor.zip
(335.44 KiB) Downloaded 363 times
Richard
Posts: 183
Joined: Sat Mar 29, 2014 10:44 pm
Country: United States
Location: Coral Springs, FL

Re: OpenXSensor GPS project 101

Post by Richard »

mstrens,'Thank you for the files. However, I delete the previous directory and unzipped the new file you sent me. Still I am getting mostly the same errors. However, when I look into the config_basic.h, I can see:

#define PROTOCOL FRSKY_SPORT // select between FRSKY_SPORT , FRSKY_HUB , FRSKY_SPORT_HUB , MULTIPLEX , HOTT, JETI,

while the compiler shows:

#if ! defined(PROTOCOL)
#error The parameter PROTOCOL in config_basic.h is not defined
#elif ! ( (PROTOCOL == FRSKY_SPORT) or (PROTOCOL == FRSKY_HUB) or (PROTOCOL == FRSKY_SPORT_HUB) or (PROTOCOL == HOTT) or (PROTOCOL == MULTIPLEX) or (PROTOCOL == JETI))
#error The parameter PROTOCOL in config_basic.h is NOT valid
#endif

Should the line be:
#define PROTOCOL == FRSKY_SPORT // select between FRSKY_SPORT , FRSKY_HUB , FRSKY_SPORT_HUB , MULTIPLEX , HOTT, JETI

added ==?

Also I think I have to modify the following lines in basic_config.h, but I am not the expert. I need your agreement before messing things up.
line 45:
//#define TEMPERATURE_1_SOURCE (commented?)

comment lines 49 through 52
comment line 74

In the config_advanced.h

Should I comment lines undert items 3 (PPM settings) through 8 (persistent memory settings), plus lines under 10 and 11?


Thank you
Richard
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor GPS project 101

Post by mstrens »

The config files I send are correct (99% sure).
When I use all files in my zip, I do not get an error. It just compiles OK.
I presume your problem is related to arduino IDE and not to openXsensor.

E.g. following text is not a compilation error; it is just an extract of the program itself
#if ! defined(PROTOCOL)
#error The parameter PROTOCOL in config_basic.h is not defined
#elif ! ( (PROTOCOL == FRSKY_SPORT) or (PROTOCOL == FRSKY_HUB) or (PROTOCOL == FRSKY_SPORT_HUB) or (PROTOCOL == HOTT) or (PROTOCOL == MULTIPLEX) or (PROTOCOL == JETI))
#error The parameter PROTOCOL in config_basic.h is NOT valid
#endif

When you compile, you should get at the end ( bottom of the screen) something like (but with other values)
Sketch uses 11280 bytes (36%) of program storage space. Maximum is 30720 bytes.
Global variables use 995 bytes (48%) of dynamic memory, leaving 1053 bytes for local variables. Maximum is 2048 bytes.


Which version of arduino IDE are you using?
Did you select the rigth arduino board in the menu TOOLS (it is probabably arduino pro or pro mini) ?

Did you already try to compile another project? You can try using folowing (sub)menus : FILE + EXAMPLES + 01.BASIC + BLINK
Richard
Posts: 183
Joined: Sat Mar 29, 2014 10:44 pm
Country: United States
Location: Coral Springs, FL

Re: OpenXSensor GPS project 101

Post by Richard »

Will try to answer your questions in order you asked so that I don't miss anyone.
OK, therefore I should not care about the #error......"

This is what I got at the bottom of the screen after compiling:

sketch\oXs_curr.cpp: In member function 'void OXS_CURRENT::setupCurrent()':

sketch\oXs_curr.cpp:55:91: warning: division by zero [-Wdiv-by-zero]

currentDivider = 1.0 * (RESISTOR_TO_GROUND_FOR_CURRENT + RESISTOR_TO_CURRENT_SENSOR ) / RESISTOR_TO_GROUND_FOR_CURRENT ;

^

Sketch uses 7210 bytes (23%) of program storage space. Maximum is 30720 bytes.
Global variables use 723 bytes (35%) of dynamic memory, leaving 1325 bytes for local variables. Maximum is 2048 bytes.

IDE version is 1.8.4

I selected Arduino Pro or Pro Mini.

In the file Examples, I do not have the directory 01.Basic. There are a pair of directories Frsky and Jeti, and they have subdirectories Vario Basic and they contain files config_basic.h and config_advanced.h
Richard
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor GPS project 101

Post by mstrens »

Probably that your IDE is displaying the program while compiling. Just discards this.
The division by zero is just a warning. Just discards it. It is because you do not use the current sensor.

if you get
Sketch uses 7210 bytes (23%) of program storage space. Maximum is 30720 bytes.
Global variables use 723 bytes (35%) of dynamic memory, leaving 1325 bytes for local variables. Maximum is 2048 bytes.
it means that openXsensor compilation is OK.

So you can try to upload it in the arduino using FTDI.

There should be something strange in your arduino IDE installation because I expect that if you click on the menu "file" (on top of IDE screen), you should get a sub menu with items like New, Open..., ... Examples, ....Quit
If you select Examples, then another submenu apears with "Build-in examples" and a list of some types of examples like 01.Basics, ....
At least this is the case with arduino 1.8.3 I am using.
Perhaps you can try to reinstall arduino IDE.
Richard
Posts: 183
Joined: Sat Mar 29, 2014 10:44 pm
Country: United States
Location: Coral Springs, FL

Re: OpenXSensor GPS project 101

Post by Richard »

About the IDE you are right, and the IDE is OK. I was looking into the windows directory instead of the File tab in the IDE. The examples are there, and there are no errors.

In the view of that I will be uploading the openx today, I have a couple of hardware questions.
First, for the upload, I guess the Arduino will be powered through the FTDI, isn't?
Second, just to be sure on the wiring, please, find attached the wiring diagram I plan to use.
Also I want to be sure I don't mess up with the power. Both, the Pro micro and the GPS are 5V. The receiver is fed by the ESC BEC with 5V.
I want to confirm that I can connect the receiver VCC with the Pro VCC, and not with the RAW pin, and on the other hand, I want to confirm if I need or not a 10K resistor between the GPS RX and Pro pin 6 or I should use a direct connection between GPS RX and Pro TX0?
Attachments
Wiring schematics RX-Pro_GPS.pdf
(10.61 KiB) Downloaded 426 times
Richard
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor GPS project 101

Post by mstrens »

I would recommend that you connect in following way
Don't connect wires to the 6 pins on top of arduino; keep those pins only for ftdi
Vcc rx -> Arduino Raw
Sport Rx -> arduino 4 (like in your schema)
Gnd Rx -> arduino gnd (there are several gnd on arduino; you can use the one you want)
GPS Vcc -> Arduino Vcc (on the long side)
Gps Gnd -> arduino gnd (there are several gnd on arduino; you can use the one you want)
Gps Tx -> Arduino Rx (on the long side)
Gps Rx -> resistor about 10k -> Arduino Tx (on the long side) ; the resistor is to protect GPS Rx that normaly support only 3.3 volt.

Even if your Rx is powered by 5volt, it wil not be an issue for Arduino. Connecting 5 volt to RAW will let Arduino get about 4.5 volt which is more than enough.
So, if later you connect more than 5 volt to RX, arduino will be protected.

When you connect the FTDI to program arduino, disconect the GPS and do not connect Arduino to the Receiver
Once the Arduino program is upload, disconnect from ftdi and connect GPS and to receiver.
Wait that a led is blinking on GPS module (it says that GPS get a fix with satelites) and let opentx discover the sensors.
Richard
Posts: 183
Joined: Sat Mar 29, 2014 10:44 pm
Country: United States
Location: Coral Springs, FL

Re: OpenXSensor GPS project 101

Post by Richard »

Thanks I lot mstrens. A bit more mixed than what I expected, but safe and 100% sure it will work.
Just in case there are someone interested, I am attaching the wiring according with your suggestions.
Attachments
Wiring schematics RX-Pro_GPS.pdf
This is an updated schematics based on mstrens recommendations.
(10.96 KiB) Downloaded 353 times
Richard
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor GPS project 101

Post by mstrens »

Sorry, I made a mistake in my previous post.
GPS Rx should be connected to a 10 k resistor. Other pin of resistor should be connected to Arduino pin 6 (and not Tx).
It is explained in file oxs_config_description.h
Richard
Posts: 183
Joined: Sat Mar 29, 2014 10:44 pm
Country: United States
Location: Coral Springs, FL

Re: OpenXSensor GPS project 101

Post by Richard »

Ok, will make the correction.
Richard
Richard
Posts: 183
Joined: Sat Mar 29, 2014 10:44 pm
Country: United States
Location: Coral Springs, FL

Re: OpenXSensor GPS project 101

Post by Richard »

Here is the third and final version of the wiring schematic. Please, note that the GPS RX pin is connected to the Arduino pin 6, always through the 10K resistor.
Attachments
Updated wiring.pdf
(11.16 KiB) Downloaded 419 times
Richard
Richard
Posts: 183
Joined: Sat Mar 29, 2014 10:44 pm
Country: United States
Location: Coral Springs, FL

Re: OpenXSensor GPS project 101

Post by Richard »

mstrens, I have a problem with the upload.
I am getting this error:

Arduino: 1.8.4 (Windows 10), Board: "Arduino Pro or Pro Mini, ATmega328P (5V, 16 MHz)"

Sketch uses 7210 bytes (23%) of program storage space. Maximum is 30720 bytes.
Global variables use 723 bytes (35%) of dynamic memory, leaving 1325 bytes for local variables. Maximum is 2048 bytes.
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x03
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x20
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xfe
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x40
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xfc
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x13
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00
An error occurred while uploading the sketch

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

I don't know if its important or not, but I hope you can tell me what I have to do.
Thanks a lot
Richard
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor GPS project 101

Post by mstrens »

It means that your PC can't communicate with your arduino via ftdi.
It is a common issue with arduino. There is a lot of info on the web if you search with "stk500_getsync()"
When you upload the program, GPS TX may not be connected to Arduino Rx (otherwise GPS could interact with ftdi).
In TOOLS menu from Arduino IDE, you must select the rigth "programmer". For a ftdi it should be USBasp
In TOOLS menu from Arduino IDE, you must select the rigth "PORT". To find it, select this menu when you FTDI is not connected to the PC and notice the COM being present. Then connect you FTDI and look again at PORT. There should be one more port. Select the new one. Note: it could be that the com port changes each time you connect your FTDI so it is safe to check each time you upload.
If all previous points are ok, perhaps you can try to reinstall some drivers. To do so you can try running the program "drivers\dpinst-amd64" (to find in your arduino directory).
Some more info here also : http://www.instructables.com/id/A-solut ... ot-in-syn/
Richard
Posts: 183
Joined: Sat Mar 29, 2014 10:44 pm
Country: United States
Location: Coral Springs, FL

Re: OpenXSensor GPS project 101

Post by Richard »

I am not quite clear about the PC cannot connect with the arduino. How it comes that a couple of arduino's leds are blinking during part of the download? Anyhow, later on I will follow your suggestions. Please, keep in mind that as your suggestion, I have no connection between the Arduino and GPS and RX. I mean, not a single cable.
Richard
Richard
Posts: 183
Joined: Sat Mar 29, 2014 10:44 pm
Country: United States
Location: Coral Springs, FL

Re: OpenXSensor GPS project 101

Post by Richard »

Well, I found a couple of issues:
1) I had the wrong programmer in the IDE. Fixed as per your suggestion
2) Was not able to find the FTDI driver in the folders I have, therefore, I downloaded the IDE exe setup, that contains and install the drivers.
Restarted the computer (just in case...)
Still the same problem.
Followed up the link that you suggested, (http://www.instructables.com/id/A-solut ... ot-in-syn/). And here there is something that doesn't match. jpg1 attached is what they say the Devices Manager should show, jpg2 indicates what I may see, and then they go and install an arduino driver?. That may be the problem, because, jpg3 and jpg4 shows what I have.
It seems that still I am not communicating with the arduino, but I do not know if I am missing a driver, and if that is the case, which one is it and where should I find it and how should I load.
Please, I count on you in this project, bear with me, please.
While you check this message I will look for other potential reasons why this may be happening.
One thing that takes my attention is that when I connect the promini/ftdi to the pc, the power LED in the FTDI goes on, but no LED goes on in the arduino. just some tx/rx LED blinks.
Attachments
jpg4.jpg
jpg3.jpg
jpg2.jpg
jpg1.jpg
Richard
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor GPS project 101

Post by mstrens »

There are at least 2 types of FTDI. They use different chips that requires different drivers.
Could you post a link to the FTDI device that you purchased?
If not can you read the marks on the chip?
If not can you make a picture of your ftdi?
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor GPS project 101

Post by mstrens »

Arduino pro mini has 2 led.
One should be always ON . It just says that the arduino is powered on.
The other should blink at least at start up (even if you did not yet upload a program into the arduino). At start up, blinking means that bootloader is running and so that Arduino could be programmed via ftdi.

It is strange that you do not get LED on (on arduino).
Are you sure that you connect the arduino to the FTDI in a proper way. In principe you connect the FTDI to the 6 pins on top arduino (on the small side).

Take care that you have to align the pins marked Vcc.

You can also try just to connect your arduino to a battery (or a power supply) of 5 or 6 volt without using the FTDI in order to check that arduino is still ok. For this you should just connect arduino Raw and Gnd to the battery. If you do not get a led on, I assume there is an issue with the arduino.

It could also be that your FTDI does not give power to the arduino as long as you do not have the proper driver but I do not think so.
Richard
Posts: 183
Joined: Sat Mar 29, 2014 10:44 pm
Country: United States
Location: Coral Springs, FL

Re: OpenXSensor GPS project 101

Post by Richard »

That's what I was suspecting. I will hook up the FTDI and check VCC. I tried 2 Arduinos and got no LED either. Also I will wire the SPORT cable and I will hook up a battery to it, to verify the Arduino, as you suggested.
Will report later.
Sorry, answering your question about the FTDI/Arduino connection. I connected the FTDI to the 6 pin in the small side of the arduino.
Richard
Richard
Posts: 183
Joined: Sat Mar 29, 2014 10:44 pm
Country: United States
Location: Coral Springs, FL

Re: OpenXSensor GPS project 101

Post by Richard »

Some news. I checked the arduino with a battery and it did powered the power LED. I spent quite some time, measuring continuity, voltages etc, until I found out that I had the FTDI connected inverted to the Arduino. Now, LEDs are OK. Time to go back to the IDE.
Richard
Richard
Posts: 183
Joined: Sat Mar 29, 2014 10:44 pm
Country: United States
Location: Coral Springs, FL

Re: OpenXSensor GPS project 101

Post by Richard »

Uploaded without error messages.
I will prepare the cable to hook up the GPS and then let's see what we get.
Thank you very much for your help.
Will report as soon as I get the GPS up and running (or otherwise LOL)
Richard

Post Reply

Return to “OpenXVario - an open source vario supported by the open source firmwares!!”