Arduino Forum

Community => Products and Services => Topic started by: drl81 on Nov 30, 2012, 06:40 am

Title: Fetch: Arduino Data Acquisition/Oscilloscope (Alpha2 Release)
Post by: drl81 on Nov 30, 2012, 06:40 am
Fetch is an Arduino development tool that makes it easy to view, plot, and change internal Arduino parameters (aka global variables) in real time.

Features
-user-friendly & intuitive general purpose data acquisition (similar to oscilloscope)
-no need to specifically code which parameters to view/edit
-dynamically choose parameters to monitor, graph, and edit values
-high speed data transfer, initially via serial (at least as high speed as serial will allow)

**** New for Alpha2 ****
+ Arduino parameter values can be changed from within Fetch
+ Now supports Arduino Due!
+ automatically save/restore list of parameters
(Full changelog below)

Installation
Must be logged into forum to see attached file
Download the attached "Fetch Arduino Package" and unzip somewhere such as <C:\>, retaining the directory structure.  Then follow the instructions in the Getting Started Guide located in the "Fetch Arduino Package" directory.  
**Be sure to replace any previous DataLogger library files with the new ones.

Let us know if you any questions/comments/suggestions.  

Screenshot:
(http://s12.postimage.org/rykim0fil/Fetch_Screenshot_Alpha1.png)

ChangeLog
Alpha2 (2012-12-11)
+ Arduino parameter values can be changed from within Fetch
+ Now supports Arduino Due!
+ automatically save/restore list of parameters
+ ignore variables that were optimized out by compiler (never assigned to inside a loop)
+ automatically edit the build.path setting in Arduino ERW's preferences file
+ some GUI enhancements

Alpha1 (2012-11-30)
+ initial release
Title: Re: Fetch: Arduino Development Tool
Post by: cyclegadget on Dec 01, 2012, 01:49 am

Drl81,

I downloaded the code and used it with Ide 1.01 with success! I discovered a couple things that I think are notable.

1.) to datalog an analog value from an analogpin, you have to define a variable for the analog result before setup. Defining a variable in the loop() does not allow Arduino Fetch to see it???
2.) Your program does not seem to work with Arduino ERW which is a modified version of the Arduino IDE found in the other software section. (I know it is not supported by the Arduino group).
3.) A definition like "int led pin = 7; will show up as a  possible choice for datalog even though it would possibly be referring to a digital pin number that is a constant but, just defined as int.

The code below gave me some nice graphs to look at. I hope to try more things when timed allows!

Thank you for sharing your hard work!

Code: [Select]
#include <DataLogger.h>
DataLogger datalogger;  // instantiate the DataLogger

// some basic test params
signed char sbyte_test = 0; 
float loop_time_ms, loop_period_ms;

int sensorValue;
int otherpin;
// initialization routine
void setup()
{
  Serial.begin(SERIAL_BAUD);
}

//background loop (aka "main" loop)
void loop()

  // timestamping
  static unsigned long loop_timestamp;
  unsigned long now = micros(); 
  loop_period_ms = ((float)(now - loop_timestamp)) * 0.001f;
  loop_timestamp = now;  //store off prev val

  sbyte_test+=2;  // test parameter
 
  datalogger.ReceiveDAQParams(); // Receive serial data
  datalogger.SendDAQParams(); // Send data
   sensorValue = analogRead(A0);
   otherpin = analogRead(A1);
  // calculate loop time (not including delay at end)
  loop_time_ms =((float)(micros() - loop_timestamp)) * 0.001f;
 
  // wait some milliseconds to slow the sending of params
  delay(20);  // can be reduced as desired
}
Title: Re: Fetch: Arduino Development Tool
Post by: drl81 on Dec 01, 2012, 04:59 pm
cyclegadget, thanks for the helpful feedback!

1) Yes, that is correct.  Fetch only supports global variables.  We do not plan to have Fetch support local variables since the compiler does not allocate a fixed memory address for locals.  Also, multiple local variables with the same name could exist but in separate functions (not likely for most Arduino users only using the loop() function, but possible). 

