9/27/2016

Getting start with NanoPi-M1 PART-II


SETTING WiFi ON NanoPi-M1

  • I'm using EDUP Nano 802.11N model EP-N8508GS which works well on my Raspberry Pi and hopefully it should support NanoPi-M1 as well.
  • Without power down NanoPi, just plug-in the dongle and list the USB device,
lsusb
  • Great! I got the return
Bus 003 Device 002: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter
    • Trying to check network configuration using a simple command
    ifconfig
      • But unfortunately got an error in return...
      -bash: ifconfig: command not found
      • Hmmm.... whats'up! something differ from Pi!!!
      • Let's try again with root privilege,
      sudo ifconfig
      [sudo] password for fa: (enter root password)
      • Success!!! I got the network configuration!
      • Next, open the network configuration file. 

      sudo nano /etc/network/interfaces
      • Add the following lines, 

      allow-hotplug wlan0
      iface wlan0 
      
      inet manual
      wpa-roam /etc/wpa_supplicant/wpa_supplicant.confiface 
      
      default inet dhcp

      • Now open file '/etc/wpa_supplicant/wpa_supplicant.conf' but there's nothing so a new file will be created, append the following lines,
      network={ ssid="xxxxx"psk="12345678"key_mgmt=WPA-PSK}
      • Save and Exit and try to enable the interface...

        ifdown wlan0
        ifup wlan0
      • Wow! it's work!!!



      SHARING FOLDER WITH WINDOWS MACHINE

      • I want to open image/video/audio, edit python program using Windows machine, so sharing files from myNano to PC is a great idea.
      • Now let's install and configure 'SAMBA' (for more details read here and here):
      • sudo apt-get install samba samba-common-bin
      • After installation, configure the software by opening the file '/etc/samba/smb.conf' using the command:
        sudo nano /etc/samba/smb.conf
        Read through the file and make sure you have the following parameters set:
        workgroup = WORKGROUP
        wins support = yes
        You can use anything as your workgroup name as long as it is alphanumerical and matches the workgroup you would like to join. The default workgroup in Windows 7 is WORKGROUP.

        Setup folder to share

        Next step is to create the folder to be shared. To create a folder called “share” in home directory do the following:
        sudo mkdir -m 1777 home/share
        With the folder created we can now tell the Samba software to share it on the network. Open the file '/etc/samba/smb.conf' using the command:
        sudo nano /etc/samba/smb.conf
        Scroll to the bottom and add the following:
        [data]
         comment= myNanoPi Share
         path=/home/share
         browseable=Yes
         writeable=Yes
         only guest=no
         create mask=0777
         directory mask=0777
         public=no
        Notice how we tell Samba that public access is not allowed via “public=no” this means that anyone wanting to access the shared folder must login with a valid user.
        In this case the valid user is the user called “fa”. To let Samba know that “fa” is a network user run the command:
        sudo smbpasswd -a fa
      • If you do not want to deal with logging in you can always make the share publicly available by changing the config file to say:
        public=yes

      9/26/2016

      Getting start with NanoPi-M1 PART-I



      Revision : 1.0
      Date : 26/09/2016
      Author : CCPC-Rombix
      PART I

      I'm looking for Embedded Linux Board that cheaper and smaller than Raspberry Pi-3 for my Active-Camera Box (Photo capture, VDO-Audio capture and Live Streaming). The NanoPi-M1 is another choice for me and here's my experimenting... 

      STARTUP
      • Take a look at official NanoPi-M1 features here and WiKi page here.
      • Download Debian disk image here (be patient! took very long time).
      • On Windows machine, create disk image using Win32DiskImager.
      • Insert SD-Card with os installed, plug-in LAN cable and apply 5V/2A power supply to micro usb port.
      • After device boot, Find NanoPi-M1 IP address, I'm using AdvanceIP Scanner.







      UPDATE OS

      • First of all to make sure that every thing is up-to date, it's recommended to update the OS.
      • Login using default user name: fa password: fa
      • Perform update & upgrade using command
        • sudo apt-get update --fix-missing
        • sudo apt-get upgrade --fix-missing


      UTILIZED FULL DISK SPACE
      • After update OS and check disk space (using command: df -h) the NanoPi seen space on my TF-card only 3.9GB. 
      • The rootfs section of the TF-card need to be resized, run the following command on the NanoPi terminal:

      sudo fs_resize
      • Following the prompt type in "y" to start re-sizing the file system and a second "y" to reboot the M1. After the M1 is rebooted check the new section by using the following command:

      df -h





      UTILITY FOR USB DEVICES
      • I wan't to use USB-WiFi, USB-Camera, 3G-Dongle and other USB devices on my NanoPi, so the USB utility is required.
      • Install USB utility...

        sudo apt-get install usbutils
      • Now I can use command: 'lsusb' to check if the USB device is compatible to my NanoPi.

      CHANGING THE HOSTNAME
      • The factory hostname 'FriendlyArm' do not make sense to me, I want to change it to something like 'myNanoPi'.
      • Follow these step to change hostname from 'FriendlyArm' to 'myNanoPi'
        • sudo nano /etc/hostname
      • Leave all of the entries alone except for the labeled 127.0.1.1 , change the hostname to “myNanoPi“.
      • CTRL-O to save, CTRL-X to exit and get back to the terminal, type the following command to open the hostname file:
      • sudo nano /etc/hostname
        This file only contains your current hostname, change it to "myNanoPi"
      • Finally, we need to commit the changes to the system and reboot the system for the changes to take effect. At the terminal, enter the following command to commit the changes:
        sudo /etc/init.d/hostname.sh
        sudo reboot
        Once the system comes back online, you can check the device list in your router to see if the new hostname has properly resolved.
      LOGIN TO myNanoPi USING TightVNCViewer


           

       NanoPi's OS is pre-installed with TightVNCServer. my NanoPi is not connected to a display device, but I can login to myNanoPi from a mobile phone, download and install a "VNC Viewer" from hereand login to the myNanoPi via VNC at port 1. Its default password is "fa123456" (same as login from TightVNCviewer on PC).