I know there are many threads on this but I am very confused so if someone can help me out I will really appreciate it because nothing seems to work.
I wired a DD-WRT router (e1000) to arduino via serial and I want to pass data( like packages TX/RX) from the router to the arduino. Where shall I start? What is the logical sequence because for example when I login via the terminal (mac) to my router and try to echo to arduino nothing happens.
a bit of progress; with this code I am able to read and write from/to my terminal:
arduino code:
int incomingByte = 0; // for incoming serial data
void setup() {
Serial.begin(115200); // opens serial port, sets data rate to 9600 bps
Serial.write("Hi, I am alive!");
}
void loop() {
if (Serial.available() > 0) {
// read the incoming byte:
incomingByte = Serial.read();
Serial.print("I received: ");
Serial.println(incomingByte, DEC);
}
}
by using these commands on my terminal
to write: echo "Here I am" > /dev/tty.usbserial-A9007VSI 115200
to read: screen /dev/tty.usbserial-A9007VSI 115200
but when I SSH login to my router the above commands do not work,
when I try this command:
echo "Here I am" > /dev/tty.usbserial-A9007VSI 115200
when I SSH login in my router and I execute this command (in purple):
root@DD-WRT:~# ls /dev/tts/*
I get this:
/dev/tts/0 /dev/tts/1 /dev/tts/2 /dev/tts/3
are these the ports?
I tried all of the following from my router's login but I don't get anything on the arduino serial monitor:
echo "Here I am" > /dev/tts/0 115200
echo "Here I am" > /dev/tts/1 115200
echo "Here I am" > /dev/tts/2 115200
echo "Here I am" > /dev/tts/3 115200
thanks a lot for the response and the hints. do you see anything wrong with the wiring in the attached image. any suggestions on the 'echo' command or how else can I verify that my serial works?
I am using this level converter:
The op is right. DD-WRT has got several negative points, and this one is just one in a series. For starters, you can see that its not really an open source solution, even at the filesystem level, not even ipkg works as in open distros. I have spent by now several months trying to make a fon both, a wireless client bridge and being able to unbind the serial console without success. I have flashed several diferent distros but none of them allowed for both.
OpenWRT failed on the client bridge, whereas dd-wrt fails on the most basic thing, which is to allow for the console to be unbound.
thanks for the response. It is def a good option but I have a lot of code from other projects running on dd-wrt/e1000 which I guess I will have to modify for the open-wrt. If I won't find a solution with the dd-wrt, I will try open-wrt. I am just not that familiar with linux so the syntax might be wrong?thanks for any hints.