Supporting "static" local variables would be possible since they do get allocated a fixed memory location.  It would be difficult but not impossible to distinguish multiple static local vars with the same name but in different functions. 

How important is this functionality, versus declaring any parameter you want to view as global at the top of the file outside of any functions?

2) I looked into  Arduino Enhanced Release for Windows (http://arduino.cc/forum/index.php/topic,118440.0.html).  Looks like a nice improvement to the standard editor! 

Fetch Alpha1 will work with it, but the preferences for ERW are in a different file (e.g. idesettings_v1.0.2.txt).  Those prefs files can be located by going to Arduino File->Preferences window and clicking link at the bottom.  You just have to make sure the build.path setting is the same in that ERW file as it is in preferences.txt.  Only edit preferences files when Arduino Editor is closed!!  Otherwise, when Arduino is closed, it will overwrite any edits you made.

In future releases, Fetch can automatically add build.path setting to ERW prefs and ensure both files have same setting if both preferences files exist.

3) You are right, there is a bug if a global variable is defined and initialized to a value, but never used in the code.  Fetch Alpha1 will present it as a valid parameter and show the wrong value for it since it isn't truly a parameter (the compiler recognized it wasn't used and didn't allocate memory for it).  It should be able to be fixed so it doesn't show up as a valid selection in future releases.  Not sure if I can get it to show up as an option AND report the correct constant value, would that be desirable?

In the meantime, there are some workarounds.  If you really want to declare a constant value, you could use either option below, and Fetch will not show it:
Code: [Select]
#define LEDPIN 12
const int ledpin =12;


we'll be working on some more tweaks and releasing again soon.  let us know any other feedback!
Title: Re: Fetch: Arduino Development Tool
Post by: cyclegadget on Dec 01, 2012, 06:28 pm
Quote
Supporting "static" local variables would be possible since they do get allocated a fixed memory location.  It would be difficult but not impossible to distinguish multiple static local vars with the same name but in different functions.

How important is this functionality, versus declaring any parameter you want to view as global at the top of the file outside of any functions?


Thanks for the reply!

I am a bit of a novice and not a professional coder but, I think that I can adjust most of my sketches with a little programming strategy for using Fetch by using global variables.

I will try some of your tips and see what other results I can produce. I will also test some functions and see if I can produce desirable results with those also.



Title: Re: Fetch: Arduino Development Tool
Post by: drl81 on Dec 04, 2012, 04:40 am
thanks, cyclegadget, and anyone who has had a chance to try out fetch. let us know how it's going and whether you have any suggestions or feature requests.

Title: Re: Fetch: Arduino Development Tool
Post by: sbright33 on Dec 05, 2012, 05:06 am
I don't understand.  Can you explain this tool to someone who has never heard of it before?  I tried Googling.
Please start at the beginning...
Title: Re: Fetch: Arduino Development Tool
Post by: drl81 on Dec 05, 2012, 03:58 pm

I don't understand.  Can you explain this tool to someone who has never heard of it before?  I tried Googling.
Please start at the beginning...


sbright, i will certainly try.  Fetch is a software for Windows OS intended to help with any Arduino based project.  It was released for the first time recently in this forum thread, so there will not be much on Google about it.

Sometimes during development of an Arduino project it would be nice to be able to easily visualize what is going on inside the Arduino.  Fetch provides a easy to use PC interface to plot any Arduino global variable in real time.  In many cases this may be a sensor input reading, or a calculated output value. 

For example, let's say you wanted to make the Arduino do something like sound an alarm in response to motion detected nearby.  A motion detection sensor would be connected to an Arduino analog input pin, and the Arduino would periodically read the sensor value, store it to a global variable, and respond in various ways depending on that value.  In order to more easily calibrate how the Arduino responds to any nearby motion, the Fetch software would allow you to quickly see a real time plot of the sensor reading value for different types of motion detected by the Arduino.  This applies to any type of sensor such as temperature, acceleration, light level, sound, voltage, current etc.  Fetch helps to tune and calibrate a response to something about the physical environment. 

