devinaconley / arduino-plotter

An Arduino library for easy graphing on host computer via serial communication
MIT License
186 stars 31 forks source link

Compile Error in Arduino Due #13

Closed shouryasingh closed 7 years ago

shouryasingh commented 7 years ago

I am Getting following error while compiling program in Arduino Interface for Arduino Due Board :-

Arduino: 1.8.0 (Windows 7), Board: "Arduino Due (Programming Port)"

C:\Users\Shourya\Documents\Arduino\libraries\Plotter\Plotter.cpp: In member function 'void Plotter::Graph::Plot(bool)':

C:\Users\Shourya\Documents\Arduino\libraries\Plotter\Plotter.cpp:244:45: error: 'dtostrf' was not declared in this scope

dtostrf( wrappers[i].GetValue(), 1, 7, val ); ^

exit status 1 Error compiling for board Arduino Due (Programming Port).

Please look into the matter.

devinaconley commented 7 years ago

Try adding #include <avr/dtostrf.h> to the top of Plotter.cpp (I don't have a Due to test on)

If that works, i'll push an official fix.

shouryasingh commented 7 years ago

Dear Devin,

Thanks for your reply. I have been able to compile example program after adding #include <avr/dtostrf.h> to the top of Plotter.cpp and it seems to be running in Arduino.

However when I open "ArduinoPlotter_processingListener.exe" it still show blank.

Any ideas regarding that, or some thing which I can do from my side to make it working.

With regards Shourya

On 3/25/17, Devin Conley notifications@github.com wrote:

Try adding #include <avr/dtostrf.h> to the top of Plotter.cpp (I don't have a Due to test on)

If that works, i'll push an official fix.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/devinaconley/arduino-plotter/issues/13#issuecomment-289227118

devinaconley commented 7 years ago

Hmm that name looks an older version of the listener. Where did you download that from? Check out this page

shouryasingh commented 7 years ago

Dear Devin,

Thanks for your reply.

Now, I am using the latest version of Listner From GitHub site and file name for 64 Bit windows version is "listener.exe". I get message on Screen "Scanning Serial Ports...(COM1)" and "Scanning Serial Ports...(COM4)" but again rest of the screen is Blank. My Arduino Due is installed on COM Port 4.

Also I have Latest Java version 8 on my PC.

Please let me know if there is any way to debug the program running on Arduino using Serial Monitor/Plotter. Or if there is any other way to look into this problem.

With regards Shourya

With regards Shourya

On 3/27/17, Devin Conley notifications@github.com wrote:

Hmm that name looks an older version of the listener. Where did you download that from? Check out this page

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/devinaconley/arduino-plotter/issues/13#issuecomment-289354360

devinaconley commented 7 years ago

Can you post the output from the serial monitor? You will have to switch the baud rate to 115200 and cannot have the serial monitor and listener open at the same time.

shouryasingh commented 7 years ago

Output of serial monitor is also completely blank for Basic Example.

On 3/28/17, Devin Conley notifications@github.com wrote:

Can you post the output from the serial monitor? You will have to switch the baud rate to 115200 and cannot have the serial monitor and listener open at the same time.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/devinaconley/arduino-plotter/issues/13#issuecomment-289778943

devinaconley commented 7 years ago

Okay, sounds like the example isn't running at all then. I would verify that everything is compiled (with the fix from above) and uploaded to your arduino

shouryasingh commented 7 years ago

Yes, every thing compiles without error after including the header file as told by you and it is uploaded to arduino also. As I have done some testing (by turning on-board led on-off at different stages of program) it seems that program enters setup routine but then does not go in loop and probably hangs somewhere in between.

Also this may be Due specific as you told that program runs well on other arduino boards.

On 3/28/17, Devin Conley notifications@github.com wrote:

Okay, sounds like the example isn't running at all then. I would verify that everything is compiled (with the fix from above) and uploaded to your arduino

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/devinaconley/arduino-plotter/issues/13#issuecomment-289836397

devinaconley commented 7 years ago

Yep, it does look like some problem with using dtostrf across different boards. I will write my own function to replace that and put in a fix tonight.

In the meantime, you can try googling for quick fixes. Seems like this is a common problem on the Due.

devinaconley commented 7 years ago

Pushed a fix for this (2.2.1). Should show up in the library manager soon.

Let me know if that solves the problem

shouryasingh commented 7 years ago

Dear Devin,

Thanks for your support. I am sorry for the late reply as I was not able to use my PC yesterday.

I updated to Latest version of Plotter Library. Now I am able to compile and upload any example program to Arduino without any modification.

However, I still get Blank screen on Listner. I have downloaded Processing 3.3 and tried to run Listner directly from source. It runs but still I get Blank Screen with same message "Scanning Serial Ports...."

I also tried another example program (available on internet) to check communication between Processing and Arduino and it works. It is a very simple program to display single int incriminating values but it confirms that communication is ok.

I suspect that problem is somewhere in compatibility of Arduino Program with Due Board.

With regards Shourya

On 3/29/17, Devin Conley notifications@github.com wrote:

