Pages: [1] 2 3   Go Down
Author Topic: Fetch: Arduino Data Acquisition/Oscilloscope (Alpha2 Release)  (Read 13455 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 2
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:


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

* Fetch Arduino Package Alpha2.zip (1067.51 KB - downloaded 268 times.)
« Last Edit: December 27, 2012, 05:39:37 pm by drl81 » Logged

Greenville, IL
Offline Offline
Edison Member
*
Karma: 11
Posts: 1310
Warning Novice on board! 0 to 1 chance of errors!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

 
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:
#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
}
Logged


Offline Offline
Newbie
*
Karma: 2
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.  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:
#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!
Logged

Greenville, IL
Offline Offline
Edison Member
*
Karma: 11
Posts: 1310
Warning Novice on board! 0 to 1 chance of errors!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.



 
Logged


Offline Offline
Newbie
*
Karma: 2
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Offline Offline
Edison Member
*
Karma: 6
Posts: leet
If you're not living on the Edge, you're taking up too much space!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
Logged

If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Offline Offline
Newbie
*
Karma: 2
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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. 
Logged

Offline Offline
Edison Member
*
Karma: 6
Posts: leet
If you're not living on the Edge, you're taking up too much space!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Wow sounds very useful!  I assume there is a tutorial, demo, or example code in the zip to try first?
Logged

If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Greenville, IL
Offline Offline
Edison Member
*
Karma: 11
Posts: 1310
Warning Novice on board! 0 to 1 chance of errors!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


 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.
Logged


Offline Offline
Newbie
*
Karma: 2
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

sbright33, yes, there is a basic example included in the zip download.  You could also try the modification of that example that cyclegadget posted.
Logged

Greenville, IL
Offline Offline
Edison Member
*
Karma: 11
Posts: 1310
Warning Novice on board! 0 to 1 chance of errors!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


 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.
Logged


Offline Offline
Newbie
*
Karma: 2
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
void setup()
{
  Serial.begin(SERIAL_BAUD);
  Serial.println((long)&sbyte_test);  // new line to help debug
}
Logged

Greenville, IL
Offline Offline
Edison Member
*
Karma: 11
Posts: 1310
Warning Novice on board! 0 to 1 chance of errors!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset



Code:
Uno with 3 resets
407
407
407

Code:
Due with 3 resets
537330012
537330012
537330012
537330012
Logged


Offline Offline
Newbie
*
Karma: 2
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks, cyclegadget, that is what i was expecting.  i'll look into a clean way to handle both the Uno and Due.
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 70
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Looking forward to using this software with my Due. Good work Drl81!
Logged

Pages: [1] 2 3   Go Up
Jump to: