0

I am relatively new to Raspberry Pi programming, and have been using a RPi3 to try and create a hotspot in order to send data from an Android device using MQTT.

I use hostapd and dnsmasq in order to create the hotspot and have tried using two different methods for the IP address.

Using a static IP address, I am able to create the hotspot and connect to it. However, the MQTT connection fails, and I am not able to send data from the Android.

Using a manual IP address, I am able to create a hotspot but not connect it. Trying to connect to it shows the device trying to obtain the IP address indefinitely. Additionally, hovering over the Wi-Fi symbol on the Raspbian Desktop shows the message:

Connection to dhcpcd lost.

I tried following all the basic tutorials and guides, involving hostapd and dnsmasq, modified the dnsmasq.conf file, network/interfaces file and such. However, the same problem seems to arise, being:

Connection to dhcpcd lost.

This is what I have done so far,

Modified the hostapd.conf file as follows

interface=wlan0
driver=nl80211
ssid=RPIHotspot
hw_mode=g
channel=7
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=123456789
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

The dnsmasq.conf as follows

interface=wlan0
dhcp-range=192.168.4.2,192.168.4.20,255.255.255.0,24h

and changed the network/interfaces as

auto lo wlan0
iface lo inet loopback
allow-hotplug wlan0
iface wlan0 inet manual
# wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

The dhcpcd.conf file

interface wlan0
static ip_address=192.168.1.42
static routers=192.168.1.1
static domain_name_servers=8.8.8.8
interface=wlan0
domain-needed
bogus-priv
dhcp-range=192.168.1.8,192.168.1.250,12h`

After doing so, I restarted the hostapd, and dnsmasq files. And after rebooting the system, dhcpcd was lost

Any help in solving this issue would be greatly appreciated.

8
  • "I tried following all the basic tutorials and guides" - including all the obsolete guides?
    – Milliways
    Jul 10, 2018 at 9:46
  • 1
    @Milliways I don't think so, I've used the recent ones I think, like the one on raspberrypi.org/documentation/configuration/wireless/…, but they still don't work.
    – JonSnow
    Jul 10, 2018 at 9:59
  • My point was you haven't told us what YOU DID or why you think it doesn't work
    – Milliways
    Jul 10, 2018 at 10:07
  • @Milliways I've added what I have done. Hope this helps
    – JonSnow
    Jul 10, 2018 at 10:17
  • In other words you did not follow the tutorial you linked!
    – Milliways
    Jul 10, 2018 at 10:24

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.