# Wifi Connect on Raspberry Pi 3 Compute module with Redpine RS9113 Wifi Module

**URL:** <https://forums.balena.io/t/wifi-connect-on-raspberry-pi-3-compute-module-with-redpine-rs9113-wifi-module/95614>\
**Category:** openBalena\
**Tags:** raspberrypi3\
**Created:** [April 20, 2020, 3:28am UTC](https://forums.balena.io/t/wifi-connect-on-raspberry-pi-3-compute-module-with-redpine-rs9113-wifi-module/95614 "2020-04-20T03:28:22Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![nckswt](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/nckswt/32/368_2.png) [@nckswt](https://forums.balena.io/u/nckswt)\
**Post date:** [April 20, 2020, 3:28am UTC](https://forums.balena.io/t/wifi-connect-on-raspberry-pi-3-compute-module-with-redpine-rs9113-wifi-module/95614/1 "2020-04-20T03:28:22Z")

</div>

I’m trying to use Wifi Connect for the first time. I’ve got a Raspberry Pi 3 Compute Module with a [Redpine RS9113 Wifi Module](https://www.redpinesignals.com/Products/Hosted_Connectivity/Wi-Fi_SoCs_&_Modules/RS9113_Modules.php). I don’t know of it’s [one of the supported boards](https://github.com/balena-io/wifi-connect#supported-boards--dongles) and trying to get things working.

1. I’ve got Wifi-connect installed and running [on a balenaOS multicontainer app](https://github.com/balena-io/wifi-connect#balenaos-multicontainer-app)

2. Checking system settings (from Balena Host OS)

```auto
# systemctl status NetworkManager
Warning: The unit file, source configuration file or drop-ins of NetworkManager.service changed on disk. Run 'systemctl daemon-reload' to reload units.
● NetworkManager.service - Network Manager
   Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/NetworkManager.service.d
           └─NetworkManager.conf
   Active: active (running) since Tue 2020-02-25 21:39:54 UTC; 1 months 23 days ago
     Docs: man:NetworkManager(8)
 Main PID: 745 (NetworkManager)
    Tasks: 3 (limit: 2215)
   Memory: 9.7M
   CGroup: /system.slice/NetworkManager.service
           └─745 /usr/sbin/NetworkManager --no-daemon

Feb 25 21:40:11 a705845 NetworkManager[745]: <info> [1582666811.0487] device (wifi0): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed')
Feb 25 21:40:11 a705845 NetworkManager[745]: <info> [1582666811.0503] device (wifi0): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed')
Feb 25 21:40:11 a705845 NetworkManager[745]: <info> [1582666811.0535] manager: NetworkManager state is now CONNECTED_LOCAL
Feb 25 21:40:11 a705845 NetworkManager[745]: <info> [1582666811.0649] manager: NetworkManager state is now CONNECTED_SITE
Feb 25 21:40:11 a705845 NetworkManager[745]: <info> [1582666811.0704] policy: set 'resin-wifi-01' (wifi0) as default for IPv4 routing and DNS
Feb 25 21:40:11 a705845 NetworkManager[745]: <info> [1582666811.0779] dns-mgr: Writing DNS information to /sbin/resolvconf
Feb 25 21:40:11 a705845 NetworkManager[745]: <info> [1582666811.1777] device (wifi0): Activation: successful, device activated.
Feb 25 21:40:13 a705845 NetworkManager[745]: <info> [1582666813.8764] manager: NetworkManager state is now CONNECTED_GLOBAL
Feb 25 21:40:17 a705845 NetworkManager[745]: <info> [1582666817.3783] manager: (resin-vpn): new Tun device (/org/freedesktop/NetworkManager/Devices/8)
Apr 19 22:44:58 a705845 NetworkManager[745]: <info> [1587336298.4805] bluez: use BlueZ version 5

```

```auto
# nmcli d 
DEVICE TYPE STATE CONNECTION    
wifi0 wifi connected resin-wifi-01 
supervisor0 bridge connected supervisor0   
rpine0 ethernet unavailable --            
balena0 bridge unmanaged --            
br-d0b1d9af1186 bridge unmanaged --            
resin-dns bridge unmanaged --            
lo loopback unmanaged --            
resin-vpn tun unmanaged --  

```

1. Tried with `./wifi-connect -i wifi0 -s "NickConnect" -p "testpass"` (as part of `start.sh`), while `NickHotspot` not up and RPi not connected. Didn’t see the network pop up.

2. Tried with `./wifi-connect -i wifi0 -s "NickConnect" -p "testpass"` (from console), while connected to `NickHotspot`, got:

```auto
Targeted WiFi device: wifi0
Access points: ["NickHotspot", "DIRECT-4i-BRAVIA", "Tintin", "Arenas", "WIFIDDF16F", "tl6531a0-EXT", "", "Tintin-5G"]
Starting access point...
SSH session disconnected
SSH reconnecting...
Spawning shell...

```

1. Checked dmesg

```auto
# Dmesg output
[1607.898247] IPv6: ADDRCONF(NETDEV_UP): wifi0: link is not ready
[1607.955485] down interface wifi0
[1607.985486] IPv6: ADDRCONF(NETDEV_UP): wifi0: link is not ready
[1609.593209] In ieee80211_ioctl_set80211 3833 : returnin EOPNOTSUPP
[1609.598055] Failed to set Operation mode obm_cfg_start_ap Line 1033
[1609.599340] In ieee80211_ioctl_set80211 3833 : returnin EOPNOTSUPP
[1634.049666] IPv6: ADDRCONF(NETDEV_UP): wifi0: link is not ready
[1634.062911] down interface wifi0
[1634.100800] IPv6: ADDRCONF(NETDEV_UP): wifi0: link is not ready
[1635.606108] onebox_ioctl: 1003 Error: WLAN firmware is not active
[1635.748122] VAP = NULL
[1635.859532] onebox_cfg80211_connect:[42:c7:f1:be:15:ec] 
[1636.076763] onebox_disconnect 
[1636.076958] wlan_remove: Below are WLAN STATS: 
[1636.076972] total beacon send : 0
[1636.076982] total beacon Interrupts Received : 0
[1636.076992] total_mgmt_pkt_send : 208
[1636.077002] total_mgmt_rx : 3794
[1636.077013] total_onair_mgmt : 0
[1636.077023] total_data_rx : 1144
[1636.077032] BUFFER FULL COUNTER : 0
[1636.077042] BUFFER SEMI FULL COUNTER : 0
[1636.077051] MGMT BUFFER FULL COUNTER : 0
[1636.078565] down interface wifi0
[1636.345195] onebox_disconnect:Below are the sdio stats 
[1636.345236] total sdio Interrupts recvd : 4786
[1636.345248] total sdio Interrupts with zero status recvd : 4786
[1636.345258] total sdio buffer Interrupts recvd : 2
[1636.345269] total data pending Interrupts recvd : 4910
[1636.345279] total sdio Unkown Interrupts recvd : 0
[1636.345318] onebox_sdio_master_access_msword: fail to access MASTER_ACCESS_MSBYTE
[1636.345328] reset_chip: Unable to set ms word to common reg
[1636.495108] onebox_reset_card: CMD0 failed : -123 
[1636.495525] mmc1: card fffd removed
[1636.551847] mmc1: new high speed SDIO card at address fffd
[1636.565470] will be ignored
[1636.678101] MAC Address : 88 da 1a 82 e8 5c
[1636.678154] MFG SW Version : 4.3
[1636.678154] Bootloader Ver : 18
[1636.678154] Onboard Antenna : 1
[1636.678154] Module Type : 0 Non-HPM
[1636.678154] Band Support : Dual Band
[1636.678154] Country domain : 0
[1638.034554] core_net80211_attach: macaddr 88:da:1a:82:e8:5c
[1638.035574] [onebox_update_country][1722] : Updating Country to 00 from WR!!!
[1638.129461] created vap: wifi0
[1638.228294] IPv6: ADDRCONF(NETDEV_UP): wifi0: link is not ready
[1638.232510] Disabling power save
[1638.243690] down interface wifi0
[1638.460339] IPv6: ADDRCONF(NETDEV_UP): wifi0: link is not ready
[1640.034584] onebox_cfg80211_connect:[42:c7:f1:be:15:ec] 
[1640.091092] IPv6: ADDRCONF(NETDEV_CHANGE): wifi0: link becomes ready

```

Any other debugging info I could provide? Trying to figure out next steps.

---

<div class="post-metadata">

**Author:** ![majorz](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/majorz/32/639_2.png) [@majorz](https://forums.balena.io/u/majorz)\
**Post date:** [April 20, 2020, 11:32am UTC](https://forums.balena.io/t/wifi-connect-on-raspberry-pi-3-compute-module-with-redpine-rs9113-wifi-module/95614/3 "2020-04-20T11:32:41Z")

</div>

Hi, I see that when you run WiFi Connect from the terminal you are connected to the device over the same WiFi chip and that causes a terminal disconnect. Can you please retry by connecting to the device through Ethernet instead?  
Thanks,  
Zahari

---

<div class="post-metadata">

**Author:** ![nckswt](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/nckswt/32/368_2.png) [@nckswt](https://forums.balena.io/u/nckswt)\
**Post date:** [April 20, 2020, 2:27pm UTC](https://forums.balena.io/t/wifi-connect-on-raspberry-pi-3-compute-module-with-redpine-rs9113-wifi-module/95614/5 "2020-04-20T14:27:08Z")

</div>

Sadly I can’t – I only have a wifi chip connected to the [compute module](https://www.raspberrypi.org/products/compute-module-3/), and there’s no ethernet access.

I don’t expect running WiFi connect from the terminal to work, but it’s helped debug a bit. I know that [the RS9113 chip supports AP mode](https://www.redpinesignals.com/Products/Hosted_Connectivity/Wi-Fi_SoCs_&_Modules/RS9113_Modules.php), and I’m trying to find other ways to debug. `IPv6: ADDRCONF(NETDEV_UP): wifi0: link is not ready` (even after delaying 120 seconds in the start script) is the thing I’m stuck on.

---

<div class="post-metadata">

**Author:** ![majorz](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/majorz/32/639_2.png) [@majorz](https://forums.balena.io/u/majorz)\
**Post date:** [April 20, 2020, 2:37pm UTC](https://forums.balena.io/t/wifi-connect-on-raspberry-pi-3-compute-module-with-redpine-rs9113-wifi-module/95614/8 "2020-04-20T14:37:31Z")

</div>

The IPv6 log entry is just a warning coming from the kernel that occurs for all interfaces and cannot be related.

Do you have a way to plug-in a second WiFi dongle on a USB bus or USB-to-Ethernet adapter? Also are you connected to the CM3 from your development computer in some other way - either with a keyboard/monitor, or through a serial cable?

---

<div class="post-metadata">

**Author:** ![nckswt](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/nckswt/32/368_2.png) [@nckswt](https://forums.balena.io/u/nckswt)\
**Post date:** [April 20, 2020, 2:44pm UTC](https://forums.balena.io/t/wifi-connect-on-raspberry-pi-3-compute-module-with-redpine-rs9113-wifi-module/95614/10 "2020-04-20T14:44:17Z")

</div>

I do not. The only connection I have is through that Redpine chip, so I’ve been adding logging to `start.sh`.

Here’s the output on start from `iwconfig` and `ifconfig` while connected as a client to my hotspot and when trying to become the Access Point (hotspot turned off):

```auto
# As Client
## iwconfig
wifi0 IEEE 802.11bgn ESSID:"NickHotspot"  
          Mode:Managed Frequency:2.412 GHz Access Point: 42:C7:F1:BE:15:EC   
          Bit Rate:65 Mb/s Tx-Power=10 dBm Sensitivity=1/0  
          RTS thr:off Fragment thr:off
          Encryption key: ****-**** Security mode:restricted
          Power Management:off
          Link Quality=80/80 Signal level=-49 dBm Noise level:0 dBm
          Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
          Tx excessive retries:0 Invalid misc:0 Missed beacon:0

## ifconfig
wifi0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
        inet 192.168.43.66 netmask 255.255.255.0 broadcast 192.168.43.255
        inet6 fe80::376b:2491:177f:12a2 prefixlen 64 scopeid 0x20<link>
        ether 88:da:1a:82:e8:5c txqueuelen 1000 (Ethernet)
        RX packets 2664 bytes 358978 (350.5 KiB)
        RX errors 0 dropped 0 overruns 0 frame 0
        TX packets 3083 bytes 730005 (712.8 KiB)
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

# As AP (hotspot off)
## iwconfig
wifi0 IEEE 802.11abgn ESSID:""  
          Mode:Managed Frequency:5.7 GHz Access Point: Not-Associated   
          Tx-Power=30 dBm Sensitivity=1/0  
          RTS thr:off Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=80/80 Signal level=0 dBm Noise level:0 dBm
          Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
          Tx excessive retries:0 Invalid misc:0 Missed beacon:0

## ifconfig
wifi0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
        ether 88:da:1a:82:e8:5c txqueuelen 1000 (Ethernet)
        RX packets 0 bytes 0 (0.0 B)
        RX errors 0 dropped 0 overruns 0 frame 0
        TX packets 0 bytes 0 (0.0 B)
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

```

I’m suspecting I should see `iwconfig wifi0` in `Mode:Host` (EDIT: [probably should be `Mode:Master`](https://linux.die.net/man/8/iwconfig)) instead of `Mode:Managed`. Here’s the relavent part of my `docker-compose.yaml`:

```auto
version: '2'
volumes:
  resin-data: {}

services:
  wifi-connect:
    build: ./wifi-connect
    network_mode: "host"
    labels:
        io.balena.features.dbus: '1'
    cap_add:
        - NET_ADMIN
    environment:
        DBUS_SYSTEM_BUS_ADDRESS: "unix:path=/host/run/dbus/system_bus_socket"

```

---

<div class="post-metadata">

**Author:** ![majorz](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/majorz/32/639_2.png) [@majorz](https://forums.balena.io/u/majorz)\
**Post date:** [April 20, 2020, 3:09pm UTC](https://forums.balena.io/t/wifi-connect-on-raspberry-pi-3-compute-module-with-redpine-rs9113-wifi-module/95614/13 "2020-04-20T15:09:28Z")

</div>

I am confused - how did you run `iwconfig` and `ifconfig` when you were not connected to device through “NickHotspot” (the second batch of output above)? Just trying to understand more about your setup so that I get a better idea on how this could be diagnosed further.

---

<div class="post-metadata">

**Author:** ![nckswt](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/nckswt/32/368_2.png) [@nckswt](https://forums.balena.io/u/nckswt)\
**Post date:** [April 20, 2020, 3:11pm UTC](https://forums.balena.io/t/wifi-connect-on-raspberry-pi-3-compute-module-with-redpine-rs9113-wifi-module/95614/14 "2020-04-20T15:11:18Z")

</div>

As part of my `start.sh` script, I do `ifconfig wifi0 > ifconfig.txt`, for instance. Then I turn on the hotspot and check the file.

---

<div class="post-metadata">

**Author:** ![majorz](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/majorz/32/639_2.png) [@majorz](https://forums.balena.io/u/majorz)\
**Post date:** [April 20, 2020, 3:22pm UTC](https://forums.balena.io/t/wifi-connect-on-raspberry-pi-3-compute-module-with-redpine-rs9113-wifi-module/95614/15 "2020-04-20T15:22:35Z")

</div>

That makes sense then 🙂 Can you please enable persistent via the device dashboard configuration variables? This will persist the device journal logs in case you need to reboot your device. Then after you run WiFi Connect and the access point is not started can you please grab all journalctl from the host OS and attach them here? You can grab those by opening a host OS terminal and run `journalctl > /mnt/data/logs.txt` and then using a file upload service like [file.io](http://file.io) - e.g. `curl -F "file=@/mnt/data/logs.txt" https://file.io`.

Also what drivers is the Redpine module using? Are those already part of the kernel or you are modprobing them from the container?
