Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Auto run wifi with static ip

Featured Replies

Hello, I am new on the embedded system. I am using Orange Pi zero and I am having stuff with wlan configuration.

I want to run the static ip for wifi on the board and reconnect after every time rebooting

How I do that? I use 2 files below

 

Quote

etc/network/interfaces

---------------------------

auto eth0

allow-hotplug eth0

iface eth0 inet static

  address 192.168.3.100

  netmask 255.255.255.0

  gateway 192.168.3.1

  dns-nameservers 8.8.8.8 8.8.4.4

 

auto wlan0

allow-hotplug wlan0

iface wlan0 inet manual

wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

iface default inet static

  address 192.168.3.111

  netmask 255.255.255.0

  gateway 192.168.3.1

  dns-nameservers 8.8.8.8 8.8.4.4

 

Quote

etc/wpa_supplicant/wpa_supplicant.conf

------------------------------------------------

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

update_config=1

network={

ssid="myssid"

scan_ssid=1

psk="mypasswork"

}

 

The eth0 works fine with this setup otherwise the wlan not active even though I used

ifconfig wlan0 up

but I using ifconfig wlan0 down, it got the static ip like the configuration file then I can't turn on or off using ifconfig up/down one more time

Anyone help me?

Thanks a lot!

To create wpa_supplicant.conf use the follwing command and replace only MySSID with your Wifi_SSID

and MyWiFiPassword with the password of your WiFi-Network:

su -c "wpa_passphrase MySSID MyWiFIPassword > /etc/wpa_supplicant/wpa_supplicant.conf"

In /etc/network/interfaces I do use the following config for a wlan0 configuration:

(here you only have to adjust the IP-address and the gateway-IP)

# device wlan0
auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.6.126
netmask 255.255.255.0
gateway 192.168.6.1
dns-nameservers 8.8.8.8 8.8.4.4
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
#  Disable power saving on compatible chipsets (prevents SSH/connection dropouts )
wireless-mode Managed
wireless-power off

This combination does work here since years ;)

 

The context of your wpa_supplicant.conf should be like something like this:

 

network={
        ssid="MySSID"
        #psk="MyWiFIPassword"
        psk=eb6934445c268ab6ba6138318e69929b8b68bd6421c679410c01f2ad78fafe21
}
 

I you know your WiFi password for sure you can delete the bold line with the leading #

I did read in the last years that the uncoded password wouldnt work anymore in some cases.

 

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.