avafinger / orangepi-h6-ubuntu-base-minimal

Mainline kernel 5.1 5.2 5.3 5.4 H6 (Orange Pi One Plus)
19 stars 5 forks source link

Adding wifi atheros? #3

Closed alexbanks-git closed 5 years ago

alexbanks-git commented 5 years ago

Hi @avafinger, Could you try to add the wifi(ar9271) on the OrangePi H6 please. I tried to add this module on the official 3.10.65 kernel when compiling. in ubuntu it was loaded automatically. in debian I loaded it manually insmod (mac80211.ko, ath.ko, ath9k_hw.ko, ath9k_common.ko, ath9k_htc.ko). in the network interfaces, it was detected, but I could not connect to my wi-fi

avafinger commented 5 years ago

I can try but will not be able to test it. Can you share the .config you used to build those modules?

alexbanks-git commented 5 years ago

configandmodulesandfirmware.zip I'm not good at kernel configuration, I did it for the first time.

avafinger commented 5 years ago

@alexbanks-git

Alex, i have released Mainline Kernel 5.1-rc7 with the ath9k drivers as a module I had to redo the IMG to be able to fix some issues.

It is a CLI but you can install LXDE and tune the way you like.

You need to install wpa and adjust /etc/network/interfaces to connect to your Wifi AP

Simplest way: allow-hotplug wlan0 iface wlan0 inet dhcp wpa-ssid "AP" wpa-psk "PASSWORD"

or install and configure: wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

If you have any trouble, please report and check any error with: dmesg|grep htc dmesg|grep fail dmesg|grep err

alexbanks-git commented 5 years ago

it's great,thank ,i went to test

alexbanks-git commented 5 years ago

I can not write the image on my 8GB microsd sundisk, because 7.38GB is available on it

avafinger commented 5 years ago

Looks like you have an SD card with some weird layout.

You can try:

Or try to reformat the SD CARD (from Linux), type: sudo ./format_sd_mainline /dev/sdX (where X is a letter from b,c,...y)

(SD CARD: /dev/sdX where X is a letter or /dev/mmcblkN where N is your sd card number).

format_sd_mainline.sh.zip

PS: Make it executable sudo chmod +x format_sd_mainline.sh

avafinger commented 5 years ago

Interesting reading for you: https://www.raspberrypi.org/forums/viewtopic.php?t=83952

alexbanks-git commented 5 years ago

okay I will try

alexbanks-git commented 5 years ago

I tried: 1)win32diskimager-RELEASE-0.1-r15-win32 2)resize(gparted) and rewrite 3)clonezilla 4)dd 5)rsync+(dd if=/dev/sdd of=/dev/sdc bs=446 count=1) what i got: turn on the power the green LED is constantly on and red LED blinking (like heartbeat). what does it mean?

avafinger commented 5 years ago

Please, use win32diskimager and don't resize on first boot. Green LED on and RED blinking means the kernel is up. You can try to ssh to the board or ping to see if ethernet is working.

What is your Screen and model? Are you using HDMI?

avafinger commented 5 years ago

Forgot to tell, you will not see anything on boot for a few seconds, when the kernel is up it will prompt you with Login screen, if you dont see it after 15 secs, just type in ubuntu [ENTER] ubuntu [ENTER].

alexbanks-git commented 5 years ago

yes i use HDMI on lg tv 47lb671v

avafinger commented 5 years ago

Ok. HDMI is fixed on 5.1-rc7 , but CEC is enabled and doesn't know if this is working. Do you have a debug TTL to USB to check the message on TTL pins?

alexbanks-git commented 5 years ago

I not have ttl debag

avafinger commented 5 years ago

Do you have ethernet (RJ45) attached? What is your sd card size and maker (brand)?

alexbanks-git commented 5 years ago

ethernet attached ,sd card 8gb SanDisk 48MB/s

alexbanks-git commented 5 years ago

https://liudr.wordpress.com/2016/03/25/back-up-and-clone-raspberry-pi/

alexbanks-git commented 5 years ago

