sate
Posts: 1
Joined: Thu Oct 20, 2016 12:34 am

Pi3 as Offline website hoost which can be accessed via WIFI

Sun Jan 29, 2017 8:38 pm

Hi Guys!

I am new to this thing so sorry if my questions are going to look dumb or something.

So I am working on a project which requires me to do the following:

- save/host website on the pi
- share this website via WI-FI to other devices (mobile phones or tablets)
(I want to do something like, when you are login in to the public WI-FI, you have a "website" which asks you to login etc, I want to replace this with my small webapp which is for Uni project)

Do you know if that is possible?
If it is, do you know anything how to do this?

I would appreciate any help.
Thanks!

luandro
Posts: 1
Joined: Thu Jan 19, 2017 10:02 am

Re: Pi3 as Offline website hoost which can be accessed via W

Mon Feb 06, 2017 9:43 pm

@sate have you had any luck? Im trying to achieve the exact same thing. Very similar to what piratebox.cc does I guess.

takurua
Posts: 16
Joined: Thu Sep 29, 2016 2:23 pm

Re: Pi3 as Offline website hoost which can be accessed via W

Sun Feb 12, 2017 4:01 am

save/host website on the pi
- share this website via WI-FI to other devices (mobile phones or tablets)

There are loads of instructions on setting up a webserver. I found this one to be good: http://www.penguintutor.com/linux/light-webserver . This tutorial uses Ligthttpd.
For a website I use http://get-simple.info/ which is easy to install and run. This CMS uses XML flat files so no mysql database is required.
I use my own router and so users first connect to my wifi. The address is in the form 192.168.blah.blah and users can access using phones and laptops.

PEG
Posts: 4
Joined: Wed Feb 22, 2017 2:15 am

Re: Pi3 as Offline website hoost which can be accessed via W

Sat Feb 25, 2017 1:55 am

I'm trying to setup my Raspberry Pi3 as a WiFi hotspot. I've used three different sets of instructions after complete reloads and cannot get any of them to work. I can see the RP3 in my list of WiFi networks and can connect. However my tablet (Google Samsung ) does not get an IP assigned.

I don't know anything about the OS and thus don't have any idea on what to try to do to diagnose.

Additional Information

I loaded by Pi3 with the latest version of Raspian. Like with the message above the Pi3 was not assigning an IP.

I noticed tonight that I could connect to the internet via direct connect/cat5 but not WiFi.

Yesterday I was on with WifI but could not get an IP address assigned to me tablet. So i don't know what the issue is. Here is what i have setup.

Installed hostapd udhcpd
Configure DHCP (/etc/udhcpd.conf)
Item 2.JPG
Item 2.JPG (34.82 KiB) Viewed 697 times
/etc/default/udhcpd. New line = #DHCPD_ENABLED="no"
Ran sudo ifconfig wlan0 192.168.42.1

Added to the bottom of the file /etc/network/interfaces. Instructions were if the line "iface wlan0 inet dhcp" is not present, then add these lines to the bottom of the file.
This line was not present in my file so I added:
Item 5.JPG
Item 5.JPG (31.38 KiB) Viewed 697 times
Was supposed to comment out (#) the following lines in /etc/network/interfaces:

allow-hotplug wlan0,
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf, and
iface default inet manual.
However I only changed the top line since it was the only one in my file (#allow-hotplug wlan0)
Configure /etc/hostapd/hostapd.conf
Item 7.JPG
Item 7.JPG (37.5 KiB) Viewed 697 times
Changed /etc/default/hostapd line #DAEMON_CONF="" to DAEMON_CONF="/etc/hostapd/hostapd.conf"
Ran sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
Added the following line to the bottom of /etc/sysctl.conf:

net.ipv4.ip_forward=1
Ran the following commands in this order

sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT

sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT

sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"
Changed /etc/network/interfaces and added the following line to the bottom of the file:

up iptables-restore < /etc/iptables.ipv4.nat
Ran

sudo service hostapd start

sudo service udhcpd start
At this point I could see the Wireless network but the Pi3 never assigned an IP to my tablet. This was yesterday when the WiFi appeared to work. Today the WiFi does not appear to be working

Ran this just to finish

sudo update-rc.d hostapd enable
sudo update-rc.d udhcpd enable

For some reason now my device (Samsung Google Tablet) or my phone or laptop does not get an IP addressed assigned from the Rpi3. In fact I cannot connect to my home Wifi via the Rpi3, it does not connect. It will connect to the Etho but not through Wifi.

Any suggestions?
Peg

Return to “Networking and servers”