User Tools

Site Tools


yun_reset

This is an old revision of the document!


YUN Topics

YunSerialTerminal

One difference is that to enable public key based authentication for root, the authorized public keys need to be
 added to the following file (and not the usual /root/.ssh/authorized_keys):

vi /etc/dropbear/authorized_keys
chmod 0600 /etc/dropbear/authorized_keys

A complete tutorial for setting up public key based authentication on OpenWRT can be found here.

UNIX examples - many hacks

OSX Fuse - SSHFS

YUN websockets server

Yaler Example

Websockets Client

Download libwebsockets:

https://www.dropbox.com/s/r4lx1etrdaadc3o/libwebsockets_2014-03-01-388dc7d201d8d123841869fb49ec4d94d6dd7f54_ar71xx.ipk?dl=0

Download libwebsockets-examples:

https://www.dropbox.com/s/yt55xof23nte802/libwebsockets-examples_2014-03-01-388dc7d201d8d123841869fb49ec4d94d6dd7f54_ar71xx.ipk?dl=0

Dev Tools on YUN

Dev Tools and Web Server Hacks

Extending Disk Space

Insert a microSD card and run the Expanding Space sketch
Install binutils so you have a linker, without this gcc is pretty useless

opkg update
opkg install binutils


Install make if you plan on using Makefiles

opkg install make


Install the yun-gcc package using a cached location for the downloaded file, this can take 15 to 20 minutes so be patient:

opkg -t /root install yun-gcc

Reset Password

So the problem is that you've lost your password?
Two workarounds:


    start the yun and wait a minute, load the yunserialterminal example, 
    open the serial monitor, press enter and see the prompt, type "passwd" 
    without the double quotes and change your password

    start the yun and wait a minute, the press and hold the reset button for 
    about 40 seconds (it's on the side, near the USB connector)
    

packages

oot@showcontroller:~# df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
rootfs                    7168      3336      3832  47% /
/dev/root                 7680      7680         0 100% /rom
tmpfs                    30560       148     30412   0% /tmp
tmpfs                      512         0       512   0% /dev
/dev/mtdblock3            7168      3336      3832  47% /overlay
overlayfs:/overlay        7168      3336      3832  47% /
root@showcontroller:~# opkg install ./libwebsocket-examples.ipk
Installing libwebsockets-examples (2014-03-01-388dc7d201d8d123841869fb49ec4d94d6dd7f54) to root...

Bridge Library and Examples

run-sysupgrade /mnt/sda1/openwrt-ar71xx-generic-yun-16M-squashfs-sysupgrade.bin

The output on the console will look like this:

run-sysupgrade /mnt/sda1/openwrt-ar71xx-generic-yun-16M-squashfs-sysupgrade.bin
Sending TERM to remaining processes ... uhttpd dbus-daemon dnsmasq avahi-daemon thd ntpd uSDaemon sleep syslogd klogd hotplug2 procd ubusd netifd
Sending KILL to remaining processes ...
Switching to ramdisk...
Performing system upgrade...
Unlocking firmware ...

Writing from <stdin> to firmware ...    
Upgrade completed
Rebooting system...
name seems to be in /tmp/resolv.conf.auto
nameserver <gateway router> such as 192.168.1.1
Install php5-mod-sqlite3 - 5.4.17-1, And of cource the other PHP modules you need

Example php5

     db=new SQLite3("/mnt/sda1/arduino/www/test/ec.db");
     $results = $db->query('SELECT * FROM Navn');
     while ($row = $results->fetchArray()) {
     var_dump($row);
     print $row[1];
     }
You need to edit uhttpd (the web server) config file, located at /etc/config/uhttpd . 

HP (5 or 4)

In order to install php5 or php4, be sure your Yún can access the internet then, via SSH or via the YunSerialTerminal, issue commands

opkg update
opkg install php5 php5-cgi

Php5-cgi is good for making web sites. If you want to use php as a command line interpreter, install php5-cli

Ensure that you uncomment the extension interpreter line for PHP in the main section of the uHTTPd config file: list interpreter ".php=/usr/bin/php-cgi" 
Creating keys on the Yun:

dropbearkey -t rsa -f id_rsa

Viewing the keys: 

dropbearkey -f ./id_rsa -y

Connecting using the key:

 ssh -i ./id_rsa <address>

Need to copy the ~/.ssh/known_hosts to /.ssh for automated startup scripts to work with SSH and SCP

Sketch Uploader

Building with Makefile

Run avrdude

The sketch will be transferred to the AR9331, and the Linux distribution will program the ATmega32U4 through the SPI bus, emulating an AVR ISP programmer.
yun_reset.1424003601.txt.gz · Last modified: 2021/06/04 02:16 (external edit)