Raspberry Pi using as access point

Hostapd + dnsmasq for Raspberry Pi 

Last time I used Android phone as a keyboard and mouse to remotely control the RPi X-server, but it required WiFi connection to login the RPi if I need to control the terminal. 

This time I tried to make RPi work as an access point to directly communicate with Android phone.
  1. hostapd settingsInstall hostapd package.
    sudo apt-get install bridge-utils hostapd
    Get hostpad that is for the RTL8188CUS chipset which is used for Edimax EW-7811Uh.
    wget http://dl.dropbox.com/u/1663660/hostapd/hostapd.zipunzip hostapd.zip
    Replace the hostapd that is installed with the package.
    sudo mv /usr/sbin/hostapd /usr/sbin/hostapd.original
    sudo mv hostapd /usr/sbin/hostapd.edimax
    sudo ln -sf /usr/sbin/hostapd.edimax /usr/sbin/hostapd
    sudo chown root.root /usr/sbin/hostapd
    sudo chmod 755 /usr/sbin/hostapd
    If eth0 and wlan0 need to be bridged, edit the interfaces file.
     sudo nano /etc/network/interfaces
    Modify the file as below. (after the part related to wlan0)
    auto br0
    iface br0 inet dhcp
    bridge_ports eth0 wlan0
     Create hostapd.conf file
    sudo nano /etc/hostapd/hostapd.conf
    Add the following lines.
    interface=wlan0
    driver=rtl871xdrv
    bridge=br0
    ssid=[NETWORK NAME]
    channel=6
    wmm_enabled=0
    wpa=1
    wpa_passphrase=[PASSWORD]
    wpa_key_mgmt=WPA-PSK
    wpa_pairwise=TKIP
    rsn_pairwise=CCMP
    auth_algs=1
    macaddr_acl=0
    Run hostapd and see if network is detected by Android phone.
    sudo hostapd -dd /etc/hostapd/hostapd.conf
    Modify hostpad file if you want to run hostapd at the startup.
    sudo nano /etc/default/hostapd
    Uncomment "DAEMON_CONF" in the file and add the path to the file.
    DAEMON_CONF="/etc/hostapd/hostapd.conf"
    Reboot the system and see if hostapd is automatically run.
    sudo shutdown -r now


  2. dnsmasq settings
    hostapd is to make it RPi as access point.
    Now, we install dnsmasq to automatically assign the IP address to the clients.
    Install dnsmasq.
    sudo apt-get install dnsmasq
    This will automatically start the dnsmasq, so stop it.
    sudo service dnsmasq stop
    Create the new configuration file.
    sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.original
    sudo touch /etc/dnsmasq.conf
    Edit the file as below.
    interface=wlan0
    expand-hosts
    domain=local
    dhcp-range=10.0.0.10,10.0.0.20,24h
    dhcp-option=3,10.0.0.1
     Edit the interfaces file again.
    sudo nano /etc/network/interfaces
    Comment out or delete the part modified previously, then modify it as below. (section1) 
    #auto br0
    #iface br0 inet dhcp
    #bridge_ports eth0 wlan0
    iface wlan0 inet static
    address 10.0.0.1
    network 10.0.0.0
    netmask 255.255.255.0
    broadcast 10.0.0.255
     Reboot the RPi
    sudo shutdown -r now
    

  3. Connecting the Android phone to RPi
    After rebooting RPi, you will see the network name on your phone.
    Connect to the network and make sure the IP is obtained.
    Then, launch the SSH apps and try login RPi.
    I used "ConnectBot" app.
    You can also use "Simple Computer Remote" app to control the RPi once X-server is started.

Hardware:
    Raspberry Pi
    EW-7781Uh WiFi dongle

    PS Vita Portable Charger 
   
Summary:
RPi is now connected to an Android phone directly without WiFi network.
This will allow me to access to RPi at anywhere.


Reference:     
http://willhaley.com/blog/raspberry-pi-hotspot-ew7811un-rtl8188cus/
http://ariandy1.wordpress.com/2013/04/07/setting-up-wifi-access-point-with-edimax-ew-7811un-on-raspberry-pi/

Easy Connection between PC and Raspberry Pi with USB to Serial Dongle

