Yun to labview TCP/IP wireless

Hi . I have connected my computer to my yun network. Am I able to use labview TCP/IP to communicate to Yun wirelessly? Has anyone done this before?

Please, don't double post. Continue the discussion here Arduino Yun to LabView - Arduino Yún - Arduino Forum

robotboy27:
Hi . I have connected my computer to my yun network. Am I able to use labview TCP/IP to communicate to Yun wirelessly? Has anyone done this before?

@robotboy27,
it appears you can use labview TCP/IP to communicate with the Yun wirelessly, but it is a real over kill for any purpose the Yun was designed for. I have not used the product, but I did read the literature.

What are your trying to do?

Jesse

Hi . What do you mean by over kill? What I would love to do is to control my arduino yun wirelessly using Labview GUI with TCP/IP . Do you know other ways I can control my arduino yun using this way?

robotboy27:
Hi . What do you mean by over kill? What I would love to do is to control my arduino yun wirelessly using Labview GUI with TCP/IP . Do you know other ways I can control my arduino yun using this way?

@robotboy27,
it depends on what you are trying to do, but typical development is to use CURL. It is a command line utility to send not just packets, but files, if needed. Otherwise, the YUN is a fully functional Linux box, so it can be configured as a server. You can login using ssh, or use the YunSerialTerminal to issue command, it also has a webserver running so you can use that. Or you can install your own set of tools.

Jesse

Oh so sorry . Right now I am using Yun's network . I am trying to communicate with my computer labview(client) to my yun (server). I tried to communicate using TCP/IP but no data was recieved nor sent out.Here below is what I have done . Please guide me on where am I wrong.

Here is the code I used for my yun
i change it a little from the example

#include <SPI.h>
#include <Ethernet.h>
#include<Console.h>
// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network.
// gateway and subnet are optional:
byte mac[] = {
0x90, 0xA2, 0XDA , 0XF0 , 0X24 , 0X23
};
IPAddress ip(192, 168, 240, 117);
EthernetServer server(3477);
boolean alreadyConnected = false; // whether or not the client was connected previously
void setup() {
// initialize the ethernet device
Ethernet.begin(mac, ip);
// start listening for clients
server.begin();
Bridge.begin(); // Initialize Bridge
Console.begin();

// Open serial communications and wait for port to open:
while (!Console);

Console.print("Chat server address:");
Console.println(Ethernet.localIP());
}
void loop() {
// wait for a new client:
EthernetClient client = server.available();
// when the client sends the first byte, say hello:
if (client) {
if (!alreadyConnected) {
// clead out the input buffer:
client.flush();
Console.println("HI");
client.println("Hello, client!");
alreadyConnected = true;
}
if (client.available() > 0) {
// read the bytes incoming from the client:
char thisChar = client.read();
// echo the bytes back to the client:
server.write(thisChar);
// echo the bytes to the server as well:
Console.write(thisChar);
}
}
}

I am unable to send nor receive . HELPP!!
I am getting error 63 and tcp open connection in untitled one

@robotboy27,

Okay. This common. You have a misunderstanding about the Yun. The answer below is a canned answer. It is not the question you asked, but it will answer many of your questions.

To be clear, you code shows that you have a misunderstanding. Please read the section below, it will help you get started in the right direction.

Again, there is a misunderstanding about how the Yun works. Read below.

But before you follow any of the steps below read the whole thing, and first read this:
Guide to the Arduino Yún

= [Q:] I cannot connect to My Arduino Yún. What do I do? =

First it's good to know, when Arduino Yun cannot find the AP you have set it for (like your home wifi), it has a script that puts it back into default SSID and AP mode.

Next, you may have already watched this video, but it's worth watching again. Pay extra attention to the part with the sketches.
Getting started with Arduino Yún - tutorial (6:53)

Then, read these short instructions. We (the volunteer support group) already know these steps by heart, so be familiar with the different reboot methods, and especially the 30+ second wifi reset. Also, not mentioned on that page, if you reset the Wifi/Linux part of the Yun, it will take from 2-8 minutes for the reboot. Lastly on this part, YOU MUST WAIT for the Linux portion to fully boot BEFORE YOU PRESS ANY of the REST buttons.
Resetting the processors (AR9331, WiFi, and 32U4)

'''Then start over''', plug your Yun into the USB port, run this sketch, and hit the ''Wifi Reset button'' (for 5-10 seconds). (See Image below for location of buttons.)

The ''YunSerialTerminal'' provides a simplified console access to the Linux part of the Yun. It works via the USB port (the one that powers the Yun - the microUSB). From there you'll be able to run a few commands to give us a better idea of problems.

Also, be ready with this sketch YunWiFiStatus. This sketch will help us see the status of your home AP. The sketch prints the wifi status to the console every 5 seconds or so. This sketch might seem familiar as it was in that first video link (above).

Let us know how it goes.
Post results from the YunSerialTerminal, if you are still having problems.
Please use markup when posting results. (See image below)

Lastly, if you are not familiar with Linux, you may want to read this:

Jesse

arduino_markup.png

hmmmm... but I have to set up a link from my arduino to labview using TCP/IP . How do I do it?

robotboy27:
Here is the code I used for my yun
i change it a little from the example

