суббота, 4 апреля 2015 г.

Tiny RTC

Arduino Tiny RTC I2C Real Time Clock Pinout

PIN Description Comment
BAT Battery voltage To monitor the battery voltage, or not connected
GND Ground Ground
VCC 5V supply Power the module and charge the battery
SDA I2C data I2C data for the RTC
SCL I2C clock I2C clock for the RTC
DS DS18B20 Temp. Sensor output One wire inteface
SQ Square wave output Normally not used
The I2C wires "SDA" and "SCL" are the data line and clock line, they should be connected to the corresponding pins depending on the Arduino board.
Board I2C / TWI pins
Uno, Ethernet A4 (SDA), A5 (SCL)
Mega2560 20 (SDA), 21 (SCL)
Leonardo 2 (SDA), 3 (SCL)
Due 20 (SDA), 21 (SCL), SDA1, SCL1

Arduino LCD 1602


суббота, 28 марта 2015 г.

1.8TFT SPI 128*60 arduino connection

Arduino (Mini, Nano, Uno)    1.8TFT SPI 128*60
D4                                           Pin 14 (SD CS)
D9                                           Pin 07 (A0)
D10 (SS)                                  Pin 10 (CS)
D11 (MOSI)                             Pin 08 (SDA), Pin 13 (SD MOSI)
D12 (MISO)                             Pin 12 (SD MISO)
D13 (SCK)                               Pin 09 (SCK), Pin 11 (SD SCK)
D8                                           Pin 06 (RESET)
5V (VCC)                                 Pin 02 (VCC)
GND                                        Pin 01 (GND)
5V (VCC)                                 Pin 15 (LED+)
GND                                        Pin 16 (LED-)

воскресенье, 15 марта 2015 г.

I can not get wifi working on my Banana Pro with Bananian 15.01. 15.01. should actually support the onboard wifi chip, but I couldn't also find a complete tutorial. I changed to hardware-layout to "Banana Pro" via bananian-config, I added "ap6210" to /etc/modules (which is mentioned here: https://www.bananian.org/hardware) and I configured /etc/network/interfaces (like here: http://www.canox.net/2015/01/banana-pro-wlan-einrichten/):
  1. auto wlan0
  2. allow-hotplug wlan0
  3. iface wlan0 inet dhcp
  4. wpa-ap-scan 1
  5. wpa-scan-ssid 1
  6. wpa-ssid "WLAN-NAME"
  7. wpa-psk "WLAN-KEY"
Copy the Code
After a reboot, wlan0 is found, ifconfig shows wlan0 and the ap6210 driver is loaded, but the DHCP discovery fails (nothing received). When I run "iwlist wlan 0 scan", no networks are displayed, but an error message: "Wireless Event too big".

Has someone a idea how this can get solved or what I could try to get it running?

Thank you in advance.

Regards,

четверг, 12 марта 2015 г.

Arduino IDE Ubuntu

http://arduino.cc/en/Main/Software
tar -zxvf arduino.....
sudo mv arduino-1.0.5 /opt
sudo chmod a+rw /dev/ttyACM0

понедельник, 9 марта 2015 г.

To install X-window, lets first update our resource lists with

  apt-get update

Then, to install X-window

  apt-get install x-window-system

I started using the XFCE window manager and its one of the most lightweight WMs on Linux. It has the look of Gnome and the lightweight of IceWM and X.

To install XFCE 4,

  apt-get install xfce4 xfce4-themes

To install other window managers like IceWM, Fluxbox, GNOME)

  apt-get install icewm fluxbox gnome

I like gdm (Gnome Desktop Manager) as my graphical login program, so

  apt-get install gdm

However you can also try xdm (X Desktop Manager) or kdm (KDE Desktop Manager)

  apt-get install xdm kdm

Changing your screen resolution

  dpkg-reconfigure xserver-xfree86

Choose your resolution and restart your X with either

  /etc/init.d/gdm restart

or

  startx

Removing graphical login

You are finally tired of graphical logins. To turn off the graphical logins (default in Sarge), you have to remove X startup from all run levels.

  update-rc.d xdm remove

X won't start again when your computer boots up. You'll be greeted by the console.

Hello !

I'm using Aircrack-ng on my BPI running Raspian v3

