Jump to content

victroniko

Members
  • Posts

    7
  • Joined

  • Last visited

Posts posted by victroniko

  1. On 8/3/2020 at 5:41 AM, jock said:

    I prepared this other kernel module: esp8089.nop2p.ko  I blindly changed a couple of source code lines to avoid the p2p0 interface creation. I don't know if this works, but you may give it a chance. Overwrite the existing esp8089.ko with this one and reboot to see if it has any effect...

     

    Quick update on ESP8089: with this module, it works every time :thumbup:

     

    Didn't do any speed tests as I'm somewhat far from the router (the box lost connection randomly, but my laptop does that too). General web browsing and system upgrades were on par with ethernet. Need to do final tests but I feel we're 95% there... a BIG thank you @jock!!

  2. 6 hours ago, jock said:

    @victroniko

    Glad to hear progress! I'm sorry I pointed you to use crystal_26M_en=2, but that was because all the rk322x boxes I have seen use a 24Mhz crystal, so I thought the same was for yours. I first checked on the pictures you provided, but the crystal was totally unreadable.

     

    If you created /etc/modprobe.d/esp8089.conf file (as I suggested you in this other post), remove it. Also unblacklist the esp8089 module and reboot.

    From what I see from source code, the 40Mhz crystal is the default when no options are passed to the kernel module.

     

    I prepared this other kernel module: esp8089.nop2p.ko  I blindly changed a couple of source code lines to avoid the p2p0 interface creation. I don't know if this works, but you may give it a chance. Overwrite the existing esp8089.ko with this one and reboot to see if it has any effect...

     

    For the issue about the media framework, I'll take a look into it...

     

     

    No problem! Better to find & understand why things don't work, than receiving spoonfed solutions :) although I might've been doing a bit of that...

     

    About /etc/modprobe.d/esp8089.conf - already gone, first tests were done on 20.05.6, after the wipe I mentioned earlier i'm on 20.08.0 now. What I do find strange, is that relying on default setting does not work. Passing the crystal_26M_en=0 parameter did the trick, on this board at least... Every test was with an inmediate power off-on cycle instead of a reboot, to discard possible quirks from the already initialized (firmware loaded) ESP8089 chip.

     

    Before heading to work, I left the box cloning the repo and downloading packages required for compilation. I'll try your module (thanks!) but even if it works, I also want to look at the code and try compile for myself too. 

     

     

    offtopic. I said I don't know C/C++, that's true... But I did some things in VB6 many years ago, it's not as if I saw modern code and felt totally lost.. And my day-job is electronics so I understand quite a bit how microcontrollers work :P

     

  3. Status report on ESP8089: it works! :) ... well, kinda.

     

    I stumbled on this PDF from Espressif that leaded me on the right path:

     

    Quote

    crystal_26M_en:

    Shows the crystal frequency supported by the SoC. Currently, it supports the following three kinds of crystals:

        0: 40MHz crystal

        1: 26MHz crystal

        2: 24MHz crystal

    Default value: 0

    DESC: After opening wifi search AP, check if the crystal is matched with the value.

     

    While this document is WAY outdated, most of parameters are still valid. I opened my box again and found a 40Mhz crystal behind the chip. Still, modprobing the driver without parameters (assuming default value) did NOT work. I had to explicitly define crystal_26M_en=0, then it worked perfectly.

     

    Why 'kinda'? because it works only on manual load:

     

    • Blacklist esp8089.ko --> modprobe esp8089 config=crystal_26M_en=0 --> p2p0 'not ready' & wlan0 working OK, can connect to any AP.
    • Let Armbian load the module at boot --> wlan0 'not ready' & p2p0 scanning but not connecting to any AP -- auth timeout.

     

    Clearly this chip won't work with p2p0 like others. Looking at udev load process, I've found some hints to exchange interfaces by driver load-order, but nothing about a single driver exposing 2 different interfaces. There is something on Armbian boot process that reverses them (for the worse) and I don't know what it is.

     

    ---

     

    On another note: Latest update broke @jock's media framework... for some reason apt decided that xserver-org-video-armsoc now depends on xserver-org-video-armsoc-exynos :mellow: and if one forces the update, X11 breaks. If it happens to someone else, you can fix like this:

     

    • Manual remove of both packages
    • Manual install of xserver-org-video-armsoc from the framework's folder
    • dpkg-reconfigure xserver-xorg lightdm
    • apt-mark hold xserver-org-video-armsoc (marks package as non-upgradeable - placeholder fix for now)
    • ??
    • Profit!
  4. Last night I wiped NAND and installed Focal minimal-legacy image, also without a hitch :thumbup:. But armbian-config does not come by default. No biggie, just install manually and problem solved... Then I wanted to install a minimal desktop via armbian-config, and realized the option is not even there: It only offers to install full XFCE desktop+extras.

     

    So what I did was to install LXDE by hand (plus few goodies: lxtask, pasystray, network-manager-gnome etc). Overall the system feels faster, and with @jock's media script/bundle  & @nokirunner 's tip about glamor, it's almost silky-smooth now. The only hitch was that lightdm refused to start at all, so I just installed lxdm, enabled autologin in the config and called it a day.

     

    But that's just regular Armbian stuff... I'm at work now, when I return home i'll try my luck again with ESP8089.

     

     

    On 7/27/2020 at 2:46 AM, fabiobassa said:

    @victroniko

    But I putted here a tool for extracting pieces from androd tool may be it was not clear.

    you can use this imgRePackerRK_106.zip
     

    imgRePackerRK_106.zip 176.25 kB · 2 downloads

     

    Yep saw it, added to my arsenal of RK tools ;) thank you!

     

    On 7/27/2020 at 7:59 AM, jock said:

    About the autoloading of the esp8089 module at startup, you can create a file in /etc/modprobe.d/esp8089.conf and put this content into:

    
    options esp8089 crystal_26M_en=2

    so when the module is autoloaded, it is also given the appropriate module parameter.

     

    Okay, will do that.

     

    On 7/27/2020 at 7:59 AM, jock said:

    As another hint, to test the firmwares and things avoid the Network Manager. It is slow and has latency, and does not always reacts immediately. Use the command line tools to scan the networks, for example (always use sudo, or do it as superadmin, otherwise you get cached data):

    
    sudo iwlist wlan0 scan

    You may also scan the p2p0 interface and see what changes. Usually you won't get more than 10-12 access points in the list.

     

    Noted, thank you. I was vaguely suspecting NM's behaviour was strange, and also completely forgot about nmtui & iwlist. Spoiled by the GUI haha... I'll do this later too.

     

     

    On 7/27/2020 at 7:59 AM, jock said:

    I could not find any evidence in the source code that the files should be placed in esp8089 subdirectory, so I'm not totally convinced about the firmware placement in /lib/firmware/esp8089. Double check that this is really what the kernel module wants: loading the kernel module and doing a successful scan should be enough. Every kernel module developer decides where the files are put, some wants their own subdirectory, some others don't. dmesg should tell you if the firmware was in the right position or not, always read its output very carefully!

     

    Once you get sane and predictable results with iwlist, you may proceed to use the Network Manager to connect to a network. From the command line you can also use the handy nmtui tool

     

    Always reboot between tests, even though I read that rmmod (prefer modprobe -r to unload a module, anyway) crashes the kernel and freezes the system, so there is no other chance :)

     

    Good luck!

     

    I was also confused, but it just worked :huh: need to test again on this fresh install though. Also the esp8089.ko driver you compiled for me doesn't print anything to the kernel log at all. So it's difficult to debug if it loaded correctly, or complains about firmware error/mismatch/etc...

     

    Thanks again!

  5. 11 hours ago, fabiobassa said:

    wow compliments for the idea of extracting the dtb via binwalk, a bit long but a ingenious idea !!

     

    Thanks @fabiobassa... just wanted to see if this could be automated in a script w/no need of any specific Rockchip tool, for an idea I have...

     

     

    18 hours ago, jock said:

    Once there, you may try again to modprobe (there are differences between insmod and modprobe, you can consult the manpages for that) the esp8089 kernel driver and see what happens!

     

    Sorry, last post I meant modprobe not insmod...

     

    Almost there! :) with your DTB overlay I got this:

     

    Spoiler

    victor@rk322x-victor:~$ dmesg | egrep 'mmc'
    [    3.694076] dwmmc_rockchip 30000000.dwmmc: IDMAC supports 32-bit address mode.
    [    3.694273] dwmmc_rockchip 30000000.dwmmc: Using internal DMA controller.
    [    3.694299] dwmmc_rockchip 30000000.dwmmc: Version ID is 270a
    [    3.694418] dwmmc_rockchip 30000000.dwmmc: DW MMC controller at irq 45,32 bit host data width,256 deep fifo
    [    3.694503] dwmmc_rockchip 30000000.dwmmc: No vmmc regulator found
    [    3.694515] dwmmc_rockchip 30000000.dwmmc: No vqmmc regulator found
    [    3.694545] dwmmc_rockchip 30000000.dwmmc: GPIO lookup for consumer cd
    [    3.694554] dwmmc_rockchip 30000000.dwmmc: using device tree for GPIO lookup
    [    3.694596] of_get_named_gpiod_flags: parsed 'cd-gpios' property of node '/dwmmc@30000000[0]' - status (0)
    [    3.694664] dwmmc_rockchip 30000000.dwmmc: Got CD GPIO
    [    3.694674] dwmmc_rockchip 30000000.dwmmc: GPIO lookup for consumer wp
    [    3.694684] dwmmc_rockchip 30000000.dwmmc: using device tree for GPIO lookup
    [    3.694696] of_get_named_gpiod_flags: can't parse 'wp-gpios' property of node '/dwmmc@30000000[0]'
    [    3.694708] of_get_named_gpiod_flags: can't parse 'wp-gpio' property of node '/dwmmc@30000000[0]'
    [    3.694716] dwmmc_rockchip 30000000.dwmmc: using lookup tables for GPIO lookup
    [    3.694728] dwmmc_rockchip 30000000.dwmmc: lookup for GPIO wp failed
    [    3.707606] mmc_host mmc0: Bus speed (slot 0) = 400000Hz (slot req 400000Hz, actual 400000HZ div = 0)
    [    3.720712] dwmmc_rockchip 30000000.dwmmc: 1 slots initialized
    [    3.721214] dwmmc_rockchip 30010000.dwmmc: num-slots property not found, assuming 1 slot is available
    [    3.721322] dwmmc_rockchip 30010000.dwmmc: IDMAC supports 32-bit address mode.
    [    3.721466] dwmmc_rockchip 30010000.dwmmc: Using internal DMA controller.
    [    3.721488] dwmmc_rockchip 30010000.dwmmc: Version ID is 270a
    [    3.721562] dwmmc_rockchip 30010000.dwmmc: DW MMC controller at irq 46,32 bit host data width,256 deep fifo
    [    3.721661] dwmmc_rockchip 30010000.dwmmc: No vmmc regulator found
    [    3.721675] dwmmc_rockchip 30010000.dwmmc: No vqmmc regulator found
    [    3.721700] dwmmc_rockchip 30010000.dwmmc: GPIO lookup for consumer wp
    [    3.721708] dwmmc_rockchip 30010000.dwmmc: using device tree for GPIO lookup
    [    3.721723] of_get_named_gpiod_flags: can't parse 'wp-gpios' property of node '/dwmmc@30010000[0]'
    [    3.721736] of_get_named_gpiod_flags: can't parse 'wp-gpio' property of node '/dwmmc@30010000[0]'
    [    3.721745] dwmmc_rockchip 30010000.dwmmc: using lookup tables for GPIO lookup
    [    3.721754] dwmmc_rockchip 30010000.dwmmc: lookup for GPIO wp failed
    [    3.721857] dwmmc_rockchip 30010000.dwmmc: allocated mmc-pwrseq
    [    3.733285] mmc_host mmc1: Bus speed (slot 0) = 2343750Hz (slot req 400000Hz, actual 390625HZ div = 3)
    [    3.746043] dwmmc_rockchip 30010000.dwmmc: 1 slots initialized
    [    4.098666] mmc1: queuing unknown CIS tuple 0x01 (3 bytes)
    [    4.106308] mmc1: queuing unknown CIS tuple 0x1a (5 bytes)
    [    4.109548] mmc1: queuing unknown CIS tuple 0x1b (8 bytes)
    [    4.110757] mmc_host mmc1: Bus speed (slot 0) = 50000000Hz (slot req 50000000Hz, actual 50000000HZ div = 0)
    [    4.112938] mmc1: queuing unknown CIS tuple 0x80 (1 bytes)
    [    4.113063] mmc1: queuing unknown CIS tuple 0x81 (1 bytes)
    [    4.113191] mmc1: queuing unknown CIS tuple 0x82 (1 bytes)
    [    4.113265] mmc1: new high speed SDIO card at address 0001
    victor@rk322x-victor:~$ 

     

    No idea what those "queuing unknown CIS tuple" errors mean... Then after sudo modprobe esp8089 config=crystal_26M_en=2:

     

    Spoiler

    victor@rk322x-victor:~$ dmesg
    .
    .
    .
    [  404.951204] IPv6: ADDRCONF(NETDEV_UP): p2p0: link is not ready
    [  404.954909] IPv6: ADDRCONF(NETDEV_UP): p2p0: link is not ready
    [  405.021791] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
    [  405.166880] IPv6: ADDRCONF(NETDEV_UP): p2p0: link is not ready
    victor@rk322x-victor:~$

     

    With this, NetworkManager finally got 2 new interfaces: p2p0 with 'device not ready' and wlan0 with 'disconnected'. But still no networks showing up...

     

    Fiddling with things I noted you told me to put fimware files in /lib/firmware, and esp8089.ko on /lib/modules/4.4.194-rk322x/kernel/drivers/net/wireless. But on these folders most files go into their own subfolders... So I tried creating new ones: moved esp8089.ko to /lib/modules/4.4.194-rk322x/kernel/drivers/net/wireless/esp8089, and all eagle_fw*.bin to /lib/firmware/esp8089. Unloaded the module, then ran depmod and tried again.

     

    This is what happened (once):

     

    Spoiler

    GaYVRkC.png

     

    Still can't connect to any AP because of wrong interface, as I understand p2p0 is for WiFi Direct.

     

    I tried rebooting and noticed that esp8089 module now loads automatically at startup, but shows 'device not ready' for both interfaces on NM. Could it be because it loads without the config=crystal_26M_en=2 parameters? Anyway, trying to rmmod then modprobe with them crashes the OS (even mouse cursor freezes) so for now, I can't reproduce the above. Because I'm an Armbian noob and don't know how to set module parameters on boot :P

     

    01:14am here, time for sleep... This one-post-a-day limit is getting annoying LOL.

  6. Well, as I said i'm no programmer :) but I know my way into the firmware world, more or less...

     

    I've put the 3 firmware files for ESP8089 where they belong, did what you said and tried to insmod the module, no luck. I can see it loaded ok but no error message, nothing on dmesg, silence. The driver most likely expects the right GPIO parameters to initialize the chip. 

     

    So, next was to hunt for the device tree from stock Android. Never did that before (I know there must be an easier way), but after a lot of cursing i've managed to extract DTB succesfully - directly from Multitool's backup of my box: 

     

    Spoiler

     

    First, on Windows 10: 

    • Uncompress backup with 7-Zip
    • Install binwalk from source (already had Python)
    • Run binwalk on backup, search for 1st "Flattened device tree" entry
    • Annotate offset & size
    • Extract the relevant block with HxD Editor to a .dtb file
    • Put file on a USB drive

    0TL2WdQ.png

     

    Then on Armbian (can't get device-tree-utils on W10):

    • dtc -I dtb -O dtc -f <mybox_dtb_file> -o <mybox_dts_file>

     

     

     

    Success! Here are the following files (can't attach to post, new user liimitation):

    1. Extracted DTB file
    2. Converted DTS, not sure if I did it right because:
    3. Log of dtc command complaining a LOT about DTB file
    4. efuse0 dump - please confirm, I have RK3229 right?

    IDK if all this could be automated directly on multitool, but if positive that'll be nifty...

     

    Now about the chip, I thiiiink I might be able to make it work with jwrdegoede's instructions, but I saw many errors about vregs and sdio lines and ugghh.. Truth is my workplace called and I was needed urgently there. On a saturday.  Worked all day, can't focus anymore, need sleep bad, zzzz...

     

    ps. a little gift as thanks, a speedier Firefox on the MXQ box! ;) https://github.com/The-foxPEP-Project/foxPEP (works everywhere, in fact I've used it from long ago on my vintage PowerPC Macs).

  7. Hello all, first obviously a BIG thanks to @jock @fabiobassa and everyone else here. Great work!

     

    On my device, installing legacy desktop to NAND was totally flawless.  Everything (except WiFi, you'll see why) works out-of-the-box including rebooting, and performance is acceptable if a bit laggy on X11... But I don't mind 'cause I'll switch to a minimal image later, this box will become a multi-service server. I just wanted to toy around with the desktop for a while.

     

    I've spent some time reading all of this thread :P and guess what: I have ANOTHER different board lol:

     

    Spoiler

    88W6f44.jpg

     

    LWCf7lj.jpg

     

    HUEs19G.jpg

     

     

     

     

     

    Yep, that's an ESP8089 chip for WiFi, not supported (yet?). Bummer because I needed that functionality... Can you add the driver for this chip on future images? Naturally I'm willing to help testing/debugging.  I'm no programmer but for now i'll try cloning the repo and see if compiling the driver gets this chip working. 

     

    One more thing: I've only tested legacy image, am I right to assume there is no ESP8089 support on mainline image also?

     

    Greetings and thank you.

×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines