By continuing to use this site, you agree to our use of cookies. Find out more
Forum sponsored by:
Forum sponsored by CML

Build your own telemetry sensors.

May 2019 article - OpenXSensor

All Topics | Latest Posts

Search for:  in Thread Title in  

Michael Hadaway31/07/2019 10:05:37
avatar
8 forum posts

Hi Chris

When compiling the sketch I get an error regarding <Arduino.h>. The error report is.

Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: "Arduino Pro or Pro Mini, ATmega328P (3.3V, 8 MHz)"

In file included from C:\Users\oxfor\AppData\Local\Temp\arduino_modified_sketch_368203\sketch_may30a.ino:369:0:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/Arduino.h:153:16: error: conflicting declaration of 'void setup()' with 'C' linkage

void setup(void);

^

C:\Users\oxfor\AppData\Local\Temp\arduino_modified_sketch_368203\sketch_may30a.ino:1:6: note: previous declaration with 'C++' linkage

void setup() {

^

In file included from C:\Users\oxfor\AppData\Local\Temp\arduino_modified_sketch_368203\sketch_may30a.ino:369:0:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/Arduino.h:154:15: error: conflicting declaration of 'void loop()' with 'C' linkage

void loop(void);

^

C:\Users\oxfor\AppData\Local\Temp\arduino_modified_sketch_368203\sketch_may30a.ino:133:6: note: previous declaration with 'C++' linkage

void loop() {

^

exit status 1
Error compiling for board Arduino Pro or Pro Mini.

Chris Bott - Moderator31/07/2019 11:11:05
avatar
Moderator
6667 forum posts
1382 photos
1 articles

Hi Michael

Wow there's a question.
As reported, I'm no expert at all, this has been my own voyage of discovery.

Hopefully someone with some real knowledge might come along.

In the meantime my guess would be that the sketch has somehow become corrupted.
What happens if you try to compile the original sketch as downloaded, before you try any changes?

Chris

Mike Blandford31/07/2019 12:45:35
avatar
532 forum posts
22 photos

Where did you get the Arduino IDE from?

Mike

Michael Hadaway31/07/2019 16:17:57
avatar
8 forum posts

Hello

Mike Blandfird may have a good point. I have downloaded the IDE ( Arduino 1.8.9 ) from Windows store 1.2.21.0.

Is this OK?

I note, Chris, that you say to compile the original sketch. I have been unable to find the sketch to download.

From your post 14/4/19 were the link "here" is given, I left click on openxsensor and find a lot of files.

I downloaded oXs_config_basic_h and oXs_ config_advanced_h as advised in the magazine article.

Then pasted into a new sketch file. Even before changes unable to compile.

Hopefully it will be clear to you were I am going wrong. Incidentally the sketch for the servo tester compiles OK

and the unit works as expected.

Mike Hadaway

Chris Bott - Moderator31/07/2019 16:40:18
avatar
Moderator
6667 forum posts
1382 photos
1 articles

Hi Mike

I think we can fix this fairly easily. Im at work just now so can't spend much time.

I downloaded the IDE from Arduino website here it's currently showing version 1.8.9. If you have used the servo tester sucessfully then your IDE is probably OK.

The openxsensor sketch comprises many files. it sounds like you don't have them all.

We'll have to work out the best way to point you to them. Or I might be able to email the whole thing in a zip file later.

Chris

Chris Bott - Moderator31/07/2019 18:41:41
avatar
Moderator
6667 forum posts
1382 photos
1 articles

The full .zip file is here

Once downloaded it needs unzipping but leaving in the file structure just as it comes.

As you'll see, there are a LOT of files in there.

Cheers
Chris

Michael Hadaway01/08/2019 08:50:20
avatar
8 forum posts

Thanks Chris. Will give it a go.

Mike

Michael Hadaway02/08/2019 10:05:01
avatar
8 forum posts

Thank you so much Chris. The zip file downloaded perfectly and compiles without errors.

I do get a warning that the global variables use 92% of dynamic memory and stability problems may occur.

However I presume that once I have edited the sketch for the sensors I am using, ie just current and voltage at first,

that the memory issue will be resolved.

Thanks again for you help and I hope that my experience may help others who may be having problems.

Cheers

Mike

Michael Hadaway10/08/2019 14:22:57
avatar
8 forum posts

I was compiling for a 168 board in error for a 328.

Now all OK.

Have tested my first sensor and can report getting good cell voltages.

encouraged to proceed.

Chris Bott - Moderator10/09/2019 09:22:12
avatar
Moderator
6667 forum posts
1382 photos
1 articles

Just a little bit of feedback. Between everyone that's contacted me, I've now sent out 102 PCBs. I've had a daft lingering hope that we'd crack the 100 barrier and now we have.

So - many many thanks for all the support and interest, it makes it feel very worthwhile.

Are there any more success stories?
Or have most people had a go and given up?

Chris

Andrew Ray10/09/2019 09:56:39
avatar
715 forum posts
19 photos

Haven't given up Chris, just not started yet (other than accumulating the parts needed) too many other things to do and a long holiday on the continent. Maybe when the weather deteriorates, fingers crossed.

Chris Bott - Moderator10/09/2019 10:14:23
avatar
Moderator
6667 forum posts
1382 photos
1 articles

I get that completely Andrew, I've had a very busy summer with hardly any modelling or flying done at all.

Michael Hadaway27/09/2019 12:49:14
avatar
8 forum posts

Hello. Sorry to be a bit tardy replying to your post. Due to health problems and other distractions I have put the project to one side for now.

I do have a working variometer and a voltage/current sensor using your supplied pcb give accurate cell readings but the standby current is reported to be about 130 A, with no VFAS detection.

I am using the latest sketch that has only config.h. not configbasic and configadvanced.

In config.h about line 130 there is define VFAS_SOURCE ADS_VOLT_6.

Suspect this line should be changed to VFAS_SOURCE VOLT_6

I don't like to give up so will continue when energy reserves return.

Peter Balcombe02/11/2019 19:47:50
14 forum posts
3 photos

Having recently received a batch of PCBs from Chris, I have just made up my first sensor using the AMASS XT60 module for VFAS & current sensing, intended to be fitted in an electrified glider.

The PCB has had the current sensor end cut off along the left hand line of the Arduino silk screen outline to reduce the electronics unit size.

I have swapped the normal A3/A6 usage to allow the use of a 3 way R/A header for connection to the XT60 sensor, current on A6 & VFAS on A7. This just needs a single break in the A6 track & a short link wire to the A3 pin. With a 47K resistor between the XT60 sensor output and Gnd (as used by Chris on his experimental XT60 sensor), I get accurate current readings (at least up to 8A using a bench PSU & halogen lamp load) with zero offset & 30mv/A settings in the advanced configuration file. As for Chris's test unit, I have fitted a mating XT60 connector to the sensor module via short power cables, and with a flying servo type connection to the 'electronics, this gives the option of easy insertion between battery & ESC when required.

I have used a 5 pin R/A header for Lipo balance lead connection instead of a JST-XH header in order to allow any LiPo up to 4S to be easily connected - just need to make sure the connector is the right way round!.

I have some pictures on my PC, but need to work out how to include these in a post!

Further testing is now required with an ESC to see if the calibration remains true.

By the way, inspection of the OpenXsensor code indicates that current sensor readings are averaged over 200mS & Voltage readings over 500mS. FrSky telemetry setup also allows further smoothing if the 'Filter' box is ticked in the individual sensor setup screen.

667ff85f-2176-41b2-af9b-ff0deecf8acc.jpeg
59c76cdf-5ffd-4dd8-9d68-74db29237bad.jpeg

727080df-5e2d-4bfc-a539-4f9fd1943a70.jpeg

Edited By Peter Balcombe on 02/11/2019 20:11:43

All Topics | Latest Posts

Please login to post a reply.

Magazine Locator

Want the latest issue of RCM&E? Use our magazine locator link to find your nearest stockist!

Find RCM&E! 

Latest Forum Posts
Support Our Partners
Slec
Cambridge Gliding Club
CML
Wings & Wheels 2019
Gliders Distribution
electricwingman 2017
Pepe Aircraft
Sarik
Advertise With Us
Latest "For Sale" Ads
Do you use a throttle kill switch?
Q: This refers to electric-powered models but do you use a throttle kill switch?

 Yes
 No
 Sometimes
 Rarely

Latest Reviews
Digital Back Issues

RCM&E Digital Back Issues

Contact us

Contact us