using tx and rx pins in the arduino board !

Hi
what data i can have if i connect TX RX pins in the arduino board with TX RX ports in the router !

i am thinking to connect the router with arduino+LCD 16*2 display
without Ethernet sheld or anything

or i must use other pins to show up the data!
IP and bandwidth or cpu usage

anyway i changed the firmware to DD-WRT

narzan:
what data i can have if i connect TX RX pins in the arduino board with TX RX ports in the router !

Which router? Which Tx/Rx ports?

If Tx/Rx are Ethernet ports, you're not going to get anything useful.

If they are pins from a serial port, it will depend on whether they are RS-232 or logic level. You may need an adapter.

If they are from a USB port, then you won't get anything with a USB to serial adapter (commonly called an FTDI cable.)

What software is the router running? If it's running a built-in proprietary firmware, then whatever the type of port you're not that likely to get any useful information. If you're running an aftermarket firmware (DD-Wrt, OpenWrt, Tomato, etc.) then the data you get is whatever you program the router to do (those are Linux based firmware images, and you will write shell scripts or similar to send whatever data you want out the serial port.)

So, too many outstanding questions to be able to give any answers. More details are needed.

TP-LINK wr740n
with DD-WRT ready on it
i want use these ports in red
i think shell command or special scripts not have any control on these ports!!
anyway i flashed the router from the same ports

narzan:
anyway i changed the firmware to DD-WRT

Hmmm... I didn't notice this before. Is this the edit that was made a couple minutes before I posted?

So, assuming Rx/Tx are a TTL level serial port, what you get out of the port depends on the script you write to send the data out the port. But it should be a do-able project.

First, you need to figure out what data you want to send, and then come up with a format for the data that is easy to parse, and easy to format.

Next, you need to write the code to send out the data from the router. You will probably find a lot more help for that on the DD-Wrt forum than you will find here.

Finally, you need to write the code on the Arduino ti read the data, decode it, and put it on the display.

The simplest protocol is probably to put most of the the intelligence on the router end. If you have a 16x2 display, write the code on the router to get the data you want (can be just about anything) and format it as the desired display data. Then the Arduino code just needs to read in the data, look for line breaks, and send it out the display.

The difficulty comes in if you want to have some buttons on the Arduino to control what is displayed. In that case you have to send the button press info to the router, and have that code format different data.

The alternative is to have the router send all of the data all of the time. The Arduino then has to be able to figure out which data is which, and format the correct display depending on which code is to be displayed.

All in all, it might be easier to have the router send pre-formatted displays, and do most of the work in the router, with the Arduino being just a dumb display driver.

Hmm... we keep typing at the same time...

It looks like those pads might be a logic level serial port. Might be a very doable project.

An AR9331, huh? You'll end up with something very similar to an Arduino Yun (basically a Leonardo talking to a single port Ethernet AR9331 router with Wifi.) You might get some ideas from the Yun sub-forum here. (Of course, you won't have access to the Bridge library, which makes inter-operation between the two processors so easy.)

I would poke around on the DD-Wrt forum, looking for information on using that serial port. Ask questions there if necessary. That will be your best bet on figuring out the details on that port, and how to access it from the Linux side.

Over here will be the best resource how to use your Arduino to access that information.

Basically, it's a matter of developing compatible code on both sides, with the two processors talking to each other over a serial port. Definitely can be done.

One thing to keep in mind is that the AR3391 probably runs on 3.3 volts, or less. Most Ardinos run at 5V. You will probably need a level converter between the two processors. Or, if the AR3391 is at 3 volts, use an Arduino that runs at 3.3 volts: they are not as fast (usually 8 MHz instead of 16 MHz) but if all you are doing is reading serial data and sending it to an LCD, that shouldn't be an issue.

narzan:
i think shell command or special scripts not have any control on these ports!!

Hmmm... I didn't notice this line the first time around... Are you making more edits on me? :wink:

I have DD-Wrt on a couple routers, but I have to admit that I never tried accessing a serial port on them.

I have a few Yuns which also have an AR3391, and they run OpenWRT. The serial port there can be accessed from C or Python, but you have to load the PySerial package.

I've not installed any packages on DD-Wrt. I assume it has a facility like opkg or apt-get. Is Python and PySerial available on DD-Wrt? If so, you're all set. Their forum would be be the place to find out.

There must be a way to access the serial ports. OpenWRT can't be the only variant that has it. Search the DD-Wrt forums and web site. It must be there.

anyway i changed the firmware to DD-WRT

no was from the beginning :stuck_out_tongue:

The difficulty comes in if you want to have some buttons on the Arduino to control what is displayed. In that case you have to send the button press info to the router, and have that code format different data.

oh :o !!! its seems more difficult than what i think

oh god i am trying to escape from shell commands and you just want me back,
actually all what you said is true, it's like a high five on my face lol

your answer is amazing :o thanks

what about this little guy
http://store.worldstart.com/product/5281

is there any way to use it as Ethernet shield for arduino uno ! directly without anything else !

