Please select To the mobile version | Continue to access the desktop computer version

OrangePi

 Login            
 Register            
Search
Hot search: orangepi
Author: FransM

WiFi module

[Copy link]
Post time 2015-12-16 17:05:49 | Show all posts
miha replied at 2015-12-16 16:49
Now i need to implement commands to boot up procedure.

I would do a simple google search for
  1. "ip route add default via" eth0 wlan0
Copy the Code
or something like that since there are a few possibilities to achieve this in linux. And it's nothing special to OPi but applies to 'generic linux'.

0

Threads

31

Posts

109

Credits

Registered member

Rank: 2

Credits
109
Post time 2015-12-16 18:20:59 | Show all posts
Edited by miha at 2015-12-16 19:21

Putting post-up commands to /etc/network/interfaces does not work, "failed to bring up wlan0" was visible on console, tested several times.

  1. auto wlan0
  2. iface wlan0 inet static
  3.         address 192.168.255.7
  4.         netmask 255.255.255.0
  5.         gateway 192.168.255.1
  6.         wpa-essid mySSID
  7.         wpa-psk 12345678
  8.         post-up /sbin/ip route del 0/0 || /bin/true
  9.         post-up /sbin/ip route del 192.168.255.0/24 dev eth0 || /bin/true
  10.         post-up /sbin/ip route add default via 192.168.255.1 || /bin/true
Copy the Code


So i commented out post-up-lines on interfaces-file and uncommented same lines (without post-up) on rc.local, and after restart wlan0 works.

I need to study more to fully understand this.

Br
-miha

EDIT: I'll try with 'up' instead on 'post-up' and if that fails also, I'll try calling script  from interfaces-file.

0

Threads

31

Posts

109

Credits

Registered member

Rank: 2

Credits
109
Post time 2015-12-16 19:57:52 | Show all posts
Edited by miha at 2015-12-16 22:28

Hi,

'up' does not work either, fails also executing script.

However, script is executed if it is called from interfaces-file like this:

  1. auto eth0
  2. iface eth0 inet static
  3.         address 192.168.255.15
  4.         netmask 255.255.255.0
  5.         gateway 192.168.255.1
  6.         pre-up /usr/local/sbin/fix.sh &
Copy the Code


Under wlan0-section, does not work
Under eth0-section, works.

Maybe script needs to be called before wpa-lines, don't know.
-miha

0

Threads

31

Posts

109

Credits

Registered member

Rank: 2

Credits
109
Post time 2015-12-17 17:05:11 | Show all posts

ver

Edited by miha at 2015-12-17 19:09

Hi,

Tested again to run my fix.sh under wlan0-section on file /et/network/interfces without luck.

Current working file looks this:

  1. auto lo
  2. iface lo inet loopback

  3. auto eth0
  4. iface eth0 inet static
  5.         address 192.168.255.15
  6.         netmask 255.255.255.0
  7.         gateway 192.168.255.1
  8.          pre-up /usr/local/sbin/fix.sh &

  9. auto wlan0
  10. iface wlan0 inet static
  11.         address 192.168.255.7
  12.         netmask 255.255.255.0
  13.         gateway 192.168.255.1
  14.         up /sbin/ifconfig wlan0 192.168.255.7 up
  15.         wpa-essid TANA
  16.         wpa-psk 12345678
Copy the Code


Tried to set fix.sh before wpa-lines didn't help. I am quite happy anyway since wlan0 works and connects to my WPA2-PSK network seamlessly

Here is my fix.sh:

  1. #!/bin/bash
  2. ####################################################
  3. #
  4. # Dec 17, 2015 miha
  5. # Ver. 1.0
  6. # This script is called via /etc/network/interfaces
  7. #
  8. ####################################################
  9. counter=0
  10. while [ $counter -le 10 ]
  11. do
  12.         (( counter++ ))
  13.         sleep 1
  14.                 if [ `ip a s | grep -c "192.168.255.7"` -lt 1 ];  then
  15.                 /sbin/ip route del 0/0
  16.                 /sbin/ip route del 192.168.255.0/24 dev eth0
  17.                 /sbin/ip route add default via 192.168.255.1               
  18.                 exit 0
  19.         else
  20.                 sleep 2               
  21.         fi
  22. done
  23. exit 0
Copy the Code


EDIT: This forum is VERY slow and causes problems when posting or editing.  For example this reply to this thread is edited several times before i managed to get it like i wanted.
Post time 2015-12-29 01:06:46 | Show all posts
Edited by chaszim at 2015-12-29 01:23

We do need a better way of keep all this straight. And some mention of it's implementation needs to be documented. For not only this but all the branch of the project.
So, I don't mind re-reading posts that are re-edited, because logically you'll keep on making it better each time.  So, I wouldnt be too upset with your editing, you should see mine.
Post time 2015-12-31 12:09:49 | Show all posts
Edited by chaszim at 2016-1-1 04:05

I've started searching Debian's Armhf branch.
Does this Debian link help or hurt the flow on getting WiFi working on OIP? https://wiki.debian.org/WiFi Wifi-radar packages Ubuntu
https://launchpad.net/ubuntu/+so ... s08+dfsg-1.1ubuntu1
I just happen to have the n150 netgear dongle the prefer
https://groups.google.com/forum/ ... e-black/9KCIs7yqsa8
got one of these too.
http://shawnhymel.com/87/getting ... 13-olinuxino-micro/
http://linuxembeded.blogspot.com ... dule-rtl8188cu.html
http://superuser.com/questions/8 ... debian-wheezy-armhf
I'd guess this is part of what's needed, except it has to use the correct ARM branch
https://blog.poettner.de/2012/08 ... pi-running-raspian/
I'm just tossing these up here for possible reference to help solve our WiFi issue.
I'm guessing part of the trouble will be with every driver install will just bloat the kernel.




0

Threads

31

Posts

109

Credits

Registered member

Rank: 2

Credits
109
Post time 2015-12-31 23:20:12 | Show all posts
Hi,

I followed this to get driver for WiFi; https://github.com/lwfinger/rtl8188eu

Works with Orange Pi Plus running Debian wheezy

Br
-miha

0

Threads

31

Posts

109

Credits

Registered member

Rank: 2

Credits
109
Post time 2015-12-31 23:20:41 | Show all posts
Hi,

I followed this to get driver for WiFi; https://github.com/lwfinger/rtl8188eu

Works with Orange Pi Plus running Debian wheezy

Br
-miha
Post time 2016-1-6 09:55:08 | Show all posts
Edited by chaszim at 2016-1-6 10:09

The two articles first Hackaday got a PiZero, in this article they got the WiFi working too easy, could it be done the same way on OPI.do the programs they loaded need ported?
http://hackaday.com/2015/12/23/firing-up-a-pi-zero/
The second http://davidmaitland.me/2015/12/raspberry-pi-zero-headless-setup/
Remember this is just a news article.
You have to log in before you can reply Login | Register

Points Rules

Archiver|Mobile edition|Darkroom|OrangePi En ( 粤ICP备14086627号-2

2020-7-6 11:49 GMT+8 , Processed in 0.031389 second(s), 19 queries .

Powered by Discuz! X3.2

© 2014-2015 orangepibbs en.

Quick Reply To Top Return to the list