Quick installation tutorial for beginners :

Get root :
  1. sudo su -
Copy the Code
Download required packages :
  1. apt-get update
  2. apt-get install libnl1 libnl-dev libnl-3-dev libnl-genl-3-dev iw
Copy the Code
Download aircrack-ng sources (grab last version) :
  1. wget http://download.aircrack-ng.org/aircrack-ng-1.2-beta3.tar.gz
Copy the Code
Uncompress :
  1. tar xvzf aircrack-ng-1.2-beta3.tar.gz
Copy the Code
Compile & install :
  1. cd aircrack-ng-1.2-beta3
  2. make
  3. make install
Copy the Code
[Optional] : remove useless installation files for free space:
  1. cd ..
  2. rm -Rf aircrack-ng-1.2-beta3*
Copy the Code
Update airodump IEEE OUI base:
  1. airodump-ng-oui-update
Copy the Code
Then plug your Wireless usb adapter, and see if raspian detect it :
  1. dmesg
Copy the Code
example with my adapter:
[ 3533.064296] usb 1-1: new high-speed USB device number 2 using sw-ehci
[ 3533.368525] usb 1-1: New USB device found, idVendor=148f, idProduct=2573
[ 3533.374635] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 3533.378554] usb 1-1: Product: 802.11g USB WLAN Card
[ 3533.381360] usb 1-1: Manufacturer: WLAN
[ 3533.604520] usb 1-1: reset high-speed USB device number 2 using sw-ehci
[ 3534.090900] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[ 3534.098215] Registered led device: rt73usb-phy0::radio
[ 3534.102552] Registered led device: rt73usb-phy0::assoc
[ 3534.108182] Registered led device: rt73usb-phy0::quality
[ 3534.113667] usbcore: registered new interface driver rt73usb


Show your network interfaces, here is wlan0 :
  1. iwconfig
Copy the Code
  1. lo        no wireless extensions.
  2. tunl0     no wireless extensions.

  3. wlan0     IEEE 802.11bg  ESSID:off/any
  4.           Mode:Managed  Access Point: Not-Associated   Tx-Power=20 dBm
  5.           Retry  long limit:7   RTS thr:off   Fragment thr:off
  6.           Encryption key:off
  7.           Power Management:on

  8. eth0      no wireless extensions.
Copy the Code
Start your wireless interface in monitor mode:
  1. airmon-ng start wlan0
Copy the Code

Interface      Chipset         Driver
wlan0           Ralink 2573 USB rt73usb - [phy0]
                    (monitor mode enabled on mon0)


then use the monitored interface with aircrack suite (here is mon0) :

List all hotspots :
  1. airodump-ng mon0
Copy the Code
List only WEP hotspots :
  1. airodump-ng --encrypt WEP mon0
Copy the Code
Capture WEP hotspots traffic in file :
  1. airodump-ng --encrypt WEP mon0 -w /home/pi/WEP_captures
Copy the Code
For better results, you can capture traffic for specific hotspot, just set this channel & MAC address :
  1. airodump-ng -c 11 -bssid xx:xx:xx:xx:xx:xx mon0 -w my_hotspot_capture
Copy the Code

Bananian: GUI mit LXDE

LXDE steht für “Lightweight X11 Desktop Enviroment”, wobei “LX” gleichzeitig auf Linux hindeutet. LXDE ist eine freie Desktop-Umgebung für Unix Systeme. Unter dem Raspberry Pi wird dieses Tool am meisten genutzt, um mit einem Desktopmodus zu arbeiten. Für den Banana Pi, speziell für Bananian Linux erfolgt die Installation gleichermaßen mit folgenden Befehlen.
Zunächst bringen wir unser System auf den neusten Stand.
apt-get update
apt-get upgrade

Anschließend wir die Installation von LXDE gestartet.
sudo apt-get install task-lxde-desktop -y
Damit die Einstellungen übernommen werden erfolgt ein Neustart des Systems.
sudo reboot


Bananian: GUI mit Xfce

Alternativ zu LXDE kann ein Desktop durch das Tool Xfce entstehen. Diese Tool stellt ebenfalls eine Desktop-Umgebung bereit und ist für Unix Systeme. Weitere Informationen zu Xfce findet man unter Wikipedia. Xfce ist im Vergleich zu LXDE etwas schneller und ressourcenschonender.
Vor der Installation bringen wir ebenfalls unser System auf den neusten Stand.
apt-get update
apt-get upgrade

