pedroforli
Posts: 16
Joined: Wed Sep 09, 2015 10:29 pm

Remotely connect to Raspberry without Wifi

Sun Oct 04, 2015 4:09 pm

Hi, I'm trying to create a robot using raspberry pi, but a issue that I'm having is finding a tutorial that can show me how to connect to the raspberry via ssh without being connected to a wireless network. I want to be able to control the raspberry remotely via a wifi connection, but without being connected to a network, since the robot should work in all places.

I tried solving the problem by making my notebook an acess point and connecting the raspberry to it, but when I tried to connect with Putty it gave me an "Host not found" (or something like that) error.

Another problem I'm having is making the raspberry ip adress static. When I did it for the first time it worked, but when I rebooted my wifi adapter wasn't even reconized, and still hasn't been, I even switched to my old configurations, but it doesn't seen to work anymore.

lovermonkey
Posts: 78
Joined: Wed Oct 14, 2015 4:50 am

Re: Remotely connect to Raspberry without Wifi

Thu Oct 22, 2015 5:26 pm

I am of course a noob so I can't help you with the code. But did you ever think about going the way of Bluetooth? They have lots of help with connecting Bluetooth to remote controllers, like on wii. I bet you could do the same with this.

EmanuelAFN
Posts: 4
Joined: Fri Oct 23, 2015 5:44 pm

Re: Remotely connect to Raspberry without Wifi

Fri Oct 23, 2015 6:15 pm

pedroforli wrote: I tried solving the problem by making my notebook an acess point and connecting the raspberry to it, but when I tried to connect with Putty it gave me an "Host not found" (or something like that) error.

Another problem I'm having is making the raspberry ip adress static. When I did it for the first time it worked, but when I rebooted my wifi adapter wasn't even reconized, and still hasn't been, I even switched to my old configurations, but it doesn't seen to work anymore.
Hey there pedroforli, as for your notebook being an access point and then using putty, that's mainly due to either the Pi not connecting to your notebook or your Pi's IP isn't the same as when you connect it to your home network.

For the static IP, there are many tutorials online but I'll get my working code and post it here so you can have a look.

EmanuelAFN
Posts: 4
Joined: Fri Oct 23, 2015 5:44 pm

Re: Remotely connect to Raspberry without Wifi

Thu Oct 29, 2015 7:34 am

I've been busy lately but here is my code and it works for wired and wireless, depending on which is plugged in, and if they're both plugged in, it usually connects with the ethernet and doesn't use the wifi. But there is no conflict! :)

/etc/network/interfaces:

Code: Select all

auto lo

iface lo inet loopback

iface eth0 inet static
address 192.168.1.52
netmask 255.255.255.0
gateway 192.168.1.254

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

iface default inet static
address 192.168.1.52
netmask 255.255.255.0
gateway 192.168.1.254
As you can see, my static IP is '192.168.1.52', that could change to something else depending on the range of your notebook/access point, same for the gateway '192.168.1.254'.

The other file mentioned here '/etc/wpa_supplicant/wpa_supplicant.conf' goes as follows:

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
	ssid="HOME"
	psk="1234567890"
	proto=RSN
	key_mgmt=WPA-PSK
	pairwise=TKIP
	auth_alg=OPEN
}
Your ssid is the name of the access point, psk is the passkey(password) and the rest are type of security; there are far better explanations out there but this is what I use. Hope it helps.

jwenting
Posts: 11
Joined: Thu Oct 29, 2015 10:38 am

Re: Remotely connect to Raspberry without Wifi

Thu Oct 29, 2015 9:49 pm

another thing you can try with many smartphones, is to turn your phone into a WiFi access point.
Just make sure it's well secured or anyone in range can use your 3G or 4G connection to browse the internet at your expense :mrgreen:

Return to “Beginners”