WHAT'S NEW?
Loading...
Showing posts with label ubuntumate. Show all posts
Showing posts with label ubuntumate. Show all posts
Before doing anything, create a backup. You can restore your server in case anything goes wrong. Go to the shell and start by running this command with no options:
  • sudo do-release-upgrade
If the new Ubuntu has not been released yet, you should see the following:
Sample Output
Checking for a new Ubuntu release
No new release found
In order to upgrade to  the last version  before its official release, specify the -d option in order to use the development release:
  • sudo do-release-upgrade -d
If you're connected to your system over SSH, you'll be asked whether you wish to continue.
Follow the on-screen instructions.
You will now see the packages that are going to be upgraded and the changes that are going to be made. Note that the upgrading process can take several hours, and you can't cancel the process once Ubuntu is upgrading.

After the upgrade has finished, you can confirm your server is running on the new version by executing the command

lsb_release -r
Suppose we have a Raspberry Pi connected to the TV with an HDMI cable and that uses the internet connection via Wifi. In this example, the operating system is Ubuntu Mate. What we want to get is to connect the Raspberry Pi directly to the home router using an Ethernet cable and set up a static IP address so that we can connect it later using SSH.

First of all, while we are connected to Wifi, we enable Raspberry to get a dynamic IP from the Ethernet cable. To enable this feature we will have to edit the file

/etc/network/interfaces

and add these 2 lines if they are not present

auto eth0
iface eth0 inet dhcp

the result file should be similar to this

# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

# The loopback network interface
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp

Connect the Raspberry Pi to your router with the Ethernet cable and do a reboot.

From command line do: ifconfig



You should see a result similar to the one up. To find your Ethernet IP you have to look at the interface Eth0 and then look at the inet (IPv4) section, in the example is : 192.168.1.48

Use the route -n command and mark the values you get

raspberry@raspberry:~$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    1024   0        0 wlan0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 wlan0

My example values are

Gateway 192.168.1.1
Newtwork 192.168.1.0
NetMask 255.255.255.0

Now we have all informations we need to proceed

sudo nano /etc/network/interfaces


Comment the line about dynamic IP address and Eth0 interface by using #
add the line to obtain the static IP and the lines of your configuration as the example. This sets your static IP, and the appropriate settings for your resolv.conf. You'll notice it uses your local DNS, a Google DNS (8.8.8.8 and 8.8.4.4)  the final result must be similar to the follow.

# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

# The loopback network interface
auto lo
iface lo inet loopback
auto eth0
#iface eth0 inet dhcp
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.48
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 192.168.1.1 8.8.8.8 8.8.4.4

All done! The Raspberry static IP via Ethernet cable will be 192.168.1.48 in our exmple. Last thing to do is to reboot the system.

sudo reboot
Most of you surely have a USB webcam that you used in the past and then thrown away in some corner because it has become old or because you changed your PC. Nowadays, most of the computer is supplied as a standard webcam and no longer needs to buy and to be connected externally. What to do with this old hardware? If you have a device Raspberry Pi, you can reuse your old webcam to build something useful again.


Turn on your Raspberry Pi, open a terminal window, connect the webcam into the USB port and enter the following command that will list all the USB devices that are being connected.

lsusb

you should see your camera listed as a usb device, for example

Bus 001 Device 006: ID 0c45:602c Microdia Clas Ohlson TWC-30XOP Webcam

if webcam is not in the list then you are not lucky, your webcam is not compatible with Raspberry Pi. If your Webcam is compatible, you can try to take some pictures to verify its functionality by installing fswebcam software.

sudo apt-get install fswebcam

Now run this command to capture a picture from the USB Webcam and save it as testimage.jpg

fswebcam testimage.jpg

You can run fswebcam with many switches, type the following command to have more options

man fswebcam

That is all! Your webcam setup is complete, but if you want experiment more with your webcam continue to read. Now we will install another very useful software to stream the video signal via web interface. The program name is "Motion" and you can read all the documentation here.

apt-get install motion

Now edit two configuration files

sudo nano /etc/default/motion

Change the following value from NO to YES

start_motion_daemon=no --> start_motion_daemon=yes

Press Ctrl+O to save and type Ctrl+X to exit.

sudo nano /etc/motion/motion.conf

This is quite a large conf file but the points you need to edit are:
daemon on
stream_localhost off
webcontrol_localhost off

############################################################
# Daemon
############################################################
# Start in daemon (background) mode and release terminal (default: off)
daemon on
############################################################

############################################################
# Live Stream Server
############################################################
# Restrict stream connections to localhost only (default: on)
stream_localhost off
##############################################################

############################################################
# HTTP Based Control
############################################################
# Restrict control connections to localhost only (default: on)
webcontrol_localhost off
#############################################################

Press Ctrl+O to save and type Ctrl+X to exit.

Then start the program by typing

sudo service motion start

sudo motion

To see if all is runnging type

sudo netstat -tulpn | grep LISTEN

Ports are showing as listening:
tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:8081            0.0.0.0:*               LISTEN

Now get the local IP address of the Raspberry PI with command

ifconfig

On the second line of the resulting text, you find the IP address after "inet addr:" for example 192.168.1.6

Now visit the address http://YourIpAddress:8081 in your browser and you should get the Webcam stream. In my example i do http://192.168.1.6:8081 

You will see your Webcam stream into the browser from every pc in your LAN! 

Do you want to make available the display of your webcam directly on the Internet? Follow this tutorial.

Did you have trouble configuring the program files "motion"? Watch the video to get some help.