Arduino Yún software works on my TP-LINK WR703n!

It works! :slight_smile:
But I think Arduino Yún's bridge is very bad because it will use the main tty...So I just can use SSH...
I connect my 703N to mega,UNO is able to connect to 703N!
That's how do I make the Arduino Yún works:http://www.tonylianlong.com/?p=135

Maybe nice to make the image available?

Yes, which image did you use? One of the ones at the Linino repository? Does your WR703 have the stock 4MB of flash or have you upgraded?

The bridge doesn't start on Linino until the AVR asks for it, until it is started you can use the /dev/ttyATH0 as a console. Here is a snippet from the Bridge library on the AVR that looks like it will close the bridge:

// Bridge interrupt:
    // - Ask the bridge to close itself
    uint8_t quit_cmd[] = {'X', 'X', 'X', 'X', 'X'};
    max_retries = 1;
    transfer(quit_cmd, 5);

    // Bridge startup:
    // - If the bridge is not running starts it safely

I haven't tried it but it looks like you can just send XXXXX to the bridge on Linino and it will shut down.

I am making the firmware for 703N,just wait!

Yes, which image did you use? One of the ones at the Linino repository? Does your WR703 have the stock 4MB of flash or have you upgraded?

TP-Link tl-wr703n has 4Mb of flash and 32M of RAM,but I change the flash and RAM by myself,so it has 16Mb of flash,64Mb of RAM now,it is the same as Arduino Yún.
I use this firmware:

It supports my 16Mb flash.
I change the file called /etc/opkg.conf when I want to install some yún packages.

The bridge doesn't start on Linino until the AVR asks for it, until it is started you can use the /dev/ttyATH0 as a console.

Sorry,I don't know what /dev/ttyATH0 is,I just know /dev/ttyS0 is 703N's main tty and /dev/ttyACM0 is my Arduino(UNO).
But bridge can still work!
I connect my Arduino to my PC which has ubuntu system,then I see "run-bridge",then I think the arduino is going to control my 703N using the main tty,then I get a big surprise.
The bad thing is that I change the /usr/bin/run-avrdude file to use the USB to burn my Arduino,but you know,the Arduino's usb chip(AVR?) connect to Arduino TX and RX,and Arduino TX and RX connect to my 703N!So when I want to burn the program to my Arduino by 703N,I have to remove the TX and RX between my Arduino and 703N,that's pretty bad!
I know the real Arduino Yún using SPI(linuxgpio) to burn program to Arduino,but I think it's not a good way to connect my Arduino and 703N using SPI because I think USB is more useful than the linuxgpio.
Can you give me some advice?My English is too bad...

/dev/ttyATH0 is the "main" tty on the Yun, apparently /dev/ttyS0 is the same on your box.

To upload sketches through USB to a arduino on /dev/ttyACMx see this http://forum.arduino.cc/index.php?[topic=191564.msg1416166#msg1416166](http://topic=191564.msg1416166#msg1416166) you can ignore the stuff about pureftp I have since realized scp or sftp are better. The scripts are what you need.

Run-avrdude programs the arduino through its icsp connection and ar9331 gpios using linuxgpio as the programmer.

noblepepper:
To upload sketches through USB to a arduino on /dev/ttyACMx see this http://forum.arduino.cc/index.php?[topic=191564.msg1416166#msg1416166](http://topic=191564.msg1416166#msg1416166)

I know that,it works on my device.But look,if I want to burn the program to arduino by 703N,my 703N will use Arduino's TX and RX,because of the bridge,I have to connect Arduino's TX and RX to 703N,that means 703N will send command to /dev/ttyATH0,that's itself!Then I will get "avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Recv: . [ff]
avrdude: stk500_getsync(): not in sync: resp=0xff
avrdude: Send: Q [51] [20]
avrdude: Recv: . [0a]
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x0a
",so when I want to burn program to the Arduino,I have to remove the wires between Arduino's TX and TP_IN,Arduino's RX and TP_OUT(that's /dev/ttyATH0),it's too bad,can you give me some easier ways?

And,my 703N connect to my Arduino UNO,not leonardo!It's different from leonardo because it just has a pair of UART!If I want to use bridge,I can't use serial again!Do you know how to solve this problem?

cow77:
Maybe nice to make the image available?

Look this:
http://www.tonylianlong.com/?p=135

I'm not sure I understand exactly what you are trying to do. Are you wanting to upload a sketch from your TPLINK to the Uno or from your host computer to the Uno?

Yes, the bridge talks over the Serial1 connection on the Yun or Leonardo, and Serial on other Arduino's and Serial on the Uno is what feeds the USB so you will lose the USB when you use the bridge on Serial. I haven't played with how to deal with this, I have always used a Mega2560 or Due since they have more serial ports available to use for the Bridge.
This bit in bridge.cpp is where it does this:

// Bridge instance
#ifdef __AVR_ATmega32U4__
// Leonardo variants (where HardwareSerial is Serial1)
SerialBridgeClass Bridge(Serial1);
#else
SerialBridgeClass Bridge(Serial);
#endif

Jantje's posts and blog might give you some hints I believe he has done similar things if you want to use the Serial and Bridge without rewiring.

tonylianlong:
Can you give me some advice?My English is too bad...

I'm sorry but I don't really understand the problem.
If I look at your website it looks like your arduino mega is connected via USB to the modded TP-LINK WR703n.
As avrdude is part of Linino you should be able to upload your sketch to the mega with avrdude.
As I explain on my blog http://blog.baeyens.it/#home: Before you can do so you need to install some other stuff
opkg install kmod-usb-acm
After this installation and with a arduino connected you should see /dev/ttyACM0
Use this port with avrdude to upload to the arduino.
see this post Flashing other Arduinos with a Yun - Arduino Yún - Arduino Forum
I hope this helps
Jantje

Jantje:

tonylianlong:
Can you give me some advice?My English is too bad...

I'm sorry but I don't really understand the problem.
If I look at your website it looks like your arduino mega is connected via USB to the modded TP-LINK WR703n.
As avrdude is part of Linino you should be able to upload your sketch to the mega with avrdude.
As I explain on my blog http://blog.baeyens.it/#home: Before you can do so you need to install some other stuff
opkg install kmod-usb-acm
After this installation and with a arduino connected you should see /dev/ttyACM0
Use this port with avrdude to upload to the arduino.
see this post Flashing other Arduinos with a Yun - Arduino Yún - Arduino Forum
I hope this helps
Jantje

noblepepper:
I'm not sure I understand exactly what you are trying to do. Are you wanting to upload a sketch from your TPLINK to the Uno or from your host computer to the Uno?

Yes, the bridge talks over the Serial1 connection on the Yun or Leonardo, and Serial on other Arduino's and Serial on the Uno is what feeds the USB so you will lose the USB when you use the bridge on Serial. I haven't played with how to deal with this, I have always used a Mega2560 or Due since they have more serial ports available to use for the Bridge.
This bit in bridge.cpp is where it does this:

// Bridge instance

#ifdef AVR_ATmega32U4
// Leonardo variants (where HardwareSerial is Serial1)
SerialBridgeClass Bridge(Serial1);
#else
SerialBridgeClass Bridge(Serial);
#endif





Jantje's posts and blog might give you some hints I believe he has done similar things if you want to use the Serial and Bridge without rewiring.

Oh,I don't know how to introduce this problem,but now I fix it,so it works and I feel good now.
Look this page:http://www.tonylianlong.com/?p=135