Last week, I was very honored to get sponsored to participate the Hanoi SFD 2014. I joined the Fedora meetup on Friday and gave a talk on Saturday. Below is the full report.

## Day 0 (2014-09-18): Arrival Day

I left Beijing early in the morning and in the afternoon stayed in Hong Kong Airport to transfer. The flight to Hanoi was a bit late, and I arrived at the Hanoi Airport at around 8:00 PM (local time, 9:00 PM in Beijing time). The weather was wet and hot, but the people are nice. It took me some time to find a large shuttle bus, rather than the minibus. On the bus I met a Japanese guy, and it turned out he lived in a hotel not far from mine. So after getting off the bus, we walked to our hotels together most of the way.

It was about 10:00 PM when I arrived at the hotel. I shared a room with Sarup (banas), and he told me they (Thang, Somvannda, Tuan and others) would like to have me together go out for beer. I was a bit tired after the long trip, but after ten minutes’ rest, I joined them. Thang carried me on his motorbike to a street corner nearby, and I met Tuan (for the first time) and Somvannda (for the second time). I was surprised to find many people are there on the street at first. But I soon realized having cool beer outside is the best way to pass the hot night. By cool I mean not only temperature (ice beer), but also the taste (nice beer).

## Day 1 (2014-09-19): Fedora Meetup

On Friday morning we went to the VAIP office and had a Fedora APAC ambassador meetup the whole day. The meetup was set up for APAC ambassadors to discuss critical tasks. EMEA has had a lot of similar meetups, but for APAC, it was the first to my knowledge. (It was at least the first in this year.) To include remote participants who cannot make it at Hanoi, we also joined the #fedora-apac IRC channel. There we met gnokii, kushal, FranciscoD, etc. We also set up a pad on PiratePad.

In the morning, we discussed many issues including the budget status, current issues and so on. It seems the major issue is that not many APAC ambassadors are active, and people do not regularly attend meetings. In China, the state is somewhat better: we do have a few active contributors and we managed to have regular IRC meetings and offline activities (release parties every release, yearly FAD, and FUDCon Beijing). In India there is another problem: there might be too many ambassadors and some people tend to use Fedora as a travel agency. We agreed that people need actively participate biweekly meetings and mailing list discussions to get their tickets approved easily, and to be considered as active, one ambassador needs to organize (or help organize) at least one event per year.

We also talked about the FAD Phnom Penh under planning and the ambassador Polo shirts. The FAD planning is generally in good shape. I saw no Taiwan ambassador registered the event but I think they should consider. Regarding the Polo shirts, unfortunately the Fedora logo on the sample shirt is incorrect and needs to be fixed. And the quality of the shirt is not quite high. I am supposed to ask local vendors in China to see if we can get better ones within a reasonable price. We went on to discuss general swag production issues. gnokii suggested that good quality can be produced in Europe for both EMEA and APAC regions. Besides, China can be one good candidate among the locations to store the swag.

I also learned from Tuan about why we APAC folks lose some money when getting reimbursed by paypal while Americans not. The reason is that US paypal accounts have the option to cover the transaction fee by the sender, while other accounts do not. So the fee is charged at the receiver side, causing the loss. To walk around the issue, we might let APAC CC holder izhar set up a US paypal account.

In the afternoon, after a short pizza lunch, we carried on remaining tasks. We spent quite some time in summarizing the budget usage in previous quarters. It was sad to find that none of the planned events in Q2 happened at last. To solve the budget problem, we adjusted the budget allocation for the remaining quarters, and came up with ideas of possible events. After that, we talked about Fedora sessions for the SFD next day. At last, Somvannda asked us to share stories of being an Fedora ambassador. For me, it was the simple idea of organizing regular events to gather existing contributors and attract newcomers, and the idea of starting something by oneself when no one else has started it.

In the evening, we went to see the water puppet show, which is fun and amazing. At dinner we had delicious dishes and noodles, and Saigon beer! But we did not stay up too late at night, since we felt quite tired after one day’s meeting, and we need to prepare for SFD in the next day.

## Day 2 (2014-09-20): Hanoi SFD 2014