root@linus:~# nmap 192.168.137.2/24 Starting Nmap 7.70 ( https://nmap.org ) at 2019-05-04 13:07 CDT Illegal character(s) in hostname -- replacing with '' Illegal character(s) in hostname -- replacing with '' Stats: 0:00:52 elapsed; 251 hosts completed (4 up), 4 undergoing SYN Stealth Scan SYN Stealth Scan Timing: About 100.00% done; ETC: 13:08 (0:00:00 remaining) Stats: 0:00:53 elapsed; 251 hosts completed (4 up), 4 undergoing SYN Stealth Scan SYN Stealth Scan Timing: About 100.00% done; ETC: 13:08 (0:00:00 remaining) Nmap scan report for D-link.HomeGateway (192.168.137.2) Host is up (0.020s latency). Not shown: 996 closed ports PORT STATE SERVICE 23/tcp open telnet 80/tcp open http 5431/tcp open park-agent 8888/tcp open sun-answerbook MAC Address: B8:A3:86:44:C0:64 (D-Link International)

Nmap scan report for OpenWrt (192.168.137.9) Host is up (0.0022s latency). All 1000 scanned ports on OpenWrt (192.168.137.9) are closed MAC Address: D8:E7:43:03:E4:85 (Wush)

Nmap scan report for 192.168.137.56 Host is up (0.0060s latency). Not shown: 997 filtered ports PORT STATE SERVICE 135/tcp open msrpc 139/tcp open netbios-ssn 445/tcp open microsoft-ds MAC Address: 3C:F8:62:B5:1F:94 (Intel Corporate)

Nmap scan report for 192.168.137.99 Host is up (0.022s latency). All 1000 scanned ports on 192.168.137.99 are filtered MAC Address: B4:EF:FA:78:9E:3F (Lemobile Information Technology (Beijing))

Nmap scan report for home- (192.168.137.5) Host is up (0.000011s latency). All 1000 scanned ports on home- (192.168.137.5) are closed

Nmap done: 256 IP addresses (5 hosts up) scanned in 53.92 seconds root@linus:~# ssh 192.168.137.9 ssh: connect to host 192.168.137.9 port 22: Connection refused root@linus:~# ssh ubuntu@192.168.137.9 ssh: connect to host 192.168.137.9 port 22: Connection refused root@linus:~#

alexbanks-git commented 5 years ago

Screenshot from 2019-05-04 13-11-54

avafinger commented 5 years ago

why did you try to connect to: ssh ubuntu@192.168.137.9

Should be:

ssh ubuntu@192.168.137.5 or ssh ubuntu@192.168.137.56

Do you have anything else on your network?

alexbanks-git commented 5 years ago

192.168.137.5 this my laptop 192.168.137.99 this my smartphone 192.168.137.56 second laptop nmap show me: Nmap scan report for OpenWrt (192.168.137.9) Host is up (0.0022s latency). All 1000 scanned ports on OpenWrt (192.168.137.9) are closed MAC Address: D8:E7:43:03:E4:85 (Wush) but the web interface in the router does not show this host.

avafinger commented 5 years ago

Ok, let's see if this is from the board. Push the ON/OFF button for ~ 7 secs , it will turn off the board. Check again if this addr is gone.

alexbanks-git commented 5 years ago

that's right, this is some other device

avafinger commented 5 years ago

So, my best blind guess is the board booted fine, kernel was up and crashed. Heartbeat would still be working but kernel halted.

The reason? Your SD CARD!

Can you try Etcher?

alexbanks-git commented 5 years ago

i try etcher - board does not turn on. my best blind guess rootfs partition broken after writing

avafinger commented 5 years ago

Sounds like the IMG is broken or the download is corrupt, will check MD5.

avafinger commented 5 years ago

You have Linux, i am pushing the Linux way to burn the SD CARD. Uploading now...

alexbanks-git commented 5 years ago

Новый точечный рисунок

avafinger commented 5 years ago

Please, try this: https://github.com/avafinger/orangepi-h6-ubuntu-base-minimal/releases/tag/v1.10

alexbanks-git commented 5 years ago

ok

avafinger commented 5 years ago

Added the missing file: bootloader.bin

alexbanks-git commented 5 years ago

it's great! thank you! It is working well(green led is on,red led blinking). Hdmi working fine. IMG_20190505_013955-1