narzan:
no was from the beginning :stuck_out_tongue:

OK, I'm blind. Or just not paying attention. Nether one is a surprise. :-[

oh :o !!! its seems more difficult than what i think

It doesn't have to be. Start simple and get more complicated as you figure it out. Start by writing a script on the router to send "Hello World" and receive it on the Arduino, then put it on the display. Then expand from there.

oh god i am trying to escape from shell commands and you just want me back

Sorry. Whatever you do, you're going to have to write something on the Linux side. Maybe it won't be a shell script if you can do Python, but you're going to have to do more than some trivial programming on that side. I don't see any way to get around it.

OK, I see one way: If there isn't one there already, set it up so there is a CLI running on that port so you can log in. Then write all the code on the Arduino side to log into the port, and keep issuing all of the commands you need to get the information you want. Then parse the responses to extract out the important data, format it, and put it on the display. You're still going to have to figure out which Linux commands to issue, and might still be writing scripts. But that's the harder way to do it. Trust me, it's going to be easier to issue all of the commands and parse the results on the Linux side and send just the pre-digested information to the Arduino.

narzan:
what about this little guy
http://store.worldstart.com/product/5281

is there any way to use it as Ethernet shield for arduino uno ! directly without anything else !

Nope. The Uno has a USB device port that is expected to be plugged into a host PC. It cannot act as a host and have a device plugged into it.

I suppose you could add a USB host shield, and plug the adapter into that. But then you have to worry about talking to that device, I highly doubt there is a library or driver that supports talking to that device from an Arduino. You would be better off just using an Ethernet shield - there's definitely support for that.

But what will that buy you? You'll have an Ethernet connection to the router, but you will still need a way to get access to the information and get it to the Arduino. You'll still have to do some scripting or similar commands on the Linux side to get the information to be sent, then package it up to go to the Arduino. And then write code on the Arduino side to receive and decode it. It seems to me that it accomplishes nothing but adding overhead and complexity for no net gain.

I suppose you could add a USB host shield,

so all my nightmares come in one project :slight_smile: ! , anyway that's will be more easy
and yup i must wright a driver for the Ethernet device too,

But what will that buy you? You'll have an Ethernet connection to the router, but you will still need a way to get access to the information and get it to the Arduino

i think that's will be more easy in both sides, if the connection was over Ethernet, small shell command can do it, i was working on that last year to make routers send the data to a website, i dont know if that will be easy with aruino!

my project is more difficult and i think i must work on it years, because what i want actually is a router and home automation a small thing control all the home and show up all the data, i finished a lot of parts , but the part of making all these devices talking with each other make me want to throw everything, but that's the only way to make it smart system hmm

anyway thanks you gives me a lot of information and my head want explode now :cry:

narzan:
so all my nightmares come in one project :slight_smile: ! , anyway that's will be more easy
and yup i must wright a driver for the Ethernet device too,

Now there's the right attitude! Go for it... You can do it! :smiling_imp: LOL!

my project is more difficult and i think i must work on it years, because what i want actually is a router and home automation a small thing control all the home and show up all the data, i finished a lot of parts , but the part of making all these devices talking with each other make me want to throw everything, but that's the only way to make it smart system hmm

Seriously, take a look at the Yun. It's pricey, but it's essentially a Leonardo and an AR9331 router in one, with a bunch of custom software to make communications easy between the two processors and to other computers over the network. A lot more powerful than an Uno with an Ethernet shield - a whole 'nother class of power.

You could have these boards sprinkled around, talking over the built-in WiFi or Ethernet. The Linux side handles the network, web server, and other services, while the Arduino side does the real time I/O and device control. It's got lots of potential. Not the cheapest way, but you'll save lots of time and aggravation on the communications and network services end of it. But of course, it would put the final fatal blow to your dream to get away from shell scripts...

Seriously, take a look at the Yun. It's pricey, but it's essentially a Leonardo and an AR9331 router in one, with a bunch of custom software to make communications easy between the two processors and to other computers over the network. A lot more powerful than an Uno with an Ethernet shield - a whole 'nother class of power

i never think to use that :roll_eyes: i will look on it

hmm i think raspiry-pi will add more option to this project too
thanks dude :slight_smile: looooool you make me smile i hope i can do it :smiley:

A Raspberry Pi will have a more powerful Linux processor than the Yun, as well as HDMI video and some other interfaces (which may or may not be useful to your distributed nodes.) It will run a full Linux distro, as opposed to the Yun which runs the more limited OpenWRT, which is quite similar to the DD-WRT with which you are already familiar. The Yun, on the other hand, has a built in WiFi radio, an on-board Arduino Leonardo, and customizations that make it easy to communicate between the two on-board processors and to other computers on the network.

If you need the extra horsepower, go with the Raspberry Pi (or even a BeagleBone Black.) If you want the easy integration with the Arduino environment, go with the Yun. They are complementary products, with their own strengths and weaknesses. Neither one is a replacement for the other.