Beaglebone software issues [was: Using beaglebones as boards for the ietf "homenet" and "babel" working groups]

This gmail client bites and doesn’t allow for inline replies. You don’t have to subscribe to post. This is now cross-posted…

There is a race condition between booting and loading the Bluetooth
firmware. Reloading the firmware manually works around the issue.

This has been haunting us for a while.

Okay, I found it. You just need to add

  Type=forking

to the [Service] section of /lib/systemd/system/bb-wl18xx-bluetooth.service .

What's going on is that the script is starting the hciconfig daemon.
However, systemd knows better than you, so it kills the daemon as soon as
your script exits.

With "Type=forking", you politely ask systemd to stop being a dick.

-- Juliusz

Try pop3 on thunderbird with gmail works perfect.

After some reading of the kernel sources (always a pleasure), I've found
how to enable 2x2 MIMO on the BBGW. I'm getting 77Mbit/s downstream (TCP
iperf), which is pretty cool, but only 22Mbit/s upstream.

In order to enable 2x2 MIMO on the board, you need to add a file
/etc/modprobe.d/wl18xx.conf containing the following line:

    options wl18xx ht_mode=default

This might actually be an upstream bug -- the default ht_mode should
probably be "default" (duh), and the documentation for the "n_antennas_2"
module parameter is incorrect (it is documented as defaulting to 1, but
actually defaults to 2).

I'll let you know if something breaks.

-- Juliusz

With "Type=forking", you politely ask systemd to stop being a dick.

-- Juliusz

heh !

After some reading of the kernel sources (always a pleasure), I've found
how to enable 2x2 MIMO on the BBGW. I'm getting 77Mbit/s downstream (TCP
iperf), which is pretty cool, but only 22Mbit/s upstream.

Is this AP/sta or adhoc mode?

It may be you are running low on memory bandwidth or cpu. I'd done a
test over usbnet to the board and got about the same result.

Does the wifi use the softmac layer? The changes toke made there on
ath9k (see https://blog.tohojo.dk/2016/06/fixing-the-wifi-performance-anomaly-on-ath9k.html
) resulted in quite a nice gain in performance.

Also the supplied antennas are not the best, you can get better
antennas pretty cheaply via amazon.

In order to enable 2x2 MIMO on the board, you need to add a file
/etc/modprobe.d/wl18xx.conf containing the following line:

    options wl18xx ht_mode=default

This might actually be an upstream bug -- the default ht_mode should
probably be "default" (duh), and the documentation for the "n_antennas_2"
module parameter is incorrect (it is documented as defaulting to 1, but
actually defaults to 2).

I'll let you know if something breaks.

Next time I boot mine I will add in all the changes you've figured out
out! Thanks!

After some reading of the kernel sources (always a pleasure), I've found
how to enable 2x2 MIMO on the BBGW. I'm getting 77Mbit/s downstream (TCP
iperf), which is pretty cool, but only 22Mbit/s upstream.

Is this AP/sta or adhoc mode?

