Are there serial pins on the expansion dock?
I'd like to link Omega with Arduino via serial and establish TTY communication between two. The Arduino drives RGB LED strip that talks WS2812. For now, Omega does not have NeoPixel lib, so have to use Arduino for this purpose.
I have 5V power source what I have connected to the expansion board's 5V and GND pins.
But where are the serial TX RX pins on the expansion board? Do I have to squeeze wires in the Omega dock headers to get them? Or perhaps I can supply 5V directly to the Omega, without the expansion dock?
@Pavils-Jurjans The Expansion Dock does not break out the Serial TX & RX pins since they are in use with the USB-to-Serial chip that provides serial terminal access.
Theoretically, you could squeeze in wires to the RX and TX pins and hook them up to the Arduino's TX and RX pins. I've never personally tried it so proceed with caution and at your own risk!
May 13, 2016: using correct pinout diagram:
Just make sure that the Arduino and Omega share a common ground, and that there is no serial traffic coming to the Omega via the micro usb. This can be achieved either by using a power-only usb cable, or jumping wires from the 5V and GND pins on the Arduino to the 5V and GND pins on the Expansion Dock (takes care of both issues).
You'll also have to disable the serial terminal, open
/etc/inittaband comment out the
::askconsole:/bin/ash --loginline (just add a
#to the beginning of the line), and then reboot your Omega.
Let me know how it goes!
Ok, well, inching towards (hopefully) success.
I've squeezed the TX and RX wires in the Omega's docking headers, and connected them to Arduino's RX and TX pins, respectively. And the GND's, of course, are connected.
Since the USB cable is not attached, there's no need to deal with conflicting serial traffic.
I've installed screen command on the Omega:
$ opkg update $ opkg install screen
Now, I fail to establish successful comms with Arduino. Under the /dev, there are three tty entries:
tty ttyATH0 ttyS0
I can connect only to the ttyATH0, any attempt to connect to others fails:
$ screen /dev/ttyATH0 9600
I get blank screen and try to type but the Arduino does not seem to receive anything. I have set up simple echo program on the Arduino that just writes back any character it receives.
I think the
/dev/ttyS0is the one I should connect to, but I can't get the connection to work:
$ screen /dev/ttyS0 9600 /var/run/utmp: No such file or directory [screen is terminating]
It could well be that the problem is at the Arduino end, but I can't come up with idea how to diagnose it. At least, I know the Arduino part works if I communicate with it via USB serial.
@Pavils-Jurjans right, i forgot to mention, it will definitely be
/dev/ttyATH0, I've actually tried this on the Arduino Dock.
Try setting the Arduino sketch to use 115200 baud and just to print characters to the serial. Then on the Omega, run
screen /dev/ttyATH0 115200. You should see the characters coming in from the Arduino.
Well, no luck for now.
I ran the screen command as you say, but no characters, just blank screen.
root@Omega0:/dev# screen /dev/ttyATH0 115200 /var/run/utmp: No such file or directory [screen is terminating]
Before the blank screen appears, the "No such file or directory" error is output (see below), perhaps that has something to do with it? I went ahead and did
root@Omega0:/dev# touch /var/run/utmp
after what the "No such file or directory" error disappears.
I connected the Arduino's RX and TX wires to see if the comms failure is at the Arduino's end, but this loopback test was successful. I did the same with the Omega's RX and TX wires, and at first it did not work. The device even failed to reboot. If I disconnected the RX and TX pins, it booted up ok, and connecting them afterwards resulted in successful loop back test.
Hmm, are you sure your pin layout diagram is correct? In despair, I connected the top right 5th pin (TX in diagram) to the Arduino Micro TX pin (3rd from the nearest corner), and the RX-RX respectively, and got the comms working!
Shouldn't then the 5th pin in the diagram be RX and 6th pin TX?
@Pavils-Jurjans that seems odd, since the Omega uses these pins when connected to the Expansion Dock or Mini Dock to communicate with the USB to Serial chip to provide the serial terminal.
Can you send a photo of the working setup?
Here's a lousy photo:
The TX wire connects the Arduino's 3rd leftside pin to the Omega's 5th pin (counting from the right side);
The RX wire connects the Arduino's 4th leftside pin to the Omega's 6th pin (counting from the right side);
The wire labels are linked to the Omega's diagram. The "problem" is, though, that the Arduino's 3rd pin is TX, and 4th is RX.
@Pavils-Jurjans I don't know a lot about the TX/RX pins, but one thing that strikes me from your photos is that I don't see any common ground connection between the Omega and the Arduino - it may be off shot, but will definitely be needed
Of course, the ground must be common for all the connected devices (the power source, RGB LED strip are off shot). They wouldn't work, if the ground would not be connected, and there's a good chance to fry stuff that way.
It's amazing the power of comunicating arduino and omega, but I have a situation I don't understand. Probably I'm missing something :-)
I've connected my arduino with omega this way:
ard tx -> omg tx
ard rx -> omg rx
ard vin -> omg 5v
ard gnd -> omg gnd
Then I ssh omega and "screen /dev/ttyATH0 115200" (I configured arduino serial to 115200 to).
Then everything works fine. I receive some data from my dht11 connected to arduino.
So I had the idea of cutting a USB cable and wiring omega usb to arduino this way:
omg usb 5v -> ard 5v
omg usb gnd -> ard gnd
omg usb d+ -> ard tx
omg usb d- -> ard rx
I've tried "usb d+ -> ard rx" and "usb d- -> ard tx" too.
And when I "screen /dev ttyATH0 115200" on my omega I get nothing.
So my question is: Should I receive something? Am I doing something wrong? Any Idea? :-)
Cutting the USB cable and connecting the USB data lines to the Arduino serial pins will not work since the USB data lines will be communicating in the USB protocol and the Arduino will be expecting a simple serial protocol.
The Expansion Dock (and Mini Dock) have a USB-to-Serial chip between the microUSB port and the Omega that converts the protocols.
@Lazar-Demin Thanks for the info... I was suspecting something like that :-)
Yep, we've updated the Pinout diagram to fix where the Serial RX and TX pins are found.
I've gone back and updated my post above.