Arduino Yun (rev 2) - Serial communication between linux and arduino

Greetings,

A couple of weeks ago I got myself an arduino Yun - my first foray into the arduino world, with the intention to use it in my beer brewery.

So far I have used a Raspberry Pi for this, but i want to employ a TRIAC to regulate one of the heating elements and the timing in the Pi is not steady enough to do that.

I thought that a Yun could be perfect for this - receive power settings over the LAN and have the arduino take care of the timing and triggering of the TRIAC.

The TRIAC part of this works perfectly - no problem.

The problem arises when I used Bridge to communicate between linux and arduino. Bridge is too slow to fit in between the stuff the arduino has to do (using 50Hz AC power so a max of 10ms to do each transaction).

I disabled the Bridge and tried to use Serial1 on the arduino and /dev/ttyATH0 in Linux to send simple messages.

And here is my real question: I am able to read messages form the arduino on /dev/ttyATH0 in linux, but I am not able to send anything the other way. So far I have used minicom and normal "cat > /dev/ttyATH0" but there is no action on the RX/TX pins (using scope to check). When using Bridge the communication works both ways - no problem.

It might seem that I am not able to "open" the tty properly, but i get no error messages and I think that minicom should be able to open the port properly.

To recap - reading from the arduino to linux works perfectly - writing from Linux to arduino does not work. There is no action on the RX/TX pins when i try to write.

I am decent at C/C++ but I have no skills what so ever reading phython, and trying to dissect the Bridge code to find where the serial communications happens, to see how Bridge does it, has not borne fruits - yet...

Has anyone any idea what I am doing wrong or missing?

Regards
JP

I use Linux Mint and I have no trouble sending bytes to Arduino Uno and Arduino Pro Mini.
I use two FTDI USB-to-TTL adapters that I bought several years ago on eBay.

I am guessing the problem is in your code.

I should probably emphasize that when I talk about "linux" and "arduino" in my origianl post I mean the two different processors/controllers installed on the Arduino Yun.

USB is not involved as far as I know.

JP

I wasted money on Yun years ago (and it was a lot of money at the time), but it is sitting at the bottom of a drawer somewhere. For some unfathomable reason its designers decided to make the powerful Linux side subservient to the Arduino side.

IIRC it is possible to communicate with Python in the way you envisage but I can't remember how. I may have posted stuff in the Yi

These somewhat ancient links may give you some ideas.
Connect Yun to itself
Develop on your PC, Deploy on your Yun

...R

I have read both of those threads some days ago.
I briefly examined the code enclosed with "Develop on your..." some days ago and set out to look for something similar in the code for Bridge, but have not found anything so far.
bridge.py and the linked in modules only refer to stdin and stdout and that confuses me a bit since I so far have not found where and if stdin/stdout is linked to /dev/ttyATH0.

But I will look into the code enclosed and see if I can read and write to /dev/ttyATH0 in a decent manner - and get the results that i want.

Thanks so far.
JP

So...

I think it is as I suspected - the serial port on the linux side of the Yun was probably not properly set up.

After modifying the example provided in a previous post and running it, the serial port (/dev/ttyHTA0) was probably better set up. Starting minicom i was able to communicate both ways with the arduino side of the Yun.

I have to chart the plumbing in the python code and see if I can reproduce it in C.

Until further notice, i classify this as solved.

Thanks
JP