View: 4434|Reply: 48

Setup Wifi Prior to First Boot

[Copy link]

1

threads

2

posts

19

credits

Novice

Rank: 1

credits
19
Published in 2024-2-7 14:28:03 | Show all floors |Read mode
On the raspberry I was able to set the parameters to get on my wifi network on the first boot.  Could not find how to this on orange anywhere, so I made this script.  Comments in the script show how to install and setup.  I'm using the orangepi zero 3, with July 2023 orangepi os.  Might work on other devices?
  1. #!/usr/bin/bash

  2. # script to setup wifi prior to booting
  3. # I use to not need to connect to ethernet
  4. # to configure the wifi connection after
  5. # the initial install of orangepi os
  6. # on the sd card.

  7. # Tested on orange pi zero 3 with
  8. # orangepi os dated July 2023

  9. # run this script from /etc/rc.local
  10. # I save the script as
  11. # /home/orangepi/scripts/wifi.sh
  12. # /etc/rc.local then needs this line -

  13. # /home/orangepi/scripts/wifi.sh

  14. # the last line of rc.local must be-
  15. # exit 0

  16. # create the following files
  17. # /boot/ssid and /boot/password
  18. # with one line only, containing
  19. # what their filenames say

  20. # script starts here
  21. # test for the files
  22. if [ -f /boot/ssid ]
  23. then

  24. if [ -f /boot/password ]
  25. then

  26. # wait 10 secs for the board to complete bootup
  27. # may not be necessary
  28. sleep 10

  29. ssid=`cat /boot/ssid`
  30. password=`cat /boot/password`
  31. #echo $ssid
  32. #echo $password

  33. # force scan befor connect
  34. nmcli device wifi list > /dev/null

  35. # wait a little and then connect!!
  36. sleep 5
  37. nmcli device wifi connect $ssid password $password

  38. # network manager should keep activating
  39. # the same wifi when rebooted. So remove these files.
  40. # They can be recreated if needed

  41. # If commented out the files will persist and the orangepi
  42. # will connect to the listed network on each reboot
  43. # regardless if the network was switched

  44. rm /boot/ssid
  45. rm /boot/password

  46. # close the ifs
  47. fi
  48. fi
Copy code

1

threads

2

posts

19

credits

Novice

Rank: 1

credits
19
 Author| Published in 2024-2-11 03:57:58 | Show all floors
OK I missed it.  You do not need the script method above.  Section 3.7.5 details how to setup your wifi parameters along with other options.  This is in the orange pi zero 3 user manual you can download here -

https://drive.google.com/drive/folders/1pZ4X4uP2C7N_6wXU0TjAxC7U1eCG05L1

At least I learned a little writing the script.


Published in 2024-3-26 05:54:10 | Show all floors
there are bargain dvd players that are sold in our area. i think they are generic low cost dvd players;;        i9bet
Published in 2024-3-28 03:53:48 | Show all floors
i can say that David Archuleta has some great potential. all he need is more epxerience,.        link vào s689
Published in 2024-3-28 10:59:29 | Show all floors
“Hello, you site is very funny he told me to cheer up”        Khuyến mãi NOHU90
Published in 2024-3-29 04:09:40 | Show all floors
Awesome! I appreciate your input to this matter. It has been insightful. my blog: how to eat a girl out        cakhia tv
Published in 2024-3-29 10:10:03 | Show all floors
I am often to blogging and that i truly appreciate your content regularly. This article has really peaks my interest. I will bookmark your internet site and keep checking achievable information.        Theanex Reviews
Published in 2024-3-29 23:31:44 | Show all floors
Greetings, Might I export your own snapshot and implement it on my web log?        j88dl live
Published in 2024-3-30 08:44:05 | Show all floors
leather jackets can really make you look good, they also make you feel warm and comfortable**        Tải app F8BET
Published in 2024-3-30 13:57:04 | Show all floors
Quickly this particular site may irrefutably gain popularity in between just about all running a blog as well as site-building people, in order to it's diligent articles or maybe evaluations.        KU CASINO
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list