iwlist wlan0 scan |grep 'Address:\|Channel:\|Quality\|ESSID'
Cell 01 - Address: 40:70:09:3F:A7:50
                    Channel:6
                    Quality=53/70  Signal level=-57 dBm
                    ESSID:"TG1672G52"
Cell 02 - Address: D8:50:E6:D7:EA:1E
                    Channel:8
                    Quality=70/70  Signal level=-20 dBm
                    ESSID:"ASUS"
...

Wifi Channel-frequency 

 

Write comment (0 Comments)

Install Sqlite3:

opkg update
opkg install sqlite3-cli
sqlite3 /mnt/sda1/sensor.db
sqlite> CREATE TABLE sensor_data(
    id INTEGER PRIMARY KEY,
    temperature VARCHAR(64),
    sqlitetimestamp DATETIME DEFAULT CURRENT_TIMESTAMP
);
sqlite> INSERT INTO sensor_data (temperature) VALUES (30);
sqlite> INSERT INTO sensor_data (temperature) VALUES (40);
sqlite> select * from sensor_data;
sqlite>.quit

sqlitetimestamp DATETIME DEFAULT CURRENT_TIMESTAMP, will auto CURRENT_TIMESTAMP.

Write comment (0 Comments)

nano /mnt/sda1/download.py
#!/usr/bin/python
import urllib2
zipfile = urllib2.urlopen("http://www.casair.net/vnc/10MB.zip")
output = open('/mnt/sda1/10MB.zip','wb')
output.write(zipfile.read())
output.close()
chmod 755 /mnt/sda1/download.py

Profile the code:

time /mnt/sda1/download.py
real    0m 17.95s
user    0m 1.98s
sys     0m 1.86s

It take 17.95s to download 10 MB file and save it at Micro SD.

 

Write comment (0 Comments)

nano getip.py
#!/usr/bin/python
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(('8.8.8.8', 0))
address=s.getsockname()[0]
print address
chmod 755 getip.py
./getip.py

 

Write comment (0 Comments)

Subcategories

Expand the Storage at Yun

Languages Supported by Yun

Backup and Recover

Network and Yun

Hardware & Yun

OpenWrt-SDK & Yun