There is more detail about how to install and use Fetch in the "Getting Started Guide" included in the zip file attached to the first post.  Maybe it would help to go through that guide and try the included example sketch.

Hopefully this helps, don't hesitate to ask if you have more questions. 
Title: Re: Fetch: Arduino Development Tool
Post by: sbright33 on Dec 05, 2012, 04:55 pm
Wow sounds very useful!  I assume there is a tutorial, demo, or example code in the zip to try first?
Title: Re: Fetch: Arduino Development Tool
Post by: cyclegadget on Dec 05, 2012, 06:35 pm

My code that I posted reads two analog pins on my Uno, that I left unconnected. I just touched the pins to see the output change. It worked very nicely, and I have some ideas that I want to try when I get time.
Title: Re: Fetch: Arduino Development Tool
Post by: drl81 on Dec 05, 2012, 08:02 pm
sbright33, yes, there is a basic example included in the zip download.  You could also try the modification of that example that cyclegadget posted.
Title: Re: Fetch: Arduino Development Tool
Post by: cyclegadget on Dec 09, 2012, 06:39 pm

Hello,

Today I tried my code that I posted above on the Due. The code compiled and loaded into the Due with no problem. However, the Fetch logger does not seem to get updated information.

It seems that it either the Due data stream is not the same as the Uno or the data types are being mismatched.

On the Uno my analog read-out was 0 - 1023.  On the Due it is only showing something like "4.09 E9" similar to a calculation with powers of 10 in the answer. The analog read-out does not work on the Due, as if it is frozen or not transmitting.
Title: Re: Fetch: Arduino Development Tool
Post by: drl81 on Dec 09, 2012, 11:12 pm
cyclegadget,
i do not have a Due so i cannot test it.  If you would like to help me debug, please try:
  1. modify the example's setup() function as in code sample below. 
  2. compile/upload to the Uno. 
  3. open Arduino serial monitor (make sure baud is 115200)
  4. there should be a number printed in at the top of the serial monitor (for me it is '417')
      * if no number appears, try pressing reset button on Arduino board
  5. repeat for Due
  6. tell me the numbers you got for each

Code: [Select]

void setup()
{
  Serial.begin(SERIAL_BAUD);
  Serial.println((long)&sbyte_test);  // new line to help debug
}
Title: Re: Fetch: Arduino Development Tool
Post by: cyclegadget on Dec 10, 2012, 01:11 am


Code: [Select]
Uno with 3 resets
407
407
407


Code: [Select]
Due with 3 resets
537330012
537330012
537330012
537330012
Title: Re: Fetch: Arduino Development Tool
Post by: drl81 on Dec 10, 2012, 01:40 am
thanks, cyclegadget, that is what i was expecting.  i'll look into a clean way to handle both the Uno and Due.
Title: Re: Fetch: Arduino Development Tool
Post by: Rosscopico0 on Dec 10, 2012, 06:45 am
Looking forward to using this software with my Due. Good work Drl81!
Title: Re: Fetch: Arduino Development Tool (Alpha2 Release)
Post by: drl81 on Dec 12, 2012, 05:47 am
Fetch Alpha2 released in first post.  Let me know if Due works.
Title: Re: Fetch: Arduino Development Tool (Alpha2 Release)
Post by: cyclegadget on Dec 13, 2012, 03:34 am

Fetch Alpha2 released in first post.  Let me know if Due works.



The frame rate seems to be working as it changes when variables are added or removed from the list. However, I get no data change "it shows 0" and it also does not graph or change data with Uno using 1.0.2 IDE

It is definitely finding the sketch I uploaded and the variables but data is not the changing.
Title: Re: Fetch: Arduino Development Tool (Alpha2 Release)
Post by: drl81 on Dec 13, 2012, 03:42 am

The frame rate seems to be working as it changes when variables are added or removed from the list. However, I get no data change "it shows 0" and it also does not graph or change data with Uno using 1.0.2 IDE


