Posts

Showing posts with the label raspberry pi

Notification Chains in Linux Kernel

Notification chains in Linux kernel is a mechanism for the subsystems being informed by the events generated by the other subsystems. In other words, if you are developing a new driver in Linux and you want to listen some events from other driver and handle these events in your own driver, you need to use the Linux's notification chains mechanism. As an example, if you develop a driver and this driver needs to be informed about the net device events such as net device UP, DOWN events, the driver needs to register itself to the net device notifications with the  register_netdevice_notifier function. Similarly, it unregisters itself with the unregister_netdevice_notifier function. These functions are provided by the net device subsystem. The APIs and the data structures of notification chains are defined in the include/linux/notifier.h and  kernel/notifier.c files under linux source code. In this post, I am going to explain how this notification chains mechanism wo...

Build and Flash OpenWrt for Raspberry Pi

Image
OpenWrt is an open source project for embedded operating system based on Linux, primarily used on embedded devices to route network traffic. [ 1 ] In this post, I will write about how to get the OpenWrt source, compile it for your Raspberry Pi board type and flash the SD card with the generated image. First of all, you need a Linux build environment installed with the requirements needed to build the OpenWrt. I use Ubuntu 14.04. In the market, there are 4 types of Raspberry Pi boards. Type 1, 2, 3 and Zero. OpenWrt's latest trunk branch supports all of these types. I will go through trunk. Check out the source: git clone git://github.com/openwrt/openwrt.git This will create a directory called "openwrt" in your current directory. Go inside this directory and run make package/symlinks command. msezgin@ubuntu:~/openwrt/make package/symlinks Now, we need to do the configuration before starting the build. msezgin@ubuntu:~/openwrt/make menuconfig ...

Raspberry Pi VNC Server installation

Image
I assume that you have configured your Pi's network interface and already connected to the Internet. You also have the console access to the board through the USB to TTL serial cable . First you need to install a VNC server. We will use the tightVNC server. $ sudo apt-get install tightvncserver Then you will run the server first time to configure a password and optional view only password. $ tightvncserver Now you can start the VNC server with the below command and it will run as a background process. $ vncserver :0 -geometry 1280x800 -depth 24 -dpi 96 From a PC in the same network, you can use a VNC client and connect to your Raspberry Pi board by using its IP address and entering the password that you have configured on the board. Here is a snapshot of my Raspberry Pi desktop from my MAC book VNC client.

Raspberry Pi wireless connection

If you are booting your raspberry pi first time and connecting to the boards console through a USB to TTL serial cable , you can configure the wireless interface of your board to connect it to your home wireless router which has a WPA wireless security mode enabled. $sudo vi /etc/network/interfaces #Then edit the file as below. auto lo iface lo inet loopback iface eth0 inet dhcp auto wlan0 allow-hotplug wlan0 iface wlan0 inet dhcp    wpa-scan-ssid 1    wpa-ap-scan 1    wpa-key-mgmt WPA-PSK    wpa-proto RSN WPA    wpa-pairwise CCMP TKIP    wpa-group CCMP TKIP    wpa-ssid "<YOUR WIRELESS NETWORK SSID>"    wpa-psk "<YOUR WIRELESS NETWORK PASSWORD>" iface default inet dhcp $sudo /etc/init.d/networking restart After a few seconds your wireless interface will get an IP address from your home network's DHCP server. You can see the IP address with the...