# Reconnecting RPI on WLAN without rebooting in order to get 5Ghz

**URL:** <https://discourse.nodered.org/t/reconnecting-rpi-on-wlan-without-rebooting-in-order-to-get-5ghz/75677>\
**Category:** General\
**Created:** [24 February 2023 10:18 UTC](https://discourse.nodered.org/t/reconnecting-rpi-on-wlan-without-rebooting-in-order-to-get-5ghz/75677 "2023-02-24T10:18:50Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![juntiedt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/juntiedt/32/58357_2.png) [@juntiedt](https://discourse.nodered.org/u/juntiedt)\
**Post date:** [24 February 2023 10:18 UTC](https://discourse.nodered.org/t/reconnecting-rpi-on-wlan-without-rebooting-in-order-to-get-5ghz/75677/1 "2023-02-24T10:18:50Z")

</div>

I have 14 RPIs connected to my Router (Fritzbox 6591). 12 of them can connect with 5 GHz. But when I have a power loss or a reboot of my router, they all reconnect with 2.4 GHz after rebooting.

A second reboot of the RPIs brought them back to 5GHz but this interrupted my applications on these RPIs.

After quite some time of research in forums I found a solution to reconnect to my WLAN on the 5GHz network without rebooting. It only needs 2 nodes.

In few cases you have to run it twice

```auto
[{"id":"d93a61053c3c1138","type":"inject","z":"b0bb63dea1066d9a","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":220,"y":400,"wires":[["58724090944c5d8b"]]},{"id":"58724090944c5d8b","type":"function","z":"b0bb63dea1066d9a","name":"reconnect WiFi","func":"msg.payload = \"sudo ip link set wlan0 down && sleep 1 && sudo ip link set wlan0 up\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":420,"y":420,"wires":[["22f1b275fb4fa70a"]]},{"id":"22f1b275fb4fa70a","type":"exec","z":"b0bb63dea1066d9a","command":"sudo","addpay":"payload","append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":570,"y":420,"wires":[[],[],[]]}]

```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [24 February 2023 10:30 UTC](https://discourse.nodered.org/t/reconnecting-rpi-on-wlan-without-rebooting-in-order-to-get-5ghz/75677/2 "2023-02-24T10:30:38Z")

</div>

Assuming that the two networks have different SSIDs then only give the Pis the credentials for the 5GHz SSID.

---

<div class="post-metadata">

**Author:** ![juntiedt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/juntiedt/32/58357_2.png) [@juntiedt](https://discourse.nodered.org/u/juntiedt)\
**Post date:** [24 February 2023 11:20 UTC](https://discourse.nodered.org/t/reconnecting-rpi-on-wlan-without-rebooting-in-order-to-get-5ghz/75677/3 "2023-02-24T11:20:51Z")

</div>

both networks have the same SSID which is required for my mesh network.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [24 February 2023 12:10 UTC](https://discourse.nodered.org/t/reconnecting-rpi-on-wlan-without-rebooting-in-order-to-get-5ghz/75677/4 "2023-02-24T12:10:59Z")

</div>

Sorry, replied to wrong name.

My wifi 6 router lets me set different ssids for 5GHz and 2.4GHz, but you say that's not an option for you.

Does it let you set the same ssid but different passwords for the two bands?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [24 February 2023 12:18 UTC](https://discourse.nodered.org/t/reconnecting-rpi-on-wlan-without-rebooting-in-order-to-get-5ghz/75677/5 "2023-02-24T12:18:12Z")

</div>

Also, does it really matter which one they connect to?

---

<div class="post-metadata">

**Author:** ![juntiedt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/juntiedt/32/58357_2.png) [@juntiedt](https://discourse.nodered.org/u/juntiedt)\
**Post date:** [24 February 2023 12:25 UTC](https://discourse.nodered.org/t/reconnecting-rpi-on-wlan-without-rebooting-in-order-to-get-5ghz/75677/6 "2023-02-24T12:25:38Z")

</div>

you are right, it works with both net works of course but I have quite a number of shellies and other IOT stuff which only run on 2.4 GHz. Therefore I think it is better for my RPIs, which are more important, that they run on a different and faster frequency (5GHz)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [24 February 2023 12:27 UTC](https://discourse.nodered.org/t/reconnecting-rpi-on-wlan-without-rebooting-in-order-to-get-5ghz/75677/7 "2023-02-24T12:27:37Z")

</div>

Really, I wouldn't worry about it unless you are having problems.

---

<div class="post-metadata">

**Author:** ![juntiedt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/juntiedt/32/58357_2.png) [@juntiedt](https://discourse.nodered.org/u/juntiedt)\
**Post date:** [24 February 2023 12:27 UTC](https://discourse.nodered.org/t/reconnecting-rpi-on-wlan-without-rebooting-in-order-to-get-5ghz/75677/8 "2023-02-24T12:27:44Z")

</div>

no, only one password for both networks

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [24 February 2023 12:30 UTC](https://discourse.nodered.org/t/reconnecting-rpi-on-wlan-without-rebooting-in-order-to-get-5ghz/75677/9 "2023-02-24T12:30:03Z")

</div>

[This may be useful](https://forums.balena.io/t/restrict-rpi-4-to-2-4ghz/65300), I have never used nmcli to manage wifi so not tested it.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [25 April 2023 12:30 UTC](https://discourse.nodered.org/t/reconnecting-rpi-on-wlan-without-rebooting-in-order-to-get-5ghz/75677/10 "2023-04-25T12:30:19Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
