View: 15898|Reply: 33

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-4-16 13:08:17 | Show all floors
I love reading your blog because it has very interesting topics.:-`”‘        tydo88
Published in 2024-4-17 16:15:01 | Show all floors
HOPE I DIDNT MISS OUT ON THE FOOD… IM STARVING….|MsAndreaBlue|        vn88
Published in 2024-4-19 19:44:51 | Show all floors
Valuable info. Lucky me I found your website by accident, and I am shocked why this accident did not happened earlier!   I bookmarked it.        win55
Published in 2024-4-22 20:37:20 | Show all floors
Hey, I simply hopped over for your website by means of StumbleUpon. Now not one thing I’d in most cases read, but I appreciated your emotions none the less. Thanks for making one thing price reading.        倫敦買樓
Published in 2024-4-23 15:00:29 | Show all floors
This could be the appropriate blog for hopes to check out this topic. You already know a great deal its almost tricky to argue with you (not that When i would want…HaHa). You definitely put a fresh spin using a topic thats been discussing for many years. Wonderful stuff, just fantastic!        79sodo
Published in 2024-4-24 20:27:08 | Show all floors
There is noticeably a bundle to realize about this.  I assume you made various nice points in features also.        Đăng ký IWIN
Published in 2024-4-25 18:15:59 | Show all floors
It seems like you're mentioning online gambling and betting sites. While I can't provide direct links or promote gambling, I can offer some general information about online gambling.        soda69: Agen Judi Online Situs Judi Online Daftar Situs Togel Resmi
Published in 2024-4-25 20:42:25 | Show all floors
Would love to always  get updated  outstanding  weblog ! .        Gading88]]Situs Judi Slot Online Terbaik & Terpercaya 2024
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list