IMG_20190505_014332-1 IMG_20190505_015125-1-1 IMG_20190505_014950-1

alexbanks-git commented 5 years ago

IMG_20190505_014225-1-1-1

avafinger commented 5 years ago

Good, and how about the ath9k?

alexbanks-git commented 5 years ago

IMG_20190505_115658-1-1-1 here I: Disconnected the lan cable,disconnected the keyboard and connected ar9271. Then disconnected the ar9271 and reconnected the keyboard and typed dmesg.

on ethernet: ipv6 default on

,not working inet connection , no connect ssh

alexbanks-git commented 5 years ago

Typed this: net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.lo.disable_ipv6 = 1. Lan not working (leds off)after reboot.

avafinger commented 5 years ago

There is an adjustment that possibly fixes this issue.

You can try to adjust emac rx-delay and tx-delay, which is in /boot/opi-h6.dtb (DT). The actual vaues are 200, start with 0 and then increment by 100.

Start with rx (rx-delay must be a multiple of 100 i.e 100,200,300...) and see if can get an IP at some point. Every time you change the value for a new one you must shut down and power cycle the board and see if has improved.

Check what file you should edit (opi-h6.dtb is a symlink to a file, do not edit this symlink, edit the file it points to):

cd /boot
ls -la opi-h6.dtb

Decompile the file (not the symlink) DTB with DTC (i am not sure dtc is already installed): For example: sudo dtc -I dtb -o opi.dts opi-h6.dtb_5.1.0-rc7-h6

Edit the file **opi.dts(( and change the value, save and compile to DTB again. Boot and check if improved.

Find the string: ethernet@5020000 { compatible = "allwinner,sun50i-h6-emac", "allwinner,sun50i-a64-emac"; syscon = <0x1f>; reg = <0x5020000 0x10000>; interrupts = <0x0 0xc 0x4>; interrupt-names = "macirq"; resets = <0x2 0x21>; reset-names = "stmmaceth"; clocks = <0x2 0x54>; clock-names = "stmmaceth"; status = "okay";

address-cells = <0x1>;

size-cells = <0x0>;

pinctrl-names = "default"; pinctrl-0 = <0x20>; phy-mode = "rgmii"; phy-handle = <0x21>; phy-supply = <0x22>; allwinner,rx-delay-ps = <0x0>; allwinner,tx-delay-ps = <0x0>;

re-compile with: sudo dtc -I dts -o opi-h6.dtb_5.1.0-rc7-h6.dts

Please, when providing info doo this: dmesg|grep eth > eth_message.txt and attach the file.

And check your RJ45 connection to the board!

avafinger commented 5 years ago

You can do it in your HOST PC (linux), no need to do it on the board.

alexbanks-git commented 5 years ago

eth_message.txt ethernet working

avafinger commented 5 years ago

And the athk9?

alexbanks-git commented 5 years ago

no dmesg_iw_dev_lsmod.txt

avafinger commented 5 years ago

Looks like the entire wifi stack is needed or some module support is missing. As soon as a new kernel is released i will build with all modules. See if you can find the Product ID (install packages if necessary) lsusb -v

and dmesg|grep htc

avafinger commented 5 years ago

dmesg|grep usb

avafinger commented 5 years ago

try also:

lsusb -v | grep -E '\<(Bus|iProduct|bDeviceClass|bDeviceProtocol)' 2>/dev/null > usb.txt

alexbanks-git commented 5 years ago

lsusb_dmesg.txt usb.txt

avafinger commented 5 years ago

What do you see if: sudo modprobe ath9k

alexbanks-git commented 5 years ago

root@opi-h6:~# modprobe ath9k modprobe: FATAL: Module ath9k not found in directory /lib/modules/5.1.0-rc7 root@opi-h6:~#

Screenshot_20190506-190321-1

avafinger commented 5 years ago

Please, check if i made a mistake and forgot to build the driver: sudo cat /proc/config.gz | gunzip > running.config

Edit the file running.config and search for the ATH9K.

avafinger commented 5 years ago

cat running.config|grep ATH9

alexbanks-git commented 5 years ago

Screenshot_20190506-200937-1