2

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.

  1. Installed hostapd udhcpd
  2. Configure DHCP (/etc/udhcpd.conf)

enter image description here

  1. Changed /etc/default/udhcpd. New line = #DHCPD_ENABLED="no"
  2. Ran sudo ifconfig wlan0 192.168.42.1
  3. 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:

  4. 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)

  5. Configure /etc/hostapd/hostapd.conf enter image description here

  6. Changed /etc/default/hostapd line #DAEMON_CONF="" to DAEMON_CONF="/etc/hostapd/hostapd.conf"

  7. Ran sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"

  8. Added the following line to the bottom of /etc/sysctl.conf:

     net.ipv4.ip_forward=1
    
  9. 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" 
    
  10. Changed /etc/network/interfaces and added the following line to the bottom of the file:

    up iptables-restore < /etc/iptables.ipv4.nat 
    
  11. 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
  • 1
    We need more details, then we will be able to help – Human Feb 22 '17 at 6:48
  • Welcome - but there are problems with questions that say, "I've tried a bunch of things.." but then do not say in detail what it is you've tried and exactly how it has gone wrong. Please read "What does it matter that my question is “unclear” or “too broad”, etc?" (note the paragraph which begins, "I don't have to explain the details of my problem because..."), and take the tour to understand the site better. – goldilocks Feb 22 '17 at 9:21
  • I apologize for the lack of detail, I’m new to this and have really no programming experience, no excuse I know so I will do better. I added additional details to.my original message above. – Peg Feb 23 '17 at 2:47
  • I understand and realize that rant is long winded -- part of the point is make the context clear to people new to technical forums. Stack Exchange (of which we are a part) can be a great tool but may take some scrutiny ;) I'm sorry this wasn't reopened sooner. You might want to double check/look more closely at what's going on with the tablet; that something connects but does not have an IP is a bit nonsensical, because if it is successfully connecting to the internet something is routing traffic back and forth (which cannot happen unless it has an IP address). – goldilocks Feb 23 '17 at 8:44
1

Do you have an active DHCPD on your Raspberry? If you have you should take a look into the configuration with:

vi /etc/dhcp/dhpd.conf

If you don't have a dynamic range set your tablet won't get an IP address.

Does your WiFi hotspot work if you use a different device (maybe a laptop)? If it's possible you could try setting a static IP address to your device so you could see if there's just a problem with your DHCP.

  • Yes, I believe a dynamic range is set. I added a screen shot (s) above and from what I understand the first sets the range. I also tried to connect through both my tablet and phone neither of which would connect. As of last night I could not connect throguh WiFi on my Pi3. – Peg Feb 23 '17 at 13:02
0

You are almost there, you have all the proper setup (from what I can see) that is needed for hostapd to be working. The issue is with the dhcp, by default the latest raspbian has dhcpcd installed on the OS. You will need to edit the file /etc/dhcpcd.conf and add the following line denyinterfaces wlan0 to the end. Afterwards, reboot and it should work properly. Another way to do this is :

sudo su
echo "denyinterfaces wlan0" >> /etc/dhcpcd.conf
reboot
  • Thanks. I added and rebooted and still getting "no wireless interface found" when I hover over the WiFi/ Internet icon (I'm using Noobs) somthing must be turning off the Wifi??? When I try to connect it just keeps.prompting for my password. – Peg Feb 23 '17 at 23:59
  • I've tried changing a couple of seting in /etc/network/interfaces to no avail. Wifi will still not come on. Any ideas. I can add the file if needed. – Peg Feb 24 '17 at 0:58
  • The RPi3 can be seen on my mobile devices but they still just search for an IP address never getting one asigned. Rpi3 is not assigning an IP address. Help? – Peg Feb 25 '17 at 1:13
  • @Peg unfortunately I used isc-dhcp-server. And this is what I did. bareinhard.github.io/2017/02/10/… the important bits is what I did for the dhcp portion. I didn't add forwarding but my setup does hand out ips to connecting devices. – Brett Reinhard Feb 25 '17 at 1:31
  • I'm going to relaod my card and at this point start over with these instructions. He does say ios, I'm assuming this is not ios specific. Is that true. – Peg Feb 25 '17 at 2:07
0

I was able to get the Hotspot setup using the info from the following site. This was quite helpful and worked for me.

https://frillip.com/using-your-raspberry-pi-3-as-a-wifi-access-point-with-hostapd/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.