cyclegadget, you may have to copy the new Alpha2 DataLogger library files into the arduino libraries folder, replacing the files from Alpha1. 
Title: Re: Fetch: Arduino Development Tool (Alpha2 Release)
Post by: cyclegadget on Dec 15, 2012, 03:13 pm

  Update! Problem solved! Fetch Alpha2 Release works with both Due and Uno!

  I must of had some old files from Fetch Alpha1. I removed all Fetch files from my Arduino IDE to make a clean start and replaced them with the new Alpha2 files.

I tested Fetch with both the Uno and Due back to back and it works great!

Job well done drl81!
Title: Re: Fetch: Arduino Development Tool (Alpha2 Release)
Post by: drl81 on Dec 15, 2012, 07:48 pm
cyclegadget, thanks for the confirmation.  i can't take all the credit, i've been working on it with a friend who has helped a ton and may show up on this forum at some point to help answer questions, etc.

anyone who is giving Fetch a try, let us know if there are any specific features or fixes to prioritize for next release.
Title: Re: Fetch: Arduino Development Tool (Alpha2 Release)
Post by: cyclegadget on Dec 17, 2012, 01:06 am

Another update! I tested the my sketch with the Teensy 3.0 and it was success!

Teensy 3.0 works with Fetch!


One note: I had to use a delay(20) because my Fetch datalogger would freeze, possibly because a buffer problem (with the flood of data) with my computer. I believe the user needs to limit how quickly or how often the sketch reports data to the computer.
Title: Re: Fetch: Arduino Development Tool (Alpha2 Release)
Post by: serbar on Dec 27, 2012, 08:52 pm
HY guys.

