Jump to content

Building OpenWRT images for Orange Pi Zero with the Armbian kernel


hyphop
 Share

Recommended Posts

Armbian Linux community supported weekly builds download

What did go wrong before?

 

I changed /etc/config/network and configured lan with a static ip. I updated the GitHub Gist with the exact details.

 

Thanks again.

 

Does anyone know if there is a simpler web based way to configure WiFi in OpenWRT? I use DD-WRT on my home router and and WLAN configuration on it is straight forward. You need not bother with the underlyings on DD-WRT.

Link to comment
Share on other sites

It's shell code. You can type in terminal or put it in a .sh file and execute.

i don't know what wrong,? i just type a script code in terminal, after that, i putt my usd to my opi zero, and then i type lsmod.

there is much more modules. i can't find my wlan.

please tell me, where i did wrong ?

Link to comment
Share on other sites

hi guys, thanks for this tutorial it helped me to run OpenWrt on my Orange Pi ZERO, but there is a problem i cant figure out

 

i cant find /etc/config/wireless config so i cant use wifi..

can you help me?

u must run openwrt on device, then the machine will be automatically network ip

Link to comment
Share on other sites

u must run openwrt on device, then the machine will be automatically network ip

hi, thanks for reply but i am not sure what do you mean :D

 

i already run openwrt o device and it works, but i can setup only LAN interface an i have only /etc/config/network config and dont have /etc/config/wireless so i cant start using wifi interface

