KoshianとUARTを接続して、右ダイアログの緑なMake Tragetの中から適当にダブルクリックするとアプリがBCM20737Sに書き込まれる。実験で何か適当に選んでやって、iPhoneとかから接続してみると良いかも。otaアップデート(Over the Air:無線経由でのファームアップ)とかは、[WICED-Smart-SDK]->[Apps]->[ota_firmware_upgrade]->[peerapps]->[Windows]以下にWindows向けのexeがあるから、PCにBluetoothドングルを挿して書き込むアプリを指定するとotaアップデートも出来ちゃったりした。
This is “How to use 6LoWPAN(IPv6 over Bluetooth) on VMware Player Ubuntu LTS image”. 6LoWPAN is already included in linux kernel tree(net/bluetooth/6lowpan.c), and Nordic nRF51 IoT SDK is using Raspbian kernel for Raspberry Pi Linux kernel 3.17.4 as IPv6 gateway, but hardware(RPi) is needed if want to try the 6LoWPAN. so I build lastest Linux kernel 3.18.4 for Ubuntu 14.04 LTS, and use VMware Player instead of the Raspberry Pi. Even if you don’t have RPi, can use the 6LoWPAN!!
I use Nordic nRF51822(Red bear BLE nano: ARM Cortex-M0 SoC plus Bluetooth 4.1 Low Energy), and Bluetooth USB Dongle(Bluetooth4.0+EDR/LE), nRF51 IoT SDK, like a following.
2. Run VMware Player
In my case, I use Windows7 VMware Player. This Ubuntu Linux 14.04.1 user and password is “ubuntu/ubuntu”. Linux Kernel is already updated to 3.18.4.
3. connect Bluetooth Dongle to the PC, check the Bluetooth dongle and VM Linux connection on VMware Player dialog.
3. config the 6lowpan and check the ping6 on VMware.
If want to build the linux kernel, check the “/boot/config-3.18.3” linux kernel build file. Maybe it’s easy to develop the linux 6lowpan kernel module by using the VM linux.
“ipv6 over bt”って見えるのがKoshian(BCM20737)。この上でIPv6を動かす暴挙をしようと(現時点では6LoWPANをKoshianの上ではまだ動かせていないです。ipv6 over btプロジェクトを作ってみたものの、WICED 2.2 SDKにある、l2capライブラリが6lowpanのpacket flow controlに対応していないようで、なんとか自作しないと現時点ではサクッとは無理ですねぇ)。うまくいったら、Nordic側とIPv6でBluetooth上で疎通できたらオモシロという謎の事をしようとしている。まぁ、恐らくチップ間での相互互換とかどうせ発生するだろうし、発生しなくても繋げられたら面白いじゃん!!ってことで。最終的には、ケータイ(iPhone/Android)にアプリを入れて、ケータイをGatewayにしてIPv6網に抜けていく感じを想定している。Koshianと6LoWPANで疎通するのは、Nordicの時に作ったVM上のUbuntu。
MacのUSBポートにはnRF51、BroadcomのBluetoothドングル(市販の普通のもの)を挿して、nRF51 BluetoothドングルがMac上のVM Linuxを介してIPv6 over Bluetoothとして疎通している。
何を思っているかというと、WiFiが使えなくてルータがない、シリアルも無くても、VMのUbuntu上でIPv6 over Bluetoothで疎通をしてネットワークを作ってテスト・開発・検証できる(Macは対応している訳じゃないからね)。VM上のLinuxを6LoWPANルータみたいな感じで使えるし、便利な環境も作れるようになる。
NordicのIPv6 over Bluetoothの6LoWPAN側のrouter側(RPi)はカーネルが提供されている。6LoWPANの実装は”net/bluetooth/6lowpan.c”でIntelがコミットしていた。既にLinuxのカーネルツリーに入っていて、Nordic提供のRPi用Kernel 3.17.4ではinsmodして使える。
これで普通にnetfilterのnatとかが使える。IPv6 over Bluetooth/6lowpanも動作確認済。
ちなみに、Nordicの.configは参考にしたけど、継承しないで最新のkernel 3.18.3(nordicのは3.17.4で古い)を使っている。一応、ちゃんと動いているからnordicのRaspberry Piのイメージでnetfilterでおかしいな?と思った時の参考まで。
ちなみに、恐らく予想だけど、nordicのnetfilterがおかしいのは旧カーネルのoldconfigする時に、いちいち新機能の差し替えが走るんだけど、そこで「エンター連打」をしてスッ飛ばしたからなんじゃないかと予想している。バージョン忘れたけど、どこかのカーネルのバージョンからNEWで連打ボーン!!すると、natとかがスルーされてしまう。たぶん、連打ボーンしてIPv6 over bluetoothじゃ使わないから気にしなかったんぢゃないかなーと。