Baris Sanli's Raspberry Pi and Gertboard Resources

Arduino ile Webserver-ESP8266
Spark Core Energy Monitor
Connecting Raspberry
Error Message
Serial Communication
Interfacing LCD

Cheapest way to Connect Raspberry Pi (with an Ethernet Cable) to PC directly

Setup: Linux computer(with Xephyr), raspberry pi, crossover ethernet cable

There are severals way to connect Raspberry Pi to a PC. You can use a WiFi adapter, a router , etc....

Instead, i used a cross over ethernet cable for connection. Basic setup is as seen below:

My way of doing it was more simple. I just used the 4 cables on each side for such cross over cable.

cable
Figure 2: Type B(left) and Type A (right)

The rest is some typing and setting up IP addresses.

My setup for the addresses as follows:
a. PC : IP address 192.168.1.1
b. Raspberry Pi: IP address 192.168.1.2

Then from the gnome screen, I defined a new network called raspberry as follows:


On the Raspberry side, you have to edit /etc/network/interfaces as:


now after rebooting Raspberry, from Linux, when you select raspberry network it should connect ....

Next step is to achieve a remote connection....


For this part, I have two scripts.
1. For remote screen of LXDE
2. Remote screen of OpenBox

For LXDE:
-------------------start of the script-------------------------------
# disable firewall
sudo ufw disable

# raspberry pi için network u kapatıp açma

sudo ifconfig eth0 down
sudo ifconfig eth0 192.168.1.1 netmask 255.255.255.0 up

# start the nested raspberry connection

Xephyr -ac -br -noreset -keybd ephyr,,,xkbmodel=pc105,xkblayout=trq -screen 800x600 :1 & DISPLAY=:1 ssh -X -Y pi@192.168.1.2 x-session-manager
---------------------------------------------------------------------

For Openbox Connection:

-------------------start of the script-------------------------------
# disable firewall
sudo ufw disable

# raspberry pi için network u kapatıp açma

sudo ifconfig eth0 down
sudo ifconfig eth0 192.168.1.1 netmask 255.255.255.0 up

# start the nested raspberry connection

Xephyr -ac -br -noreset -keybd ephyr,,,xkbmodel=pc105,xkblayout=trq -screen 1200x700 :1 & DISPLAY=:1 ssh -X -Y pi@192.168.1.2 openbox-session
---------------------------------------------------------------------

 

 

emailto : barissanli2@gmail.com