# Dietpi wifi setup remotely

**URL:** https://dietpi.com/forum/t/dietpi-wifi-setup-remotely/4424
**Category:** General Discussion
**Created:** [30 August 2020 15:36 UTC](https://dietpi.com/forum/t/dietpi-wifi-setup-remotely/4424 "2020-08-30T15:36:44Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![richacker](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/r/5f8ce5/32.png) [@richacker](https://dietpi.com/forum/u/richacker)
#### Post date: [30 August 2020 15:36 UTC](https://dietpi.com/forum/t/dietpi-wifi-setup-remotely/4424/1 "2020-08-30T15:36:44Z")

</div>

Hi,

I am trying to create a hub using dietpi on my pi zero. I want dietpi configured pi to act as hotspot and broadcasting its SSID. This SSID will be connected using my app on mobile device and I will have the option to enter SSID and password of my wifi router which dietpi will receive and write into its wifi credentials file.

App side I have the code ready. On the pi side as well, I have the code to receive the credentials from app once connected using hotspot. I need 2 things:

1. Make pi act as hotspot to connect using my mobile device.
2. Configure wifi credentials for my dietpi from inside pi using a script.

This I was able to achieve on my raspbian using the following code, but on dietpi, I have to go through dietpi-config to do the same.

Create hotspot:

```nohighlight
sudo sed -i -e "s/#nohook wpa_supplicant/nohook wpa_supplicant/g" -e "s/#interface wlan0/interface wlan0/g" -e "s/#static ip/static ip/g" 
/etc/dhcpcd.conf
sleep 1s
sudo systemctl enable hostapd
sleep 1s
sudo systemctl enable dnsmasq
sleep 1s
sudo systemctl start hostapd
sleep 1s
sudo reboot

```

Wifi Credentials I could write to: /etc/wpa\_supplicant/wpa\_supplicant.conf

Any help would be appreciated!

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [30 August 2020 19:42 UTC](https://dietpi.com/forum/t/dietpi-wifi-setup-remotely/4424/2 "2020-08-30T19:42:32Z")

</div>

Hi,

any thanks for your message. What exactly you need to do on dietpi-config?

On DietPi, first thing to ensure is to enable WiFi by removing dtoverlay=disable-wifi from /boot/config.txt.

```nohighlight
G_CONFIG_INJECT 'dtoverlay=disable-wifi' '#dtoverlay=disable-wifi' /boot/config.txt
reboot

```

Packages like hostapd and dnsmasq are not preinstalled. They would need to be installed by running:

```nohighlight
dietpi-software install 60
reboot

```

Side note: DietPi is using isc-dhcp-server instead of dnsmasq.

Hotspot configuration is done based on input from /boot/dietpi.txt

```nohighlight
root@DietPi4:~# cat /boot/dietpi.txt|grep SOFTWARE_WIFI_HOTSPOT
SOFTWARE_WIFI_HOTSPOT_SSID=DietPi-HotSpot
SOFTWARE_WIFI_HOTSPOT_KEY=dietpihotspot
SOFTWARE_WIFI_HOTSPOT_CHANNEL=3
root@DietPi4:~#

```