Saturday was the Software Freedom Day (SFD), a global event to celebrate Free and Open Source Software (FOSS). I organized SFD in Tsinghua University last year, and it is lucky for me to be part of SFD Hanoi this year. Hanoi SFD is organized by VFOSSA, the FOSS association in Vietnam. Fedora was one main sponsor of the event. It was a whole day event held in a university. So many volunteers are students and employees of the university. It was fun that the event begins with volunteers dancing, both in the morning and in the afternoon, and they are so good at it!

In the morning are welcome and keynote sessions in one large lecture hall. Sarup, Somvannda, and I are honored to be introduced as special international guests to the event (in English). They awarded new members and event sponsors in the welcome session. Later in the keynote session, Tuan delivered a speech on seven ways to contribute to Fedora (without coding). Most of the morning sessions were in Vietnamese, and I could only understand a little bit. I brought some Fedora 20 DVDs, stickers, and flyers from China, and they were distributed very soon at the booth.

In the afternoon, we had a dedicated room for Fedora related sessions. First, Thang gave a general introduction of the Fedora Project to the audience in Vietnamese. Then I talked about free and open source software defined radio (FOSS SDR). With a lot of examples, I introduced why we should have FOSS SDR, and how FOSS SDR can enable hacking in the radio frequency. I introduced GNU Radio and various SDR hardware such as HackRF and bladeRF to show how FOSS and open hardware play well with each other. Since the talk was in English, and the topic is not so familiar, the main purpose of the talk was to show the power of FOSS and open hardware, and to encourage the audience to try out and contribute to FOSS projects.

Later on, Sarup delivered a FOSS 101 talk. He talked about why we should choose FOSS, how newcomers join and contribute to Fedora, and main communication tools of FOSS communities. Then he gave an introduction on Git and version control concepts. I helped demonstrate the git operations, and Trang helped translate for easy understanding.

At around 4:00 PM, we gathered to one room again. There was a panel Q&A session followed by the lucky draw. The panel session was quite interactive, and the audience raised many questions. One interesting thing is that the panel speakers voted for the best question and there was an award for that questioner. Then in the lucky draw, it turned out we foreigners were not so lucky. None of us was chosen. But lucky draw is always fun for everyone.

In the evening, we had dinner with the organizers and volunteers of SFD. We drank beer and toast to each other. I even learned how to toast in Vietnamese!

## Day 3 (2014-09-21): One Day Tour

On Sunday, Somvannda and Sarup left for the airport early in the morning. My flight was around at 7:00 PM, so I took a one day tour in Hanoi. I visited Quang Truong Ba Dinh (Ba Dinh Square), Ho Chi Minh’s Stilt House, Ho Chi Minh Museum, One Pillar Pagoda, the Flag Tower, Hanoi Cathedral, and so on. The sight spots are relatively near to each other, so I travelled around mostly by walking. I had lunch at Quan An Ngon, a popular restaurant in Hanoi, and bought some candies and gifts to bring back to China. In the afternoon, on the way back to the airport, I also walked by the Ho Hoan Kiem (Hoan Kiem Lake). The sight spots are nice, and the food is delicious. So I enjoyed the trip to Hanoi a lot. Plus the warm support and help from Tuan, Thang, Somvannda, Sarup, and others, the days in Hanoi are quite memorable to me.

## 刷新固件

Nuand 官方提供固件的源码，我们可以自行编译，不过这需要一套嵌入式开发工具链。Nuand 也提供构建好的固件镜像，可以直接下载使用。要刷新固件，只需在命令行执行：

bladeRF-cli -f bladeRF_fw_vX.Y.Z.img -v verbose