Client mode to a WNDR 3700 situated in the next room. I didn't run any
more extensive tests, I was only trying to ensure that MIMO was
functional. (If you asked me, I'd guess that the AP is doing aggregation
and the STA isn't, but since you aren't asking, I'm not going to guess.)

It may be you are running low on memory bandwidth or cpu.

Perhaps.

I'd done a test over usbnet to the board and got about the same result.

For me, usbnet goes the other way around (upstream traffic has higher
throughput than downstream). It would probably take a USB protocol
analyser to understand why.

Does the wifi use the softmac layer?

It looks to me like a completely separate module implemented in its own
microcontroller (I think it's connected through SDIO, plus a UART, plus
a GPIO, plus an interrupt line). Jason, do you know where I can find the
programming manual?

-- Juliusz

There is a race condition between booting and loading the Bluetooth
firmware. Reloading the firmware manually works around the issue.

This has been haunting us for a while.

Okay, I found it. You just need to add

Type=forking

to the [Service] section of /lib/systemd/system/bb-wl18xx-bluetooth.service .

What’s going on is that the script is starting the hciconfig daemon.
However, systemd knows better than you, so it kills the daemon as soon as
your script exits.

With “Type=forking”, you politely ask systemd to stop being a dick.

Brilliant!

https://github.com/rcn-ee/repos/pull/17

https://github.com/rcn-ee/repos/pull/17

Thanks for the speedy commit.

Have you considered my suggestion to enable MIMO in the Wifi by default?
Since the BBGW has two antenna connectors, it might make sense, although
it might cause problems for people who decide not to connect any
antennas -- I'm not sure how well the chip handles having just one antenna
in MIMO mode (detecting misconfiguration is doable, just not usually
implemented except on Atheros chips).

On a related note -- I've evaluated the BBGW carefully, and while I like
the hardware very much, it's unsuitable for my purposes since it's unable
to do ad-hoc (I need a chip able to do ad-hoc and AP at the same time).
Do you know if there are any plans to implement ad-hoc on the wl18xx?

Finally, does anyone know how to test whether a USB port has enough power
for the Beaglebone? I'm hooking mine off a port I don't have reliable
information on, I'm wondering how to load it so I can know for sure.

Thanks,

-- Juliusz

bb-wl18xx-bluetooth.service: fix execute on boot issue by jadonk · Pull Request #17 · rcn-ee/repos · GitHub

Thanks for the speedy commit.

Have you considered my suggestion to enable MIMO in the Wifi by default?

I haven't noticed that suggestion yet. Do you say how to do so?

Since the BBGW has two antenna connectors, it might make sense, although
it might cause problems for people who decide not to connect any
antennas -- I'm not sure how well the chip handles having just one antenna
in MIMO mode (detecting misconfiguration is doable, just not usually
implemented except on Atheros chips).

On a related note -- I've evaluated the BBGW carefully, and while I like
the hardware very much, it's unsuitable for my purposes since it's unable
to do ad-hoc (I need a chip able to do ad-hoc and AP at the same time).
Do you know if there are any plans to implement ad-hoc on the wl18xx?

I'm looking at talking to a third party for some firmware updates. I will inquire if this can be done.

Finally, does anyone know how to test whether a USB port has enough power
for the Beaglebone? I'm hooking mine off a port I don't have reliable
information on, I'm wondering how to load it so I can know for sure.

By the spec, it likely does not. In practice, you are likely fine. I think the WL1835MOD can pull 800mA during quick calibration cycles.

n <87oa5jp25b.wl-jch@pps.univ-paris-diderot.fr>
  <CA+T6QPmjpn23v4yztShetZ=nKv_W4X9gW-2wFRVqWWRm3WiH=Q@mail.gmail.com>
  <87lh0nozu9.wl-jch@pps.univ-paris-diderot.fr>
  <CA+T6QPkxuAWycFHMq7A-PUHbDiRhw7MXy7NswHmPBVWVhFvKAw@mail.gmail.com>
  <87y44k5esv.wl-jch@pps.univ-paris-diderot.fr>
n <210A8A84-01E5-4934-B0A5-D85FB975CBF9@gmail.com>
User-Agent: Wanderlust/2.15.9

Have you considered my suggestion to enable MIMO in the Wifi by default?

I haven't noticed that suggestion yet. Do you say how to do so?

    After some reading of the kernel sources (always a pleasure), I've found
    how to enable 2x2 MIMO on the BBGW. I'm getting 77Mbit/s downstream (TCP
    iperf), which is pretty cool, but only 22Mbit/s upstream.

    In order to enable 2x2 MIMO on the board, you need to add a file
    /etc/modprobe.d/wl18xx.conf containing the following line:

        options wl18xx ht_mode=default

    This might actually be an upstream bug -- the default ht_mode should
    probably be "default" (duh), and the documentation for the "n_antennas_2"
    module parameter is incorrect (it is documented as defaulting to 1, but
    actually defaults to 2).

-- Juliusz

Hi Juliusz,
As far as the wl1835 driver is concerned it has MIMO enabled.
It is defined in the file /lib/firmware/ti-connectivity/wl18xx-conf.bin in the entry wl18xx.phy.number_of_assembled_ant2_4 = 0x02.
You can inspect the contents of this file with

#wlconf -i /lib/firmware/ti-connectivity/wl18xx-conf.bin -g | grep phy

There is no ad-hoc mode driver for WL18xx. There is an 802.11s mesh driver using open80211s. However, this is only available in TI’s driver at the moment in latest release R8.7 (http://software-dl.ti.com/ecs/WiLink8/latest/index_FDS.html). It is relatively trivial exercise to build this driver.

Iain

I missed your USB question.
If you don’t have enough power from USB for the Wi-Fi calibration you will get a driver timeout just after initialisation.
I use a 2.1A powered Hub for my BBGW having seen failures on other “supplies”.
Iain

As far as the wl1835 driver is concerned it has MIMO enabled.
It is defined in the file /lib/firmware/ti-connectivity/wl18xx-conf.bin in the
entry wl18xx.phy.number_of_assembled_ant2_4 = 0x02.

Right. It looks like I was confused, then. I'll do some more testing.

Thanks for your help,

-- Juliusz

As far as the wl1835 driver is concerned it has MIMO enabled.

After some further checking, I don't think it does.

    $ wlconf -i /lib/firmware/ti-connectivity/wl18xx-conf.bin -g | grep ht.mode
    wl18xx.ht.mode = 0x01

From wl18xx/conf.h:

    enum wl18xx_ht_mode {
            /* Default - use MIMO, fallback to SISO20 */
            HT_MODE_DEFAULT = 0,

            /* Wide - use SISO40 */
            HT_MODE_WIDE = 1,

            /* Use SISO20 */
            HT_MODE_SISO20 = 2,
    };

This can be worked around with the ht_mode module parameter, as
I previously reported.

-- Juliusz