I was frustrated with Wi-Fi connection between PC and Raspberry Pi (RPi) when I use RPi outdoors. First, I needed network setup. It was frequently troublesome.

I looked for an easier way. Using USB2Serial dongle would be one of the ways.

Connection using USB to Serial dongle


I bought USB to Serial dongle from Amazon. It cost about $11, not so expensive.


NooElec PL2303 USB to Serial (TTL) Module/Adapter

Download and Install driver

To connect from PC to RPi, you need to download and install driver software here. I'm using Mac. The above product has drivers for Windows/Android/Mac.

Cable Connection

Cable connection is easy. You just connect three pins - GND, TX, and RX. RPi pin assignment is here.


USB to SerialRaspberry Pi
GNDGND(P1.6)
RXDUART_TXD(P1.8)
TXDUART_RXD(P1.10)

Connect with a Terminal Program

After the above setup, you can connect with your terminal program.
  • Baud Rate: 115200
  • Bits: 8
  • Parity: None
  • Stop Bits: 1
  • Flow Control: None

Raspberry Pi remote control

Remote keyboard + mouse for Raspberry Pi I wanted to remotely control the RPi using Android phone, and here is the notes what I have done.
  1. Android phone settingInstall "Simple Computer Remote" Apps on your Android phone.
    also, install "ConnectBot" if you need to use SSH to log into the RPi.
  2. RPi settingLog into the RPi and install the package.
    This creates a file named "SimpleComputerRemote" into /opt/rekap.
    wget http://philproctor.github.io/SimpleComputerRemote/downloads/simplecomputerremote_1.2_armhf.deb
    dpkg -i simplecomputerremote_1.2_armhf.deb
    Check the installed package
    dpkg --list simplecomputerremote
    Add /opt/rekap/SimpleComputerRemote as a startup application to automatically start the server when x-server is started.
    This requires to add/modify a file located at /home/pi/.config/autostart.

    mkdir /home/pi/.config/autostart (if the directory does not exist.)
    cd /home/pi/.config/autostart
    sudo nano SimpleComputerRemote.desktop
    Add following lines in the SimpleComputerRemote.desktop file and save it.
    [Desktop Entry]
    name=SimpleComputerRemote
    GenericName=Remote Control
    Comment=Allow remote control using Simple Computer Remote
    Exec=/opt/rekap/SimpleComputerRemote
    Terminal=False
    Type=Application
    Start the x-server.
  3. Connecting the Android phone to RPi
    After x-server is up, launch "Simple Computer Remote" app on Android phone.
    Go to "Settings > Select Server" and you will see RPi on the list.
    Click RPi and go back to the home screen of the application.
    Now you see the cursor moving when you touch the screen on the phone :)
    (Sometimes the application does not show the RPi as an active server. Try "Reconnect" and see if RPi shows up in the server list.)

    If you do not want to use PC next time, you can use "ConnectBot" apps to log into the RPi and startx over ssh.

Hardware:
    Raspberry Pi
    EW-7781Uh WiFi dongle
    PS Vita Portable Charger 
   
Summary:
"Simple Computer Remote" app is working with RPi and also "ConnectBot" can SSH to the RPi.
It is more than I expected and quite nice!
Using the libreoffice or something, I can use RPi for presentation machine during the meetings :)


Reference:     
http://philproctor.github.io/SimpleComputerRemote/
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=27&t=40797

Mini Monitor for Raspberry Pi


I was looking for an inexpensive small monitor for Raspberry Pi. I found one monitor in the web page here. It is 4.3 inch TFT color monitor, which we can buy from Amazon.


4.3'' Color TFT Car Monitor Support 480 x 272 Resolution + Car/Automobile Rear-view System Mirror Display Monitor

I tried it with 12V DC Power Adapter. It worked but it is a little bit difficult to read messages on the terminal.

Macro shot of the actual monitor screen


However I could use this monitor for visual things, for example video streaming.

I feel some heat on the back side when I use the monitor with 12V DC. Now I use this monitor with 6V DC using a voltage adjustable power adapter below.


Velleman Compact Universal DC Adapter Power Supply




[AKM Chip Booster] Audio ADC AK5704 PCB Design

Designing a PCB prototype with AK5704 is not so difficult and I show an example with my design. People who are not familiar with AK5704,...