I have bought a RPI 2 for my 3D printer. My purpose is to access it remotely via wifi. I don't have a router, so I have created an Access Point on the RPI. I have also installed dnsmasq as the DHCP server.
Everything is working... except the DHCP service ! I can connect without any problem to my RPI only if I manually give an IP address to my computer
I have tried lots of different parameters for dnsmasq without success. I have listed my "final" configuration files. Do you have an idea what is wrong ?
/etc/network/interfaces auto wlan0 allow-hotplug wlan0 iface wlan inet static address 192.168.1.1 netmask 255.255.255.0
/etc/hostapd/hostapd.conf interface=wlan0 driver=rtl871xdrv ssid=RPI_Octoprint hw_mode=g channel=6 macaddr_acl=0 auth_algs=1 ignore_broadcast_ssid=0 wpa=1 wpa_passphrase=password wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP
And at the end of the following file, I have added: (not sure that dhcp option 3 and 6 are useful...)
/etc/dnsmasq.conf expand-hosts interface=wlan0 dhcp-autoritative dhcp-range=192.168.1.2,192.168.1.20,12h dhcp-range=1,255.255.255.0 dhcp-range=3,192.168.1.1 dhcp-range=6,192.168.1.1
And I have also added (not sure what it is doing):
/etc/hosts 192.168.1.1 main
Thank you ! :)