I am trying to put Fetch working with Leonardo, folowed all steps on the starting guide PDF with the example in the datalloger librarie, all i get is a white screen :(  and a kind of a progression green bar on the bottom right of the Fetch window at 25% and don t move.

Can you help me?

Thanks.
Title: Re: Fetch: Arduino Development Tool (Alpha2 Release)
Post by: serbar on Dec 27, 2012, 08:54 pm
Don t know if this helps, the values in "Frame Rate" are changing.

I went to settings and selected the right COM, and the baud rate, everything else unchanged.

Thanks.
Title: Re: Fetch: Arduino Development Tool (Alpha2 Release)
Post by: drl81 on Dec 27, 2012, 11:38 pm
serbar, sorry to hear it isn't working with Leonardo.  I don't have a Leonardo, so it's hard to say what is going on.  After reading the Leonardo Getting Started Guide (http://arduino.cc/en/Guide/ArduinoLeonardo), it seems the Leonardo is a slightly different animal when it comes to the serial port. 

It sounds like it re-creates a virtual serial port on the PC each time it resets.  Are you sure you're selecting the correct serial port #?  What baud rate are you setting in Fetch?  (Baud rate setting in Fetch should match the SERIAL_BAUD definition in DataLogger.h, default is 115200).

The progress bar doesn't mean anything yet. We should probably remove that until it means something, to avoid confusion.

Title: Re: Fetch: Arduino Data Acquisition/Oscilloscope (Alpha2 Release)
Post by: serbar on Dec 28, 2012, 12:28 am
Quote
Are you sure you're selecting the correct serial port #?


Yes i am sure, i use always the same port, COM 9 in my computer.

Quote
What baud rate are you setting in Fetch?


Yes i sellect in Settings of Fetch 115200 baud.

There is a thread running on this kind of issue for Leonardo concerning similar programs like Fetch.

If you re interested:

http://arduino.cc/forum/index.php/topic,138885.15.html#lastPost

Thanks.

Title: Re: Fetch: Arduino Data Acquisition/Oscilloscope (Alpha2 Release)
Post by: serbar on Dec 30, 2012, 02:05 pm
drl81 do you have any more suggestions?

Your tool is great for my purposes and i would like to be able to use it.

Thanks.
Title: Re: Fetch: Arduino Data Acquisition/Oscilloscope (Alpha2 Release)
Post by: drl81 on Dec 31, 2012, 12:10 am
serbar, thanks for the feedback on this.  i've been on vacation and haven't been able to dig into this too deeply.  i skimmed the discussion in the link you posted. 

in Fetch, have you tried going to Communication->Settings and trying each of the options for Handshake? 

if none of those options work, we should be able to release something soon that enables DTR.  we'll want to verify it doesn't screw anything up for other arduinos as well. 
Title: Re: Fetch: Arduino Data Acquisition/Oscilloscope (Alpha2 Release)
Post by: serbar on Dec 31, 2012, 01:22 pm
I try all the handshake options, but nothing :(

I look forward to news from you guys.

Thanks.
Title: Re: Fetch: Arduino Data Acquisition/Oscilloscope (Alpha2 Release)
Post by: drl81 on Dec 31, 2012, 07:27 pm
serbar, try installing the attached version which enables DTR.  let us know if it works.
Title: Re: Fetch: Arduino Data Acquisition/Oscilloscope (Alpha2 Release)
Post by: serbar on Jan 01, 2013, 04:07 pm
Version installed and working perfect on Leonardo.

Thanks a lot guys.
Title: Re: Fetch: Arduino Data Acquisition/Oscilloscope (Alpha2 Release)
Post by: wes3105 on Apr 30, 2013, 10:41 pm
I can't seem to download the zip file - can someone re-up it please. The code looks very useful!
Title: Re: Fetch: Arduino Data Acquisition/Oscilloscope (Alpha2 Release)
Post by: drl81 on May 01, 2013, 03:04 am
The zip download works for me, not sure what's going on?
Title: Re: Fetch: Arduino Data Acquisition/Oscilloscope (Alpha2 Release)
Post by: krogers21 on Jul 08, 2013, 08:09 pm
Hello,

I'm fairly new to the Arduino world and the programming world in general. I'm attempting to use Fetch to analyze my analog input on the Arduino Due for chemistry research. Not to sound ignorant, but what parameters would be needed in order to use Fetch to read these analogs? I have connected a waveform generator to the Arduino Due and I'm hoping to be able to view the signal through Fetch.

Any help is greatly appreciated!
Title: Re: Fetch: Arduino Data Acquisition/Oscilloscope (Alpha2 Release)
Post by: cyclegadget on Jul 09, 2013, 12:10 am

Hello,

I'm fairly new to the Arduino world and the programming world in general. I'm attempting to use Fetch to analyze my analog input on the Arduino Due for chemistry research. Not to sound ignorant, but what parameters would be needed in order to use Fetch to read these analogs? I have connected a waveform generator to the Arduino Due and I'm hoping to be able to view the signal through Fetch.

Any help is greatly appreciated!


Try the code in Reply #1 it has one analogread being used.
Title: Re: Fetch: Arduino Data Acquisition/Oscilloscope (Alpha2 Release)
Post by: Stiefei on Aug 22, 2013, 02:52 pm
The fetch work great with input signals,

but how can I simulate the output signals, because this is also very important for me

Any help is greatly appreciated, Stiefei
Title: Re: Fetch: Arduino Data Acquisition/Oscilloscope (Alpha2 Release)
Post by: PhilUWB on Nov 06, 2013, 01:11 pm
Hi, I am trying to run this in my simple code using Arduino 1.0.3 but I keep getting the following errors;

for   'DataLogger datalogger;  // instantiate the DataLogger'    I get "error: 'datalogger' was not declared in this scope"

For   'datalogger.ReceiveDAQParams(); // Receive serial data'     I also get "error: 'datalogger' was not declared in this scope".

Does anyone have suggestions to address this?

Many thanks.
Title: Re: Fetch: Arduino Data Acquisition/Oscilloscope (Alpha2 Release)
Post by: PaulS on Nov 06, 2013, 02:27 pm
Quote
Does anyone have suggestions to address this?

Post ALL of the error messages. It looks, though, like did not install the DataLogger library in the correct place.