Tuesday, 31 May 2016

Enable wifi in OSMC on Raspberry Pi.

Recently, I got myself in a situation where I had to use Wifi module with my OSMC setup.
As you might be knowing that in the current version, enabling wifi on OSMC in GUI mode is not supported and it can only be done using a few super commands on your OSMC terminal.

Let me take you through those super commands:
connmanctl
then
technologies

If wifi is off use:
enable wifi

then
scan wifi

then
agent on
then
services
This will list found networks, then use connect with the long string to the right of the network you're trying to connect to - for example

connect wifi_c83a35ca4314_535454657374_managed_psk

Tip: you can use tab completion so you don't have to type every character.
Once connected the connection will be remembered and automatically used in the future.
Network settings will soon be added in the OSMC settings addon so this manual method (or entering the details during install) won't be needed for the final version of OSMC.

Hope this post will help you, if you got stuck! 

Saturday, 14 May 2016

Remote Raspberry Pi display on desktop using Xming & Putty.

We all know it is very irritating to work on raspberry pi standalone coz you need a keyboard, a mouse and a monitor to connect. But you can get rid of all these by getting a display on your host machine like your desktop or laptop.
The following steps help you to display the desktop of the Raspberry Pi on the host machine, like a Windows laptop.
1. Download http://sourceforge.net/projects/xming/ and start it with the command below, so that the Raspberry Pi desktop will take over a small part of your screen :
"C:\Program Files (x86)\Xming\Xming.exe" :0 -clipboard -screen 0 700x500+125+100@1
At this point, Xming should be started. It provides an empty desktop screen into which Putty will pass the Raspberry Pi desktop.
2. Start the Raspberry Pi and make sure you can connect to it from your host machine (otherwise there's no point in using Putty in the first place, since it exists as an SSH client in this context).
3. For this setup to work, you must know your pi's IP address. If you do not have an ip address associated to pi, please assign one like below in the cmdline file present in your raspbian os installed on your SD card. Remember that there is an empty line in this file. Do not delete that line.
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait ip=169.254.0.2::169.254.94.145
4. Start up Putty. Connect to the Raspberry Pi using the IP of the Raspberry Pi. Before making the connection, go to Connection/SSH/X11 in Putty and then put a check the "Enable X11 forwarding" checkbox.
5. Now you see the Raspberry Pi login screen in Putty and you can use pi/raspberry login.
6. The final step is to type 'startlxde' in the Raspberry Pi, Putty session, and press Enter. 
It initiates the session like below and then Xming shows you your Raspberry Pi desktop.
pi@raspberrypi:~ $ startlxde
** Message: main.vala:99: Session is LXDE
** Message: main.vala:100: DE is LXDE
** Message: main.vala:131: log directory: /home/pi/.cache/lxsession/LXDE
** Message: main.vala:132: log path: /home/pi/.cache/lxsession/LXDE/run.log


And there it is, a nice and niche desktop for your tasks. Now that you can see your desktop, you can play with the awesome stuff as I am playing with Node-red above.

Do leave a comment if you face any issues in connecting to RPI and getting display correctly.
Thanks and stay tuned for more blogs on my experiments with raspberry pi.

Happy learning :)