Problem running Gobetwino

MikMo:
I'm afraid i have no idea right now.

I do not have a Leonardo to try out.

Is there any known difference in the serial communication between the UNO and the Leonardo ?

Must be as there seems to have been a new serial function added in version 1.0.1 to support the Leonardo:

Lefty

This is my C# callback to open the serial port:

		private void btnConnect_Click(object sender, EventArgs e)
		{
			System.ComponentModel.IContainer components = 
				new System.ComponentModel.Container();
			port = new System.IO.Ports.SerialPort(components);
			port.PortName = comPort.SelectedItem.ToString();
			port.BaudRate = Int32.Parse(baudRate.SelectedItem.ToString());
			port.DtrEnable = true;
			port.ReadTimeout = 5000;
			port.WriteTimeout = 500;
			port.Open();

			readThread = new Thread(new ThreadStart(this.Read));
			readThread.Start();
			this.hardWorker.RunWorkerAsync();

			btnConnect.Text = "<Connected>";

			btnConnect.Enabled = false;
			comPort.Enabled = false;
			sendBtn.Enabled = true;
		}

With this, the C# application is able to receive data sent by the Arduino:

Text: #S|CPTEST|[]#
Text: #S|LOGTEST|[851;349;305]#
Text: #S|LOGTEST|[172;976;867]#
Text: #S|LOGTEST|[311;756;941]#
Text: #S|LOGTEST|[917;637;713]#
Text: #S|LOGTEST|[933;707;769]#
Text: #S|LOGTEST|[112;701;456]#
Text: #S|LOGTEST|[837;12;744]#

Hmmm.

I wonder if it is the dtr enable that makes it work ?

I wonder if it is the dtr enable that makes it work ?

Worth a try. I'll test it for you, if you create a new executable.

Guys i am starting to be somehow frustrated with this Leonardo board :frowning:

Tried to run MegunoLink, can t get live data...

Tried to run Fetch, cant get live data...

Don t know if this deserves a new thread....

Thanks for your help.

Don t know if this deserves a new thread....

Not yet. Lets see if we can't get GoBetwino working first. If so, then the change that needs to be made to GoBetwino probably needs to be made to the other classes you are having issues with.

You can then create new topics for each of them.

i will try to put the dtr enable in gobetwino, just give me a tiny little time :slight_smile:

MikMo sent me a link to the new version of GoBetwino to test. It works with the Mega, the Duemilanove, AND the Leonardo. I'm sure he'll be making it available for all, soon.

Ok so it was the DTR that should be enabled.

Thanks for testing Paul :slight_smile:

I will repackage GoBetwino ASAP.

There is also a little bug that was discovered recently that i will fix.

There is also a little bug that was discovered recently that i will fix.

While you're at it...

It would be nice to change the serial port, and have that close the existing port, if opened, and open the new one, without having to restart GoBetwino.

That is in 06 8)

I'm sure he'll be making it available for all, soon.

Wonderfull :slight_smile: Can t wait to try then.

Thanks.

And by the way, when fixed could you explain what was the problem(s)?

I would like to understand. And think other people would too.

Thanks again.

The Leonardo uses a different USB to Serial converter chip from other Arduinos. This one appears to need the DtrEnable flag (Data Terminal Ready) set in order for communications to occur.

My code had it; why I can not remember. MikMo's (and most other) code does not, because it has not been necessary, until now.

MikMo added it to his code. His code is now able to talk to the Leonardo.

It's time, I think, for you to open the other threads we talked about, mentioning your inability to communicate with the Leonardo. Reference this thread, so the fix needed is obvious. I'm sure that quick turnaround will be possible on the other code will be made, too.

Ok.

I will do that.

Thanks.

There is an updated version here:

I wil try now.

Thanks.

Check.

I ran the examples for working with CPFIL and LGFIL commands with Leonardo and it works perfectly.

Thanks a lot guys.

Go to this thread that will guide you to gobetwino home page to download the recent version of gobetwino:

http://arduino.cc/forum/index.php/topic,139721.0.html

Guys excuse my english..I'm very new to arduino stuff..

I have exactly the same problem that you had with the Leonardo but in my case still doesn't work..Even the samples for the commands LOGFL..

To be more specific..

My project is very simple..An arduino leonardo, a light sensor and a relay..I want to save into a text file or a cvs file the lightning values that the sensor measures every 2 seconds (for example)..I've downloaded the gobetwino that you suggested here for the Leonardo.I've made a txt file, but the only thing i get is that the "Serial port : COM8 opened at 9600 baud."

Here is my little code also in case that i've done something wrong..

#include <TinkerKit.h>
TKLightSensor sensor(I0);
TKRelay relay(O0);
int val =0;
//int countclosed=0;

void setup() {
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
}

void loop() {
val = sensor.read();
char buffer[12];
Serial.print("#S|LOGLIGHT|[");
Serial.print(itoa((val), buffer, 10));
//Serial.print(";");
Serial.println("]#");
//Serial.println(val);
delay(2000);

if(val<=550)
{
relay.on();
//++countclosed;
delay(2000);
}
else
{
relay.off();
delay(2000);
}
}

First i upload the sketch, then i open gobetwino(in the same port of course), but nothing happens..They seem not to communicate at all.
Thanks anyway, i'll be grateful if someone has any idea of what to do, or what i'm doing wrong..

Angelina.