# Carrying over wifi settings between deployments on a Raspberry Pi

**URL:** <https://hub.mender.io/t/carrying-over-wifi-settings-between-deployments-on-a-raspberry-pi/646>\
**Category:** General Discussions\
**Tags:** raspberry-pi-3\
**Created:** [May 30, 2019, 11:40am UTC](https://hub.mender.io/t/carrying-over-wifi-settings-between-deployments-on-a-raspberry-pi/646 "2019-05-30T11:40:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tmrskos](https://avatars.discourse-cdn.com/v4/letter/t/c68b51/32.png) [@tmrskos](https://hub.mender.io/u/tmrskos)\
**Post date:** [May 30, 2019, 11:40am UTC](https://hub.mender.io/t/carrying-over-wifi-settings-between-deployments-on-a-raspberry-pi/646/1 "2019-05-30T11:40:37Z")

</div>

I can successfully push updates to a Raspberry Pi plugged in via an ethernet cable. Unfortunately, when I try to push new deployments to a Pi that has already been configured, I’m losing my ability to connect to the Wifi network. The thought was to push the wifi configurations to /data and create an operating system sym link from the Pi’s wifi settings (/etc/wpa\_supplicant/wpa\_supplicant.conf), thus carrying over the configs between Mender deployments. This is a way around the statelessness partitions (A/B). Perhaps there’s another method? Can someone help me understand the best way to persistent Raspberry wifi network settings on a device (SSID and Password) between Mender deployments?

Thanks

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [May 30, 2019, 12:19pm UTC](https://hub.mender.io/t/carrying-over-wifi-settings-between-deployments-on-a-raspberry-pi/646/2 "2019-05-30T12:19:58Z")

</div>

Creating a symlink is a common approach and is probably the simplest to setup.

Other ways of doing it is to use a state-script, e.g

> <https://github.com/mendersoftware/mender/blob/master/examples/state-scripts/retain-ssh-keys/Download_Leave_01>

Or using an unionfs, such as overlayfs

---

<div class="post-metadata">

**Author:** ![grahas](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/grahas/32/1428_2.png) [@grahas](https://hub.mender.io/u/grahas)\
**Post date:** [March 1, 2023, 11:21pm UTC](https://hub.mender.io/t/carrying-over-wifi-settings-between-deployments-on-a-raspberry-pi/646/3 "2023-03-01T23:21:48Z")

</div>

For future reference, I was able to use the following .bb\_append for Kirkstone to preserve the WiFi wpa\_supplicant file. However, not for the Raspberry Pi but for STM32mp1.

wpa-supplicant\_%.bbappend

```auto
do_install:append() {
    # Move the default to data directory
    install -d ${D}/data/etc/wpa_supplicant
    mv ${D}${sysconfdir}/wpa_supplicant.conf ${D}/data/etc/wpa_supplicant/wpa_supplicant-wlan0.conf
    
    # Add directory for config file
    install -d ${D}${sysconfdir}/wpa_supplicant/

    # Link config file to data 
    ln -sf /data/etc/wpa_supplicant/wpa_supplicant-wlan0.conf ${D}${sysconfdir}/wpa_supplicant/wpa_supplicant-wlan0.conf 
}

FILES:${PN}:append = " /data/etc/wpa_supplicant/wpa_supplicant-wlan0.conf "

```