Pushed a fix for this (2.2.1). Should show up in the library manager soon.

Let me know if that solves the problem

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/devinaconley/arduino-plotter/issues/13#issuecomment-289943376

devinaconley commented 7 years ago

Hmm okay. If you open the arduino serial monitor, is it still blank?

shouryasingh commented 7 years ago

Yes it is completely blank. I seems that program hangs in Arduino Due during initialization stage and does not enter the loop at all.

On 3/30/17, Devin Conley notifications@github.com wrote:

Hmm okay. If you open the arduino serial monitor, is it still blank?

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/devinaconley/arduino-plotter/issues/13#issuecomment-290459137

devinaconley commented 7 years ago

See if you can add print statements to identify the line that it is hanging on. I will try to get my hands on an Arduino Due

shouryasingh commented 7 years ago

Dear Devin,

I actually tried print statement at different lines of program, but not even a single statement gave output on serial monitor.

If you would like to give any debug program, I can run it on my Arduino and provide output to you.

With regards Shourya

On 3/31/17, Devin Conley notifications@github.com wrote:

See if you can add print statements to identify the line that it is hanging on. I will try to get my hands on an Arduino Due

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/devinaconley/arduino-plotter/issues/13#issuecomment-290505627

devinaconley commented 7 years ago

Can you try running this?

#include "Plotter.h"

double x; // global variables
Plotter p;

void setup()
{
  Serial.begin( 115200 );
  Serial.println( "a" );

  p = Plotter(); // create plotter
  Serial.println( "b" );

  p.AddTimeGraph( "Some title of a graph", 500, "label for x", x ); // add any graphs you want
  Serial.println( "c" );
}

void loop()
{
  Serial.println( "d" );
  x = 10*sin( 2.0*PI*( millis() / 5000.0 ) ); // update your variables like usual
  Serial.println( "e" );
  p.Plot(); // plot all current data -- usually called within loop()
  Serial.println( "f" );
}
shouryasingh commented 7 years ago

Dear Devin,

Please find find below the video link for the sample program running on my PC which was sent by you :-

https://drive.google.com/file/d/0Bw7k2ZCMzF3kNUstQUZvT2hHSktscWdicEFRZDFHRS00OUNz/view?usp=sharing

As you can see there is no output on serial monitor.

With regards Shourya

On Sun, Apr 2, 2017 at 12:55 AM, Devin Conley notifications@github.com wrote:

Can you try running this?

include "Plotter.h"

double x; // global variables Plotter p; void setup() { Serial.begin( 115200 ); Serial.println( "a" );

p = Plotter(); // create plotter Serial.println( "b" );

p.AddTimeGraph( "Some title of a graph", 500, "label for x", x ); // add any graphs you want Serial.println( "c" ); } void loop() { Serial.println( "d" ); x = 10sin( 2.0PI*( millis() / 5000.0 ) ); // update your variables like usual Serial.println( "e" ); p.Plot(); // plot all current data -- usually called within loop() Serial.println( "f" ); }

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/devinaconley/arduino-plotter/issues/13#issuecomment-290941584, or mute the thread https://github.com/notifications/unsubscribe-auth/AKCwrwv0IzJD57hOsbbzHXJzPthUbOBvks5rrqSMgaJpZM4Mo_vY .

devinaconley commented 7 years ago

Okay, finally got hold of a Due and found the issue. Putting in a fix shortly

devinaconley commented 7 years ago

Pushed (2.3.0). Note the change in starting up the plotter in the examples.

Let me know if that works for you.

shouryasingh commented 7 years ago

Dear Devin,

Thanks for your kind efforts.

I am away from my PC currently for a small family vacation. I will return in two days and let you know the results.

With regards Shourya

On 08-Apr-2017 1:52 AM, "Devin Conley" notifications@github.com wrote:

Pushed (2.3.0 https://github.com/devinaconley/arduino-plotter/releases/tag/2.3.0). Note the change in starting up the plotter in the examples.

Let me know if that works for you.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/devinaconley/arduino-plotter/issues/13#issuecomment-292642124, or mute the thread https://github.com/notifications/unsubscribe-auth/AKCwr6mBDWLhKgG6FkesoXJxIiMwWc0nks5rtpr0gaJpZM4Mo_vY .

shouryasingh commented 7 years ago

Dear Devin,

Yes, now I am getting Plots on Listner.

I would like to Thank your for solving the problem related to Arduino Due Board.

Also if possible please know the debugging techniques used by you for Arduino programming. I am quite new to Arduino Programming and work generally on LabView Platform (which has got extensive debugging options).

Thanks once again for solving the problem.

With regards Shourya

On 4/8/17, Devin Conley notifications@github.com wrote:

Pushed (2.3.0). Note the change in starting up the plotter in the examples.

Let me know if that works for you.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/devinaconley/arduino-plotter/issues/13#issuecomment-292642124

devinaconley commented 7 years ago

Great, glad that's working now. Thanks for reporting this.

Unfortunately, I do not know of any proper debugging solutions for Arduino. I still rely on print statements and the gradual introduction of new code to identify problems.

Closing this as fixed.