#include <SPI.h>
#include <Ethernet.h>
#include<Console.h>
// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network.
// gateway and subnet are optional:
byte mac[] = {
0x90, 0xA2, 0XDA , 0XF0 , 0X24 , 0X23
};
IPAddress ip(192, 168, 240, 117);
EthernetServer server(3477);
boolean alreadyConnected = false; // whether or not the client was connected previously
void setup() {
// initialize the ethernet device
Ethernet.begin(mac, ip);
// start listening for clients
server.begin();
Bridge.begin(); // Initialize Bridge
Console.begin();

What example did you start with? It looks like you made a LOT of changes. This will never work.

The code highlighted in red is for the Arduino Ethernet shield. The Yun's networking is completely different and the code in that library cannot be made to work with the Yun.

On the other hand, the code highlighted in blue is from the Yun's Bridge library, and is the correct code to use.

Step 1: pretend that anything in the standard Ethernet or WiFi libraries doesn't exist - they will not work with Yun.

Step 2: read up on the Yun Bridge Library, everything network related goes through that library.

Step 3: specifically study the YunServer and YunClient classes, they are the closest to the server and client objects you used in your sketch.

A little more information:

I think the code IN THIS POST is close to what you posted above, and might be a starting point for you.

This may also be helpful: Beginner's Introduction to Yun Web Services

robotboy27:
hmmmm... but I have to set up a link from my arduino to labview using TCP/IP . How do I do it?

@robotboy27,

I'm not being clear. YOUR CODE is NOT correct. You are using libraries that are intended for use the Leonardo, the Uno and others. The Yun is different. You need to use a different library or send the data to the Linux side to be able to see your data.

USING labview will get you nothing because your code is written wrong. Please watch the videos provided.

Jesse

Alright . Wow I did not know that . Sorry the Yun is so confusing . Thank you guys . So if I changed my codes , TCP/IP labview will be able to read it right?

robotboy27:
Alright . Wow I did not know that . Sorry the Yun is so confusing . Thank you guys . So if I changed my codes , TCP/IP labview will be able to read it right?

@robotboy27,
if you insist on using labview, you can; but it is an overkill. You should be able to write an application in an hour or so, if you start from one or the tutorials.

I have to ask again, what are you going to use labview for?

Labview is not intended for application development. It is a tool for network analysis. This is like using a pair of paper scissors when you only need a sewing needle.

Jesse

Oh I am using labview as my GUI . What I am doing is building energy management system. And my teacher wanted it to be wireless so I have no choice that I will have to use TCP/IP. All I want is to use it to turn on a relay using my Labview GUI . That's what I have to do.

robotboy27:
Alright . Wow I did not know that . Sorry the Yun is so confusing . Thank you guys . So if I changed my codes , TCP/IP labview will be able to read it right?

I don't know about that, I haven't used Labview in 20 years, and it was only a cursory use back then over GPIB, not a network. I don't know what's involved in getting Labview to talk over a network.

But I do know how to get the Yun to listen for incoming connections from other computers, and that's what the code I linked to earlier does. Making the connection is only half of the battle, understanding the Labview protocols and commands is the bigger part of it. I'm sorry, but you're on your own there.

jessemonroy650:
Labview is not intended for application development. It is a tool for network analysis.

I think you're thinking about the wrong product? Labview is a graphical programming environment designed for analytical instrument control and data collection. While it can communicate with instruments over a network, it is not a networking tool.

You better build an html webapp as GUI. Its easy and Yun can serve it.

Yeah I wish I could . But my teacher wants it in LabView . So now I am having a lot of problem understanding TCP/IP in Labview . I do not know how to link them . All I know is I will have to make codes for arduino and make a client TCP for Labview. But I am no way near there . :frowning:

robotboy27:
Yeah I wish I could . But my teacher wants it in LabView . So now I am having a lot of problem understanding TCP/IP in Labview . I do not know how to link them . All I know is I will have to make codes for arduino and make a client TCP for Labview. But I am no way near there . :frowning:

@robotboy27,

I understand now. I thought this might be the case. Teachers understand theory, not pratice. Don't tell youd teacher I said he was a fool. Come back as often as you need to get this done.

Use the Bridge example from your laptop

Once you have it working, which should be an hour or two, then try to do the same on Labview.

Jesse

ShapeShifter:
::::SNIP::::

I think you're thinking about the wrong product? Labview is a graphical programming environment designed for analytical instrument control and data collection. While it can communicate with instruments over a network, it is not a networking tool.

@ShapeShifter,
Yep, we are talking about the same thing with different words again. I said it was in #12
It is a tool for network analysis.
I have marked that section for you. :wink:

Jesse

jessemonroy650:
@ShapeShifter,
Yep, we are talking about the same thing with different words again. I said it was in #12
It is a tool for network analysis.
I have marked that section for you. :wink:

Jesse

But Labview IS NOT a tool for network analysis!

From http://www.ni.com/labview:

LabVIEW System Design Software

LabVIEW software is ideal for any measurement or control system, and the heart of the NI design platform. Integrating all the tools that engineers and scientists need to build a wide range of applications in dramatically less time, LabVIEW is a development environment for problem solving, accelerated productivity, and continual innovation.

I certainly don't think the teacher is a fool for trying to teach an appropriate instrumentation control system. Easily controlling equipment (and collecting data from it) is what it's designed to do.