i can normaly open 192.168.1.1 web UI and also can connect to SSH or telnet, but problem is that i dont know how to start WIFI  :( 

Link to comment
Share on other sites

hi, thanks for reply but i am not sure what do you mean :D

 

i already run openwrt o device and it works, but i can setup only LAN interface an i have only /etc/config/network config and dont have /etc/config/wireless so i cant start using wifi interface

i can normaly open 192.168.1.1 web UI and also can connect to SSH or telnet, but problem is that i dont know how to start WIFI :(

me too, u'r problems same to me

Link to comment
Share on other sites

I have updated the GitHub Gist to make things even more obvious and easy. Let me know if there is any step I can improve.

 

Check it out - https://gist.github.com/praveenbm5/3c81692e6b2b651bb450fb7fc45dff4d

 

On supported routers, OpenWRT comes with a WiFi menu item under Network Tab but here in this build of OpenWRT for Allwinner boards it is missing. Even I am looking for ways to enable it but so far nothing worked. 

 

Ref: https://wiki.openwrt.org/doc/walkthrough_wifi

 

There are other ways using HostAPD for AP and wpa_supplicant for Wifi Client but all these methods are too cumbersome and rely on shell commands and config files.

Link to comment
Share on other sites

On supported routers, OpenWRT comes with a WiFi menu item under Network Tab but here in this build of OpenWRT for Allwinner boards it is missing. Even I am looking for ways to enable it but so far nothing worked.

 

I haven't tried this yet, even if you make process very well explained. For which i thank you.

But for this specific issue i can advice to build your own image from source with drivers, firmwares and apps preinstalled. This have to activate necessary menus in Luci and needed modules. At least i do this for LamoboR1 where i have to use external wifi modules and for some reason there is no way to install packages for it, if they are not already built-in. But i still am not very sure how this mix with Armbian works and did OpenWrt use it's own drivers and firmwares, or Armbian ones.

Link to comment
Share on other sites

We use only u-boot and Kernel from Armbian. Rest everything is OpenWRT. It is just a quick and dirty hack to get things going but it should work with out issues.

 

If you have done it before... you can do it again. Can you build a custom sunxii image for OpiZero?

Link to comment
Share on other sites

If you have done it before... you can do it again. Can you build a custom sunxii image for OpiZero?

 

I've done it for LamoboR1 (A20), only Orange, supported by OpenWrt is Orange Pi Plus (with comment that is not bootable at the moment). I can try to build custom sunxi image with some stuff included, but i am not sure if wifi module in OpiZero (XR819) is supported by OpenWRT. I don't remember if there where any AllWinner wifi drivers and firmware. But googling around i come through this - ОбÑуждение Orange Pi Zero. Looks like some 4pda guy claim to have OpenWrt image with working wifi - http://4pda.ru/forum/index.php?s=&showtopic=782242&view=findpost&p=55805628. But image uploaded can't be downloaded. Maybe registration is needed, but i always forgot my login and conformation emails from this site takes forever to come.

Link to comment
Share on other sites

I've done it for LamoboR1 (A20), only Orange, supported by OpenWrt is Orange Pi Plus (with comment that is not bootable at the moment). I can try to build custom sunxi image with some stuff included, but i am not sure if wifi module in OpiZero (XR819) is supported by OpenWRT. I don't remember if there where any AllWinner wifi drivers and firmware. But googling around i come through this - ОбÑуждение Orange Pi Zero. Looks like some 4pda guy claim to have OpenWrt image with working wifi - http://4pda.ru/forum/index.php?s=&showtopic=782242&view=findpost&p=55805628. But image uploaded can't be downloaded. Maybe registration is needed, but i always forgot my login and conformation emails from this site takes forever to come.

 

That image posted by Hyphop on 4pda.ru is the same as the one created by following my Gist posted on GitHub from my previous posts. In fact I created my image and that gist following @hyphop's and @dreamdream's cues and directions.

 

It uses Armbian uBoot and Kernel (including modules and firmware) and the rest is OpenWRT. If you read through my gist you will understand it.

 

Since Wifi works on Armbian with a small tweak ( #printf "xradio_wlan" >> /etc/modules ) it will work on OpenWRT too with a similar tweak ( #printf "xradio_wlan\nxradio_wlan" >> /etc/modules.d/xradio_wlan ). The trick is you need to load xradio module twice because of a bug.

 

We can make a generic sunxi build of openwrt to boot on OpiZero with Wifi support following this gist.

 

https://gist.github.com/praveenbm5/3c81692e6b2b651bb450fb7fc45dff4d

 

So if you can build a generic OpenWRT image with Wifi and other menus / pages / plugins enabled, it will be great.

Link to comment
Share on other sites

@RagnerBG - If you are building the image from scratch, can you include full bash and coreutils/linux-utils instead of busybox?

 

I am not so advanced and i don't know how to replace busybox, but i add coreutils with all it's stuff in menuconfig, maybe you know what to do with it. For some reason i didn't make full image, only rootfs, but this is what is needed right? Unfortunately there is nothing for AllWinner wifi modules, but i added almost everything else (except exotic things and what i know will break compilation), so there have to be Network/Wifi menu in Luci. There is no OrangePi device in official source, it is in some other branches, but when i tried to compile there, i always had errors, so i build it for AllWinner Default package set. Boot loader is for LamoboR1, but i think you don't need this. There is no H2/3 anyway.

openwrt-sunxi-root.tar

Link to comment
Share on other sites

I am not so advanced and i don't know how to replace busybox, but i add coreutils with all it's stuff in menuconfig, maybe you know what to do with it. For some reason i didn't make full image, only rootfs, but this is what is needed right? Unfortunately there is nothing for AllWinner wifi modules, but i added almost everything else (except exotic things and what i know will break compilation), so there have to be Network/Wifi menu in Luci. There is no OrangePi device in official source, it is in some other branches, but when i tried to compile there, i always had errors, so i build it for AllWinner Default package set. Boot loader is for LamoboR1, but i think you don't need this. There is no H2/3 anyway.

 

Great... let me give this a try and will post the results back.

Link to comment
Share on other sites

I have updated the GitHub Gist to make things even more obvious and easy. Let me know if there is any step I can improve.

 

Check it out - https://gist.github.com/praveenbm5/3c81692e6b2b651bb450fb7fc45dff4d

 

On supported routers, OpenWRT comes with a WiFi menu item under Network Tab but here in this build of OpenWRT for Allwinner boards it is missing. Even I am looking for ways to enable it but so far nothing worked. 

 

Ref: https://wiki.openwrt.org/doc/walkthrough_wifi

 

There are other ways using HostAPD for AP and wpa_supplicant for Wifi Client but all these methods are too cumbersome and rely on shell commands and config files.

 

I created a /etc/config/wireless file manually, then reboot. After that the "Wifi" menu item appeared under the "Network" menu.

 

I also installed wpa-supplicant & hostapd (according to the hints in the wifi config page), but wifi is still not working.

Link to comment
Share on other sites

I created a /etc/config/wireless file manually, then reboot. After that the "Wifi" menu item appeared under the "Network" menu.

I was about to suggest this, but without driver this will lead you to nowhere. I can only guess, but perhaps you need to manually add configuration for your wifi module in /etc/config/wireless . This is my current config for LamoboR1, but there is wifi driver in OpenWrt:


config wifi-device 'radio0'
	option type 'mac80211'
	option hwmode '11g'
	option path 'soc@01c00000/1c14000.usb/usb1/1-1/1-1:1.0'
	option htmode 'HT40'
	option txpower '20'
	option country 'CA'
	option noscan '1'
	option channel '2'

config wifi-iface
	option device 'radio0'
	option network 'lan'
	option mode 'ap'
	option key 'xxx'
	option encryption 'psk2'
	option macaddr 'xxx'
	option ssid 'xxx'

What you need is to check "option path" for your wifi card (i don't have OpiZero and can't help). I can assume it's on usb bus, so check /sys/devices and "lsusb -t" for correct soc@ path. I don't have a glue what will be situation with "option type". But the major part is driver. As it is present in Armbian, maybe you can load module from there (i don't know how, insmod maybe), but you need firmware too. I read somewhere firmware can be copied manually, but can't remember where. But i am not so deep into Linux and maybe most i wrote is baloney, so take it as you wish.

Link to comment
Share on other sites

I was about to suggest this, but without driver this will lead you to nowhere. I can only guess, but perhaps you need to manually add configuration for your wifi module in /etc/config/wireless . This is my current config for LamoboR1, but there is wifi driver in OpenWrt:


config wifi-device 'radio0'
	option type 'mac80211'
	option hwmode '11g'
	option path 'soc@01c00000/1c14000.usb/usb1/1-1/1-1:1.0'
	option htmode 'HT40'
	option txpower '20'
	option country 'CA'
	option noscan '1'
	option channel '2'

config wifi-iface
	option device 'radio0'
	option network 'lan'
	option mode 'ap'
	option key 'xxx'
	option encryption 'psk2'
	option macaddr 'xxx'
	option ssid 'xxx'

What you need is to check "option path" for your wifi card (i don't have OpiZero and can't help). I can assume it's on usb bus, so check /sys/devices and "lsusb -t" for correct soc@ path. I don't have a glue what will be situation with "option type". But the major part is driver. As it is present in Armbian, maybe you can load module from there (i don't know how, insmod maybe), but you need firmware too. I read somewhere firmware can be copied manually, but can't remember where. But i am not so deep into Linux and maybe most i wrote is baloney, so take it as you wish.

 

Thanks for your information.

 

 

Here is my lsusb -t output :

root@pizero:~# lsusb -t
/:  Bus 08.Port 1: Dev 1, Class=root_hub, Driver=sunxi-ohci/1p, 12M
/:  Bus 07.Port 1: Dev 1, Class=root_hub, Driver=sunxi-ohci/1p, 12M
/:  Bus 06.Port 1: Dev 1, Class=root_hub, Driver=sunxi-ohci/1p, 12M
/:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=sunxi-ohci/1p, 12M
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=sunxi-ehci/1p, 480M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=sunxi-ehci/1p, 480M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=sunxi-ehci/1p, 480M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=sunxi-ehci/1p, 480M

After checking a few openwrt routers' /etc/config/wireless, I think the "option path" is one of the subdirectory under /sys/devices, so I tried :

    option type 'mac80211'
    option path "platform/xradio_pm.0"   # also tried "platform/wifi_pm.0"

I also copied /lib/netifd/wireless/mac80211.sh from another other router (due to the error message from "wifi" command). With all the mentioned steps, wifi is still not working, and the operating frequency, mode, band, channel, width are not displayed in the Luci wifi config page. It seems that openwrt cannot read such information from the Wifi device.

Link to comment
Share on other sites

For WiFi with Armbian Kernel - You need a tweak - #printf "xradio_wlan\nxradio_wlan" >> /etc/modules.d/xradio_wlan

 

The xradio_wlan driver has a bug and it needs to be loaded twice. Restart.

 

To configure WiFi from LUCI we need the /etc/config/wireless file in place.

 

My /etc/config/wireless - AP not yet working, Scanning works from LUCI

config wifi-device 'wlan0'
        option type 'mac80211'
        option channel 'auto'
        option hwmode '11ng'
        option path 'soc/soc:pcie-controller/pci0000:00/0000:00:02.0/0000:02:00.0'
        option htmode 'HT20'

config wifi-iface
        option device 'wlan0'
        option network 'lan'
        option mode 'ap'
        option ssid 'OPiZero'
        option encryption 'psk2'
        option key 'password'

Link to comment
Share on other sites

@praveenbm5 :

 

1. Load module twice : already done it according to your guide.

 

2. As long as I change the "wifi-device" and "option device" to 'wlan0' (I used 'radio0' before), scanning works in Luci, no matter what the "option path" is.

 

3. AP is not working, wireless client is not working too.

Link to comment
Share on other sites

Hi, I'm trying to build a firmware for Orange Pi Zero by using the Image Builder that I downloaded from this link
But when I do make info there's no option for Orange Pi Zero, the only options are what you see in the picture below. How can I build this firmware with Image Builder ?

 

image.png

Edited by zador.blood.stained
OpenWRT is discussed here - merged the threads
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...