Yun & Compatible
- Details
- Written by Sonny Yu
At Linux box:
sonnyyu@debian75386240:~/test$ java -version java version "1.7.0_75" OpenJDK Runtime Environment (IcedTea 2.5.4) (7u75-2.5.4-1~deb7u1) OpenJDK Server VM (build 24.75-b04, mixed mode)
nano HelloWorld.java
class HelloWorld { public static void main(String args[]) { System.out.println("Hello World"); } }
Compile HelloWorld.class file:
javac HelloWorld.java
Copy HelloWorld.class into Openwrt Box:
root@Arduino:/mnt/sda1# jamvm HelloWorld Hello World
Write comment (0 Comments)
- Details
- Written by Sonny Yu
echo 0a5c 21e8> /sys/bus/usb/drivers/btusb/new_id
hciconfig hci0 up
Confirm it works:
root@Arduino:~# hciconfig hci0: Type: BR/EDR Bus: USB BD Address: 00:02:72:33:96:0A ACL MTU: 1021:8 SCO MTU: 64:1 UP RUNNING RX bytes:2145 acl:0 sco:0 events:84 errors:0 TX bytes:187 acl:0 sco:0 commands:42 errors:0
hcitool lescan --duplicates 1>/dev/null &
root@Arduino:~# hcidump -a HCI sniffer - Bluetooth packet analyzer ver 5.13 device: hci0 snap_len: 1500 filter: 0xffffffff > HCI Event: LE Meta Event (0x3e) plen 39 LE Advertising Report ADV_IND - Connectable undirected advertising (0) bdaddr D0:B7:E8:DE:F3:00 (Random) Complete local name: 'Rtrivr_R621' Unknown type 0x19 with 2 bytes data Flags: 0x06 TX power level: 0 Complete service classes: 0xf000 RSSI: -68 > HCI Event: LE Meta Event (0x3e) plen 12 LE Advertising Report SCAN_RSP - Scan Response (4) bdaddr D0:B7:E8:DE:F3:00 (Random) RSSI: -65
Move iBeacon further a part distance will reduce RSSI, -6dB seems to be double the distance.
- Details
- Written by Sonny Yu
root@Arduino:~# lsusb ... Bus 001 Device 005: ID 0a5c:21e8 Broadcom Corp. BCM20702A0 Bluetooth 4.0
Install Bluetooth software:
opkg update opkg install kmod-bluetooth bluez-libs bluez-utils
Manually mount it:
root@Arduino:~# echo 0a5c 21e8> /sys/bus/usb/drivers/btusb/new_id
root@Arduino:~# hciconfig hci0: Type: BR/EDR Bus: USB BD Address: 00:02:72:33:96:0A ACL MTU: 1021:8 SCO MTU: 64:1 DOWN RX bytes:489 acl:0 sco:0 events:20 errors:0 TX bytes:86 acl:0 sco:0 commands:20 errors:0
Plugable® USB Bluetooth 4.0 Low Energy Micro Adapter
Amazon Price:$11.95
IOGEAR Bluetooth 4.0 USB Micro Adapter
Amazon Price:$11.77
Write comment (0 Comments)- Details
- Written by Sonny Yu
ATmega32U4 code:
#include <Bridge.h> void setup() { Bridge.begin(); } void loop() { char lbuffer[256]; Bridge.get("D12", lbuffer, 256); Bridge.put("D13", String(random(1, 100))); delay(1000); }
nano bridge.py
#!/usr/bin/python import sys sys.path.insert(0, '/usr/lib/python2.7/bridge/') from bridgeclient import BridgeClient as bridgeclient value = bridgeclient() value.put("D12","Test") print value.get('D13')
chmod 755 bridge.py ./bridge.py
Write comment (0 Comments)
Subcategories
Expand the Storage at Yun
Expand the Storage at Yun
Languages Supported by Yun
Languages Supported by Yun
Backup and Recover
Backup and Recover
Network and Yun
Network and Yun
Hardware & Yun
Hardware & Yun
OpenWrt-SDK & Yun
OpenWrt-SDK & Yun
Page 5 of 34