$bladeRF-cli -e version bladeRF-cli version: 0.11.1-git-c631100 libbladeRF version: 0.16.2-git-c631100 Firmware version: 1.7.1-git-ca697ee FPGA version: Unknown (FPGA not loaded) 看下其中 Firmware version（固件版本）是否更新。 事实上，还有另外一种刷新固件的方法，是通过进入设备的启动加载 (Bootloader) 模式（类似 Android 的 Recovery），输入一些命令完成的。不过这种方式步骤繁琐，一般不推荐使用，建议在上述简单方法遇到错误时考虑采用。具体步骤参加维基 ## 加载 FPGA 镜像 注意到上面的示例中，FPGA version（FPGA 版本）显示为 Unknown（未知），FPGA 未加载。目前 bladeRF 使用两种 FPGA。要加载正确的 FPGA 镜像，首先需要确定手头 bladeRF 板卡的 FPGA 尺寸。它可以根据当初购买的价格判断，但更靠谱的方法是使用命令行查看： $ bladeRF-cli -i

Serial #:                 4f977f01eec48f5068c2ee3aeba41ba9
VCTCXO DAC calibration:   0x8b63
FPGA size:                40 KLE
USB bus:                  4
USB speed:                SuperSpeed
Backend:                  libusb
Instance:                 0

Nuand 官方提供了预先构建的 FPGA 镜像，免除用户手工编译之苦。40 KLE FPGA 对应 hostedx40.rbf 文件，以此类推。要加载 FPGA 镜像，只需使用命令 bladeRF-cli -l /path/to/fpga/file，或者交互模式下 load fpga /path/to/fpga/file，其中 /path/to/fpga/file 为 FPGA 镜像所在路径。FPGA 镜像成功加载后，板卡上的三个 LED 灯会亮起，交互模式下 version 命令可以看到 FPGA 版本不再是未知。

## 自动加载 FPGA 镜像

• $HOME/.config/Nuand/bladeRF/ • $HOME/.Nuand/bladeRF/
• /etc/Nuand/bladeRF/
• /usr/share/Nuand/bladeRF/

bladeRF-cli -L /path/to/fpga/file

## 安装依赖

sudo yum install git doxygen gettext glibc-devel ncurses-devel readline-devel zlib-devel boost-devel
sudo yum install libusbx libusbx-devel cmake wget gcc-c++

cd /path/to/bladeRF/directory
git clone https://github.com/Nuand/bladeRF.git

cd bladeRF/host/
mkdir build
cd build
cmake -DINSTALL_UDEV_RULES=ON ../
make
sudo make install

/usr/local/lib
/usr/local/lib64
include ld.so.conf.d/*.conf

## 构建 GNU Radio 与 gr-osmosdr

• 编译 GNU Radio 时，并行 make （make -j N 其中 N 大于 1）时有时会编译失败（竞态条件？），直接 make 就可以正常编译通过，虽然速度会慢很多。什么？make 也会出错？那考虑换一个 git 提交重新编译，并向上游报 BUG 吧。

osmocom_fft -a bladerf=0,fpga=<your FPGA image> -s 2000000 -f 446000000

## 致谢

# nuand bladeRF
ATTR{idVendor}=="1d50", ATTR{idProduct}=="6066", MODE="660", GROUP="plugdev"

ATTR{idVendor}=="1d50", ATTR{idProduct}=="6081", MODE="660", GROUP="plugdev"

ATTR{idVendor}=="04b4", ATTR{idProduct}=="00f3", MODE="660", GROUP="plugdev"

• 不安全。考虑这样的一个场景：一个 SSH 远程登录的用户可以访问物理主机的摄像头、麦克风，只要他是该群组的成员。
• 不灵活。需要手动地维护该群组的成员列表，新增用户还需要注销当前会话重启会话才能使用该设备。
• 不具体。plugdev 群组的用户可以使用任何可插拔设备，不论这个设备是手机、摄像头还是麦克风。

Fedora 支持动态的权限控制 (ACL)，可以根据用户会话状态、物理座位(seat)配置来决定是否授权设备。在这种机制下，udev 规则文件可以是简单的一行

SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", \
ATTRS{idVendor}=="1ed8", ATTRS{idProduct}=="000[456]" \
ENV{ID_<some_name>}="1"

SUBSYSTEM!="usb", GOTO="nuand_rules_end"

ATTR{idVendor}=="1d50", ATTR{idProduct}=="6066", TAG+="uaccess"

LABEL="nuand_rules_end"