Danach erfolgt die Installation von Xfce mit folgendem Befehl.
apt-get install xorg xfce4 xfce4-goodies hicolor-icon-theme gnome-icon-theme xfce4-power-manager
Damit die Einstellungen übernommen werden erfolgt ein Neustart des Systems.
sudo reboot

суббота, 21 февраля 2015 г.

nl80211: Could not configure driver mode

sudo nmcli nm wifi off
sudo rfkill unblock wlan

Точка доступа WiFi на Ubuntu

sudo apt-get install hostapd dnsmasq
sudo update-rc.d hostapd disable
sudo update-rc.d dnsmasq disable

sudo gedit /etc/dnsmasq.conf

bind-interfaces
interface=wlan2
dhcp-range=192.168.10.2,192.168.10.5

sudo gedit /etc/hostapd.conf

interface=wlan0
driver=nl80211
ssid=Linux
hw_mode=g
channel=1
wpa=2
wpa_passphrase=12345678

sudo gedit /etc/NetworkManager/NetworkManager.conf

dns=dnsmasq     закомменитровать или удалить.

sudo restart network-manager

scripts

ap-start.sh :

#!/bin/sh
ifconfig wlan0 192.168.10.1
service dnsmasq restart
sysctl net.ipv4.ip_forward=1
iptables -t nat -A POSTROUTING -o wlan1 -j MASQUERADE
hostapd /etc/hostapd.conf

ap-stop.sh :

#!/bin/sh
iptables -D POSTROUTING -t nat -o wlan1 -j MASQUERADE
sysctl net.ipv4.ip_forward=0
service dnsmasq stop
service hostapd stop

wlan1 - интернет
wlan0 - раздача

понедельник, 2 февраля 2015 г.

flash player

sudo apt-get install flashplugin-nonfree
sudo update-flashplugin-nonfree --install

суббота, 31 января 2015 г.

add-apt-repository

apt-get install python-software-properties
apt-get install apt-file
apt-file update
apt-file search add-apt-repository
   




cd /usr/sbin
gedit add-apt-repository

#!/bin/bash
if [ $# -eq 1 ]
NM=`uname -a && date`
NAME=`echo $NM | md5sum | cut -f1 -d" "`
then
  ppa_name=`echo "$1" | cut -d":" -f2 -s`
  if [ -z "$ppa_name" ]
  then
    echo "PPA name not found"
    echo "Utility to add PPA repositories in your debian machine"
    echo "$0 ppa:user/ppa-name"
  else
    echo "$ppa_name"
    echo "deb http://ppa.launchpad.net/$ppa_name/ubuntu oneiric main" >> /etc/apt/sources.list
    apt-get update >> /dev/null 2> /tmp/${NAME}_apt_add_key.txt
    key=`cat /tmp/${NAME}_apt_add_key.txt | cut -d":" -f6 | cut -d" " -f3`
    apt-key adv --keyserver keyserver.ubuntu.com --recv-keys $key
    rm -rf /tmp/${NAME}_apt_add_key.txt
  fi
else
  echo "Utility to add PPA repositories in your debian machine"
  echo "$0 ppa:user/ppa-name"
fi

chmod o+x /usr/sbin/add-apt-repository 
chown root:root /usr/sbin/add-apt-repository

 
 

четверг, 29 января 2015 г.

Linux - полезное

Работа с диском

df -h
lsblk
hdparm /dev/sdb
dd if=/dev/zero of=/dev/sdb



sudo mkfs.vfat /dev/sdb1
sudo mkfs.ntfs /dev/sdb1

sudo mount -t ntfs-3g /dev/sdb1 /media/usb0
sudo mount -t vfat /dev/sdb1 /media/usb0 -o uid=1000,gid=1000,utf8,dmask=027,fmask=137

sudo ./f3write /media/usb0/ 
sudo ./f3read /media/usb0/
sudo ./f3probe --time-ops /dev/sdb
sudo ./f3fix --last-sec=15854108 /dev/sdb

четверг, 22 января 2015 г.