Wifi not working after building customized image



  • @cas If you look at https://github.com/OnionIoT/source, you can read in the description:

    "Due to incompatibilities with recent kernel updates, building a firmware with the Ralink APSoC WiFi SoftAP driver will cause a kernel panic during boot".

    The official firmware runs on 4.4.46 and I bet that reason for that is WiFi kernel module. You can try to go back with LEDE to 4.4.46 or try to use open source driver (mt76?). I'd rather recommend going with closed source driver (open source driver seems to be buggy). To be precise, you can take a look on commits to kernel-version.mk (https://github.com/OnionIoT/source/commits/lede-17.01/include/kernel-version.mk). The 4.4.46 was introduced with b786a5ffc39539d55cf74ebd43edde9051b4682d (https://github.com/OnionIoT/source/commit/b786a5ffc39539d55cf74ebd43edde9051b4682d#diff-9e2e0c0e43d2d4ab7bf91e5fdd11cf2a). However, I didn't build this kernel yet so I am not sure if you will face other problems.



  • @Arek-Z
    There's more to it than that, unfortunately. This is from a build at that checkout:

    [   12.126013] random: jshn: uninitialized urandom read (4 bytes read, 31 bits of entropy available)
    [   18.620904] Kernel bug detected[#1]:
    [   18.624557] CPU: 0 PID: 1126 Comm: ifconfig Tainted: G        W       4.4.46 #0
    [   18.631971] task: 87d21420 ti: 872a0000 task.ti: 872a0000
    [   18.637442] $ 0   : 00000000 00000001 00000001 0000ff00
    [   18.642761] $ 4   : 8730216c 00000000 00000000 00000001
    [   18.648071] $ 8   : 00000001 873021ac 00000000 00000000
    [   18.653381] $12   : 00000001 00080008 00000000 00000041
    [   18.658690] $16   : 810e6040 0000016c 80420000 c047d7dc
    [   18.664002] $20   : 87270200 c0478000 87280540 00000001
    [   18.669314] $24   : 00000000 80020694
    [   18.674626] $28   : 872a0000 872a1af8 00000001 870680a0
    [   18.679938] Hi    : 00000000
    [   18.682854] Lo    : 00000000
    [   18.685802] epc   : 800206a0 r4k_dma_cache_wback_inv+0xc/0xc8
    [   18.692041] ra    : 870680a0 linux_pci_map_single+0x88/0xb4 [mt76x8]
    [   18.698482] Status: 1100e402 KERNEL EXL
    [   18.702472] Cause : 10800034 (ExcCode 0d)
    [   18.706535] PrId  : 00019655 (MIPS 24KEc)
    [   18.710595] Modules linked in: pppoe ppp_async option iptable_nat w1_therm w1_gpio uvcvideo usb_wwan snd_usb_audio pppox ppp_generic pl2303 nf_nat_ipv4 nf_conntrack_ipv6 nf_conntrack_ipv4 ipt_REJECT ipt_MASQUERADE ftdi_sio cp210x ch341 xt_time xt_tcpudp xt_state xt_nat xt_multiport xt_mark xt_mac xt_limit xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT xt_LOG wire videobuf2_v4l2 usbserial usblp usbhid ums_usbat ums_sddr55 ums_sddr09 ums_karma ums_jumpshot ums_isd200 ums_freecom ums_datafab ums_cypress ums_alauda uinput spidev snd_usbmidi_lib slhc rfcomm nf_reject_ipv4 nf_nat_redirect nf_nat_masquerade_ipv4 nf_nat nf_log_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 nf_conntrack_rtcache nf_conntrack iptable_mangle iptable_filter ip_tables hidp hid_generic hci_uart crc_ccitt cdc_acm btusb btintel bnep bluetooth snd_soc_simple_card snd_soc_ralink_i2s snd_soc_wm8960 videobuf2_vmalloc videobuf2_memops videobuf2_core hid v4l2_common videodev evdev snd_soc_core ralink_gdma virt_dma i2c_dev mt76x8 ralink_eeprom_api ledtrig_oneshot ledtrig_heartbeat ledtrig_gpio ip6t_REJECT nf_reject_ipv6 nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables x_tables msdos snd_pcm_dmaengine snd_compress snd_pcm_oss snd_mixer_oss snd_pcm snd_timer snd_rawmidi snd_seq_device snd_hwdep snd input_core soundcore vfat fat ntfs configfs autofs4 nls_utf8 nls_iso8859_1 nls_cp437 regmap_spi regmap_mmio regmap_i2c i2c_core regmap_core lzo_decompress lzo_compress dma_shared_buffer ecb cmac mmc_block usb_storage sdhci_pltfm sdhci mtk_sd mmc_core leds_gpio ohci_platform ohci_hcd ledtrig_transient ehci_platform ehci_hcd sd_mod scsi_mod gpio_button_hotplug ext4 jbd2 mbcache exfat usbcore nls_base usb_common crc16 cryptomgr aead crypto_null crc32c_generic crypto_hash
    [   18.866524] Process ifconfig (pid: 1126, threadinfo=872a0000, task=87d21420, tls=7750fd48)
    [   18.874896] Stack : 87f96000 872a1bcc 87076640 87f92000 870fb800 870680a0 00000000 870244dc
              87f96000 00000001 a70cd000 c0478000 c0551f54 8703a56c c047fd95 870fb800
              c0478000 87f96000 0000ff00 c047f128 87076710 00000001 8730216c 00000000
              00000001 00000001 00000000 8730216c 87f96000 87270200 00000000 c0478000
              87270200 c0551f50 c0558000 c0551f6c c0551f7c 87039884 00000000 87062934
              ...
    [   18.911028] Call Trace:
    [   18.913528] [<800206a0>] r4k_dma_cache_wback_inv+0xc/0xc8
    [   18.919379] [<870680a0>] linux_pci_map_single+0x88/0xb4 [mt76x8]
    [   18.926217] [<8703a56c>] AndesMTPciKickOutCmdMsg+0x104/0x238 [mt76x8]
    [   18.933496] [<87039884>] AndesSendCmdMsg+0x1b4/0xd98 [mt76x8]
    [   18.940072] [<87039cc4>] AndesSendCmdMsg+0x5f4/0xd98 [mt76x8]
    [   18.946265]
    [   18.947774]
    Code: 27bdffe8  2ca20001  afbf0014 <00020336> 3c02803b  24424060  8c430008  7c630440  10600013
    [   18.957966] ---[ end trace 8fb37b093b9c9a63 ]---
    [   18.966147] Fatal exception: panic in 5 seconds
    [   19.860568] Kernel bug detected[#2]:
    [   19.864403] CPU: 0 PID: 1127 Comm: RtmpCmdQTask Tainted: G      D W       4.4.46 #0
    [   19.872170] task: 87d22338 ti: 8727c000 task.ti: 8727c000
    [   19.877640] $ 0   : 00000000 80400000 00000001 0000ff00
    [   19.882957] $ 4   : 8730204c 00000000 00000000 00000001
    [   19.888267] $ 8   : 00000001 87302088 00000000 00000020
    [   19.893577] $12   : 00000040 00000008 00000000 00000001
    [   19.898885] $16   : 810e6040 0000004c 80420000 c047d7dc
    [   19.904196] $20   : 8724a100 c0478000 872806c0 00000001
    [   19.909507] $24   : 00000000 80020694
    [   19.914819] $28   : 8727c000 8727dce8 00000000 870680a0
    [   19.920130] Hi    : 00000000
    [   19.923046] Lo    : 00000000
    [   19.925994] epc   : 800206a0 r4k_dma_cache_wback_inv+0xc/0xc8
    [   19.932222] ra    : 870680a0 linux_pci_map_single+0x88/0xb4 [mt76x8]
    [   19.938663] Status: 1100e402 KERNEL EXL
    [   19.942653] Cause : 10800034 (ExcCode 0d)
    [   19.946716] PrId  : 00019655 (MIPS 24KEc)
    [   19.950775] Modules linked in: pppoe ppp_async option iptable_nat w1_therm w1_gpio uvcvideo usb_wwan snd_usb_audio pppox ppp_generic pl2303 nf_nat_ipv4 nf_conntrack_ipv6 nf_conntrack_ipv4 ipt_REJECT ipt_MASQUERADE ftdi_sio cp210x ch341 xt_time xt_tcpudp xt_state xt_nat xt_multiport xt_mark xt_mac xt_limit xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT xt_LOG wire videobuf2_v4l2 usbserial usblp usbhid ums_usbat ums_sddr55 ums_sddr09 ums_karma ums_jumpshot ums_isd200 ums_freecom ums_datafab ums_cypress ums_alauda uinput spidev snd_usbmidi_lib slhc rfcomm nf_reject_ipv4 nf_nat_redirect nf_nat_masquerade_ipv4 nf_nat nf_log_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 nf_conntrack_rtcache nf_conntrack iptable_mangle iptable_filter ip_tables hidp hid_generic hci_uart crc_ccitt cdc_acm btusb btintel bnep bluetooth snd_soc_simple_card snd_soc_ralink_i2s snd_soc_wm8960 videobuf2_vmalloc videobuf2_memops videobuf2_core hid v4l2_common videodev evdev snd_soc_core ralink_gdma virt_dma i2c_dev mt76x8 ralink_eeprom_api ledtrig_oneshot ledtrig_heartbeat ledtrig_gpio ip6t_REJECT nf_reject_ipv6 nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables x_tables msdos snd_pcm_dmaengine snd_compress snd_pcm_oss snd_mixer_oss snd_pcm snd_timer snd_rawmidi snd_seq_device snd_hwdep snd input_core soundcore vfat fat ntfs configfs autofs4 nls_utf8 nls_iso8859_1 nls_cp437 regmap_spi regmap_mmio regmap_i2c i2c_core regmap_core lzo_decompress lzo_compress dma_shared_buffer ecb cmac mmc_block usb_storage sdhci_pltfm sdhci mtk_sd mmc_core leds_gpio ohci_platform ohci_hcd ledtrig_transient ehci_platform ehci_hcd sd_mod scsi_mod gpio_button_hotplug ext4 jbd2 mbcache exfat usbcore nls_base usb_common crc16 cryptomgr aead crypto_null crc32c_generic crypto_hash
    [   20.106715] Process RtmpCmdQTask (pid: 1127, threadinfo=8727c000, task=87d22338, tls=00000000)
    [   20.115439] Stack : 02020200 80086720 ffffffe4 871c3b60 87e8c980 870680a0 00000000 00000000
              871c3b60 00000000 a70cd000 c0478000 c0551f54 8703a56c 00000000 87271d20
              00000000 803b8a00 0000ff00 803b84c0 00000000 00000001 8730204c 00000000
              00000001 00000001 00000000 8730204c 00040008 8724a100 00000000 c0478000
              8724a100 c0551f50 c0558000 c0551f6c c0551f7c 87039884 00000000 87062934
              ...
    [   20.151567] Call Trace:
    [   20.154067] [<800206a0>] r4k_dma_cache_wback_inv+0xc/0xc8
    [   20.159918] [<870680a0>] linux_pci_map_single+0x88/0xb4 [mt76x8]
    [   20.166754] [<8703a56c>] AndesMTPciKickOutCmdMsg+0x104/0x238 [mt76x8]
    [   20.174035] [<87039884>] AndesSendCmdMsg+0x1b4/0xd98 [mt76x8]
    [   20.180610] [<8703d588>] CmdSlotTimeSet+0xb4/0xd8 [mt76x8]
    [   20.186923] [<87041014>] MtAsicSetSlotTime+0x20/0x2c [mt76x8]
    [   20.193496] [<8702a6d0>] CMDHandler+0x1b4/0x224 [mt76x8]
    [   20.199627] [<87066bc4>] RTPCICmdThread+0xb4/0x198 [mt76x8]
    [   20.205654] [<8003bf48>] kthread+0xd8/0xec
    [   20.209814] [<80004478>] ret_from_kernel_thread+0x14/0x1c
    [   20.215283]
    [   20.216791]
    Code: 27bdffe8  2ca20001  afbf0014 <00020336> 3c02803b  24424060  8c430008  7c630440  10600013
    [   20.226988] ---[ end trace 8fb37b093b9c9a64 ]---
    [   20.234243] Fatal exception: panic in 5 seconds
    [   23.971901] Kernel panic - not syncing: Fatal exception
    [   23.979971] Rebooting in 3 seconds..
    

    I'm curious as to whether the OP @aobs has achieved any success with this?
    And same for @Pavel-Metrokhin & @onion



  • According to Onion, they will roll out a new WiFi driver in April.



  • @aobs said on 27 Mar 2018, 06:50

    According to Onion, they will roll out a new WiFi driver in April.

    Really?
    For Omega2(+)? But in which year / decade / century / ... ? 😉
    Please let us know, where did you read this?



  • Next month. From their staff by email directly. At least, this is what they told me.



  • They are indeed very close (15h ago):
    https://github.com/OnionIoT/OpenWRT-Packages/commit/1b4280a7b51bc835de22288edd142dfaf7084c2c

    @EDIT
    Actually, they are done with it:

    @Maximilian-Gerhardt said in Omega2 current defects:

    OnionIoT has released a new firmware version b176 in https://onion.io/2bt-march-27-2018/ in which it is stated that:

    • a new WiFi driver "WiFi Warp Core" has been released, which fixes problems with:
      • general WiFi performance
      • Automatic Network Switching
      • Automatic Network Encryption Detection in wifisetup
      • Support for Hidden SSIDs
    • SPI Improvements
      • maximum transfer sizes increased to 4096 bytes
      • MSB corruption fixed for "some" devices ("We’ve observed that some SPI devices still show data corruption but others do not")
      • new python-spidev package for writing user-space programs with SPI (apparently different from old pyOnionSpi)

    Will re-test and recompile older programs to see how much it improved. Main post updated.





  • hi,

    I just build my own firmware and wifi is working !

    ( I just have to manually select Coreutils to make the wifi drivers appears in onion/wifi )



  • Hi Stephane
    can you explain your steps to succeed your image.



  • @Stephane-Foloppe
    hello stephane , could you please write a brief explanation on how you build your image ?



  • @Stephane-Foloppe hi, I'm trying to build my own image (from https://github.com/OnionIoT/source) with wifi-warp-core.

    I simply copied the folder wifi-warp-core from https://github.com/OnionIoT/OpenWRT-Packages to source/package/onion.

    After doing this, Onion > WiFi > wifi-warp-core* appears in menuconfig, but when I enable it I get the following error:

     Collected errors:
     * satisfy_dependencies_for: Cannot satisfy the following dependencies for wifi-warp-core:
     * 	coreutils-base64 * 
     * opkg_install_cmd: Cannot install package wifi-warp-core.
    package/Makefile:60: recipe for target 'package/install' failed
    

    I tried enabling coreutils-base64 by enabling Base system > busybox > Coreutils (after enabling Customize busybox options) > base64 in menuconfig but nothing changed...

    Could anyone tell me what I'm doing wrong?



  • Re: Wifi not working after building customized image

    I have successfully built the customised image. The steps are pretty straight forward. I am using Docker on my MAC. Just follow the steps on Cross-Compiling C & C++ Programs: Part 1 - Setting Up the Build System to pull the latest source from the repository. If you do not have Docker, just follow the steps to install & set up Docker and create a container.

    Run the image. After the container is up, you should be at ~/source. If not, just ensure you are at ~/source.

    Run

     make menuconfig
    

    Select Onion -> WiFi, you should see "wifi-warp-core" there.

    It should be automatically selected already. If it is not, just click "Y" to include this in the kernel.

    If you need other libraries, drivers, modules, etc., just select those in the config menu.

    There is a problem with compiling mosquito if libwebsockets is selected under Libraries, I disable

     Network -> mosquito-ssl -> libwebsocket support
    

    Save & Exit the config menu.

    Usually, I will run

     scripts/feeds update -a
    

    If the packages I require are not there, I run

     scripts/feeds install package_name
    

    To compile the customised image, run

     make V=s
    

    If you encounter a problem with compiling MicroPython and you are not using it, just unselect it in the config menu.



  • @Caio-Mehlem Perhaps you are using the wrong tree. Try https://github.com/OnionIoT/source/tree/lede-17.01. "wifi-warp-core" should be in the config menu.



  • @aobs , I was in the lede-17.01 branch, but I stupidly did not run the feed scripts... (I'm new to OpenWRT/LEDE/Buildroot so I'm still figuring out how things work).

    I can now build the image correctly with wifi-warp-core, but only by cloning the repo @ https://github.com/OnionIoT/source (commit 564089f624f1eb47c20d1f4f8766f2383ce32ef9).

    The Docker image is out of date AND did not compile correctly for me.
    For some reason I had to manually change PKG_SOURCE_URL in libsoxr from git://git.code.sf.net/p/soxr/code to https//git.code.sf.net/p/soxr/code because git clone was failing! I'm running the compilation again but it didn't finish yet.

    The image built without docker boots fine and connects to WiFi using wifi-warp-core (by entering WiFi info manually with wifisetup and selecting Type network info), but I still have the following problems:

    • hostname is Omega-0000, not sure how to make it use the MAC address as in the official build
    • Running wifisetup and trying to "Scan for Wifi networks" fails:
    root@Omega-0000:/# wifisetup
    Onion Omega Wifi Setup
    
    Select from the following:
    1) Scan for Wifi networks
    2) Type network info
    q) Exit
    
    Selection: 1
    Scanning for wifi networks...
    Command failed: Not found
    Failed to parse message data
    WARNING: Variable 'results' does not exist or is not an array/object
    > ERROR: Scan failed, try again
    
    > ERROR: specified ssid not in the database
    root@Omega-0000:/# [ 1017.277206] br-wlan: port 1(ra0) entered disabled state
    [ 1017.959763] device ra0 left promiscuous mode
    [ 1017.964266] br-wlan: port 1(ra0) entered disabled state
    [ 1018.019989] IPv6: ADDRCONF(NETDEV_UP): br-wlan: link is not ready
    [ 1018.375215] 
    [ 1018.375215] _      _____   ___  ___    _________  ___  ____
    [ 1018.375215] | | /| / / _ | / _ \/ _ \  / ___/ __ \/ _ \/ __/ V1.0
    [ 1018.375215] | |/ |/ / __ |/ , _/ ___/ / /__/ /_/ / , _/ _/  
    [ 1018.375215] |__/|__/_/ |_/_/|_/_/     \___/\____/_/|_/___/  
    [ 1018.375215] 		   Onion Enhanced MT7688 WiFi Driver 
    [ 1018.375215] 
    [ 1018.527499] DMA Scheduler Mode=0(LMAC)
    [ 1018.531374] efuse_probe: efuse = 10000012
    [ 1018.535498] 1. Phy Mode = 14
    [ 1018.711670] 2. Phy Mode = 14
    [ 1018.714643] 3. Phy Mode = 14
    [ 1018.717882] 	WTBL Segment 1 info:
    [ 1018.721296] 		MemBaseAddr/FID:0x28000/0
    [ 1018.725186] 		EntrySize/Cnt:32/128
    [ 1018.728632] 	WTBL Segment 2 info:
    [ 1018.732010] 		MemBaseAddr/FID:0x40000/0
    [ 1018.735899] 		EntrySize/Cnt:64/128
    [ 1018.739344] 	WTBL Segment 3 info:
    [ 1018.742720] 		MemBaseAddr/FID:0x42000/64
    [ 1018.746695] 		EntrySize/Cnt:64/128
    [ 1018.750140] 	WTBL Segment 4 info:
    [ 1018.753515] 		MemBaseAddr/FID:0x44000/128
    [ 1018.757578] 		EntrySize/Cnt:32/128
    [ 1026.936528] device ra0 entered promiscuous mode
    [ 1026.941279] br-wlan: port 1(ra0) entered forwarding state
    [ 1026.946860] br-wlan: port 1(ra0) entered forwarding state
    [ 1026.952961] IPv6: ADDRCONF(NETDEV_CHANGE): br-wlan: link becomes ready
    [ 1028.941473] br-wlan: port 1(ra0) entered forwarding state
    [ 1030.277136] Interface apcli0 link up! (WPA2PSK AES)
    [ 1032.830996] da match,0x40a36bc073f5
    
    • opkg update fails:
    root@Omega-0000:/# opkg update
    Downloading http://repo.onion.io/omega2/packages/core/Packages.gz
    Updated list of available packages in /var/opkg-lists/omega2_core
    Downloading http://repo.onion.io/omega2/packages/core/Packages.sig
    Signature check failed.
    Remove wrong Signature file.
    Downloading http://repo.onion.io/omega2/packages/base/Packages.gz
    Updated list of available packages in /var/opkg-lists/omega2_base
    Downloading http://repo.onion.io/omega2/packages/base/Packages.sig
    Signature check failed.
    Remove wrong Signature file.
    Downloading http://repo.onion.io/omega2/packages/packages/Packages.gz
    Updated list of available packages in /var/opkg-lists/omega2_packages
    Downloading http://repo.onion.io/omega2/packages/packages/Packages.sig
    Signature check failed.
    Remove wrong Signature file.
    Downloading http://repo.onion.io/omega2/packages/routing/Packages.gz
    Updated list of available packages in /var/opkg-lists/omega2_routing
    Downloading http://repo.onion.io/omega2/packages/routing/Packages.sig
    Signature check failed.
    Remove wrong Signature file.
    Downloading http://repo.onion.io/omega2/packages/onion/Packages.gz
    Updated list of available packages in /var/opkg-lists/omega2_onion
    Downloading http://repo.onion.io/omega2/packages/onion/Packages.sig
    Signature check failed.
    Remove wrong Signature file.
    

    Anyone has ideas why I'm getting these problems?

    Thank you!!



  • @Caio-Mehlem Try to use the packages in your image directories. My packages are under ~/source/bin/packages/mipsel_24kc & ~/source/bin/targets/ramips/mt7688/packages. Copy the packages you need to your Omega2 and install them with opkg.

    Please check New omega2 boots with Omega-0000 AP and wont let me connect and see whether this can fix your problem.



  • @aobs I'm quite new to Linux development and buildsystems, so sorry for the stupid questions... I realized there is a script to set the hostname which was not selected.

    For the rest, I built a new image with a custom configuration loosely based on the one found at the Docker image (since copying the docker .config and running make oldconfig didn't work) and now everything seems to be working.

    I still don't understand why Onion doesn't keep their official configuration at the repo's .config, it would make customization a lot easier since we could start from the official build and add/remove what we needed.


  • administrators

    We do keep our official configuration in the .config file on Github.
    However, when you run:

    ./scripts/feeds update -a
    ./scripts/feeds install -a
    

    This will actually overwrite the .config and clear our settings.

    My advice would be to run git checkout .config after running the feeds script, and you'll get all of our settings.



  • @Lazar-Demin Sorry, my mistake! Thank you for clarifying this! Can you confirm that building this will result in the exact same image provided @ http://repo.onion.io/omega2/images/ ?

    Thanks!


  • administrators

    @Caio-Mehlem Yep, exactly



  • Hi @Lazar-Demin ,
    I'm happy to see that Onion has released Warp Core. We have a product shipping with Omega2 as Ethernet only because of the issues we ran into with WiFi. I'm playing around with building a custom image from the OnionIoT Repo.

    Can you tell me, if you were to build a fresh image that would be posted to http://repo.onion.io/omega2/images/, after cloning the repo and running "./scripts/feeds update -a" , what "./scripts/feeds install xxx" commands would you execute? install -a?

    The reason I ask is, with all packages installed, the make fails and I have to go disable something, then try again. Latest issue is with libs->telephony->libre missing a zlib dep. Remove libre and opensip fails. I know this isn't Onion's problem so I'm curious which packages you actually install for the prod releases of the Omega2 firmware.

    Thank you,
    Nick



Looks like your connection to Community was lost, please wait while we try to reconnect.