pjc123
Posts: 921
Joined: Thu Mar 29, 2012 3:37 pm
Contact: Website

VNC between laptop & pi wirelessly without a router

Wed Jun 27, 2012 9:17 pm

I am now able to ssh and vnc into my pi from a Windows 7 computer over an ethernet cable, but now I would like to be able to do the same wirelessly. I have wireless dongles working on both my Windows 7 computer as well as the pi (Big thanks to MrEngman). Eventually I want to get a laptop so I can connect wirelessly into a headless pi running off of batteries (A pi with only a power cable, wifi dongle and a car battery with a 12Vdc to 5Vdc converter). Since I would use it in the field where no electricity is available, a router is out of the question, not to mention overkill.

So how do I connect the two devices wirelessly this way; would an ad-hoc wireless connection be what I am looking for? Has anyone been able to get this to work? I believe that a virtual router would not work because all that does is allow an internet connection to be shared by multiple devices, which is not my goal.
My Raspberry Pi Project Page:

https://www.flaminghellmet.com/launch/

pXc
Posts: 22
Joined: Sat Jun 16, 2012 12:49 pm

Re: VNC between laptop & pi wirelessly without a router

Wed Jun 27, 2012 10:56 pm

Hello ,

Ad-hoc is when you have a pc that is used as router as being wired to an Internet connection and streaming the signal to other devices in the network .

I think it might be possible but you need to find a tweak to use the pc as a router that will give the pi a local ip address , but i don't know any program that does that.

fhlipZero
Posts: 35
Joined: Tue May 29, 2012 11:50 pm

Re: VNC between laptop & pi wirelessly without a router

Thu Jun 28, 2012 10:04 am

I actually needed the same thing except i used SSH instead of vnc. You can add a couple lines at startup that will do the job. I added

Code: Select all

ifconfig wlan0 up
iwconfig wlan0 mode ad-hoc
iwconfig wlan0 essid "Pi"
sudo ifconfig wlan0 inet 172.0.0.1 
to /etc/rc.local right after the pi displays the current ip address, first brings up the interface, set ad-hoc mode, names the network, and assigns the pi an ip address. After all i have to do is connect to the network the pi made and set my own ip on the laptop, mild pain but saves space instead of installing and configuring a dhcp server.

AaplMike
Posts: 3
Joined: Fri Jun 29, 2012 4:12 pm
Location: Central California
Contact: Website

Re: VNC between laptop & pi wirelessly without a router

Tue Jul 17, 2012 6:21 pm

Does anyone else get the following error when trying to set the wireless mode to ad-hoc?

Code: Select all

root@raspberrypi:/etc/network# iwconfig wlan0 mode ad-hoc
Error for wireless request "Set Mode" (8B06) :
    SET failed on device wlan0 ; Device or resource busy.
I've tried this after bringing the IF down and up with ifconfig, if down, etc. No combination seems to work. I can, however, do "iwconfig wlan0 mode managed" all day long without error.

pjc123
Posts: 921
Joined: Thu Mar 29, 2012 3:37 pm
Contact: Website

Re: VNC between laptop & pi wirelessly without a router

Wed Jul 18, 2012 10:57 am

Someone recommended that I try Connectify on my Windows computer and I tried it yesterday and now I am able to connect to a headless pi wirelessly without a router. What is nice about the program is that it allows multiple pieces of equipment to access the wifi dongle through network sharing. The program is a bit of overkill as I do not need access to the internet from the pi, just network access, but it does the job. Some features are greyed out unless you purchase the pro version, but I really don't need any of the advanced features.
My Raspberry Pi Project Page:

https://www.flaminghellmet.com/launch/

Beerhunter
Posts: 21
Joined: Wed Jun 27, 2012 10:23 am

Re: VNC between laptop & pi wirelessly without a router

Wed Jul 18, 2012 2:18 pm

Contrary to a previous post, ad hoc WiFi mode has nothing to do with routing. ad hoc mode is used when there is no Wireless Access Point present and therefore the WiFi devices communicate peer-to-peer. When WiFi devices communicate via a Wireless Access Point that is known as Infrastructure mode.

Return to “Beginners”