UDP supported?

Thank you once again. I have tried your code that uses the Yun Bridge and it works. I am using it to control my Wi-Fi lights and to retrieve the reply sent by the Uno controlling them.

Without your help I would have given up long ago. I have learnt a lot about the Yun with your help.

Regards, Richard

Hey, been following this trying to get it to work, and I think I'm very slowly understanding this.

I've got nano /mnt/sda1/udp.py to run, and that's to edit a file on the sd card right? To do that I need to use

export TERM='xterm-color'

To stop the error

Error opening terminal: xterm-256color.

So it opens fine, but when I try and write the next line of code I get [ Error writing /mnt/sda1/udp.py: No such file or directory ]

Have I just done something really silly somewhere?

Thanks! John

vi /etc/profile
export TERM=xterm-colo

exit ssh then relogin


Plan B:

Start from fresh (backup your own file!):


If I try

vi /etc/profile
export TERM=xterm-colo

I get

rt TERM=xterm-colo                   
[ -f /etc/banner ] && cat /etc/banner
export PATH=/bin:/sbin:/usr/bin:/usr/sbin                             
export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6)
export HOME=${HOME:-/root}
export PS1='\u@\h:\w\$ '
[ -x /bin/more ] || alias more=less                
[ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi
[ -z "$KSH_VERSION" -o \! -s /etc/mkshrc ] || . /etc/mkshrc
[ -x /usr/bin/arp ] || arp() { cat /proc/net/arp; }           
[ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }
I /etc/profile [Modified] 2/16 12%

and every time i enter it increases both sides by 1, 3/17 etc And I'm still getting the error no file or directory. Thanks!

Plan B: ...

That was after trying plan b.


uname -a
vi /etc/profile

modify file:

export PS1='\u@\h:\w\$ '
export TERM=xterm-colo

Plan C:

Upgrading the Linino image on the Yún


On it now!
Thank you so much for taking the time to help me!

Okay, so nothing to reset is coming up on the arduino.local page. I used my computer to put the file on the SD card. The SD card is called SD and I put the file in the root folder

EDIT: Tried using terminal too, same message as before, no such file or directory

Re: Problem with microSD

PC is no needed for helping create file or directory at linino.

Next issue ,followed the steps in that link, I can't see the sd coming up with fdisk -l. Just keep asking if I specified it correctly.

Looking at this link I think it may be faluty.


Going to try this all with a flash drive... I read they mount in similar ways, so thinking that should work the same?

Tried with the USB flash drive and I can now write the lines of code! (success) but when I try and run it I now get permission denied! (aww)

Any ideas?

chmod 755 run.py

Awesome, I can receive the G over on another laptop running Max, woo. Now I'm trying to send 4 analogue pins over it (and ideally a couple of digital things, but not essential at the moment). Looking into bridge etc, but I can't work out how to get it from the arduino sketch into the python sketch (then onto Max). I'm guessing that I'll need to change MESSAGE into something? Again, thankyou!

Sorry to be that guy, but I feel like I'm so close to having it working!!

To try and get serial input to be posted straight out of the python sketch, it now looks like this:

import socket
import serial

ser = serial.Serial('/dev/ttyATH0', 9600)

while ser.readline() != 'A':
#   do nothing

UDP_IP = ""   #Max IP address
UDP_PORT = 8888
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # UDP

data_raw = read(8) #read 8 bytes
sock.sendto(bytes(data_raw), (UDP_IP, UDP_PORT)) #sends the byte
#recvmsg=sock.recv(1024) #read response
#print recvmsg

Was getting an indent error (now fixed), but now it seems to run perfectly, but doesn't put anything out into udp...

Thanks again..

I have a general question about developing on the Yun using Python.

If my Python code has an error in it then how can I see the error messages?

I can test the Python code in Python on my iMac but there appear to be differences in the syntax so I could still get an error when the code is run on the Yun.

Yun's python version:

python  -V
Python 2.7.3

My iMac's python version:

python  -V
Python 2.7.5

The differences in the syntax should be very minimum if it exists.

Python’s community is vast:


I am running v3.4 on my iMac. Yesterday I tried going back to v2.7 and for some reason I couldn't get it to run any of my Python code.

Is there any way to see errors in the Python code on the Yun?