On Tue, Sep 1, 2009 at 07:59, Magnus Falk<magnu...@gmail.com> wrote:
>
> Hi,
>
> I've been trying to get my pretty Apple bluetooth keyboard to work
> with my new HTC Hero and found this post written by Erin:
[....]
> make: *** No rule to make target `out/target/product/generic/obj/lib/
> libbluetooth.so', needed by `out/target/product/generic/obj/
> EXECUTABLES/hciattach_intermediates/LINKED/hciattach'.
> Stop.
> make: Leaving directory `/home/bugbear/prg/android/mydroid'
>
It seems like you didn't build bluetooth library before you build
hidd. I wrote my comments about doing two things, one is to build all
libraries for Android and the other is to build hidd only. I forgot to
mention one more thing. I added "BOARD_HAVE_BLUETOOTH := true" one
line in BoardConfig.mk file. It would allow you to rebuild bluetooth
related library when you type 'make'.
> This last solution by Erin didn't mention the Android.mk that was in
> the old forum post she first linked to (http://groups.google.com/group/
> android-platform/browse_thread/thread/73eed70fb229d7ae?pli=1), so at
> first I renamed it so that it wouldn't run. But when the first tip
> didn't work I tried putting it back with the following result:
>
> make: Entering directory `/home/bugbear/prg/android/mydroid'
> /home/bugbear/prg/android/mydroid/external/bluez/utils/hidd/Android.mk:
> 10: *** commands commence before first target. Stop.
> make: Leaving directory `/home/bugbear/prg/android/mydroid'
>
Android.mk file is like Makefile in native C environment. If Android
build system see this file in a folder, it would read this file and
build library or binary files for it. If you have problem on building
it and don't know what is wrong, you can remove/delete this file from
this folder. Then you should be able to build other stuff and wont get
stuck from this file.
> Not one of those stupid tab-things since I removed all spaces from the
> file at least.
>
> I've resynced the repo now and am doing a full rebuild to see if it
> gets better but in the meantime I would love to get an idea about what
> I'm doing so that I can explain to others in more layman's terms how
> to get bluetooth fully working on an Android phone. Because none of
> the commands in step two make any sense to me, why am I creating the
> *.c files for instance?
>
It's not easy to understand Android build system and also not easy to
build library for normal users, non-developers. You need to study
related documents from Android website. If you still have interests to
build bluetooth library, then you can send your problem on this
mailing list, I am glad to help you.
Regards,
Erin Yueh
http://0xlab.org
>[...]
2009/9/2 Magnus Falk <magnu...@gmail.com>:
>
> Okay, thanks to Julians tip about how to build libbluetooth I made
> some progress, but it still won't build the hidd binary.
>
> bugbear@Tiny:~/prg/android/mydroid/$ ls out/target/product/generic/
> system/xbin/
> add-property-tag check-lost+found dbus-send hstest nc
> pand rctest showslab tcpdump
> attest cpueater dexdump l2ping netperf
> passkey-agent rfcomm sqlite3 timeinfo
> auth-agent crasher dund l2test netserver
> procmem scotest ssh
> avinfo daemonize hciconfig latencytop opcontrol
> procrank scp strace
> btool dbus-monitor hcitool librank oprofiled
> rawbu showmap su
>
> It seems to buildall the bluez utils _except_ hidd, even though I run
> make from inside the hidd dir. When I look inside the Makefile.am in
> the hidd dir there seems to be some sort of condition:
>
Good! you made the first step and it's only libbluetooth. Now, you can
make bluez utils.
You can type mm with -b (force rebuild) or touch all related *.c files
like what i do. Touch *.c files and it would change the file modified
time. When you build from source code, it will check the modified
time.
erin@daydreamer:~/android/mydroid_G1/external/bluez$ cd utils/
erin@daydreamer:~/android/mydroid_G1/external/bluez/utils$ touch `find
-name *.c`
erin@daydreamer:~/android/mydroid_G1/external/bluez/utils$ mm
make: Entering directory `/home/erin/android/mydroid_G1'
build/core/product_config.mk:261: WARNING: adding test OTA key
============================================
TARGET_PRODUCT=htc_dream
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=
============================================
No private recovery resources for TARGET_DEVICE dream
target thumb C: attest <=
/home/erin/android/mydroid_G1/external/bluez/utils/test/attest.c
target Executable: attest
(out/target/product/dream/obj/EXECUTABLES/attest_intermediates/LINKED/attest)
target Non-prelinked: attest
(out/target/product/dream/symbols/system/bin/attest)
target Strip: attest
(out/target/product/dream/obj/EXECUTABLES/attest_intermediates/attest)
target thumb C: auth-agent <=
/home/erin/android/mydroid_G1/external/bluez/utils/test/auth-agent.c
target Executable: auth-agent
(out/target/product/dream/obj/EXECUTABLES/auth-agent_intermediates/LINKED/auth-agent)
target Non-prelinked: auth-agent
(out/target/product/dream/symbols/system/bin/auth-agent)
target Strip: auth-agent
(out/target/product/dream/obj/EXECUTABLES/auth-agent_intermediates/auth-agent)
[...]
Install: out/target/product/dream/system/bin/hciattach
Install: out/target/product/dream/system/lib/libhcid.so
Install: out/target/product/dream/system/bin/hcid
Install: out/target/product/dream/system/bin/sdptool
Install: out/target/product/dream/system/lib/bluez-plugin/audio.so
Install: out/target/product/dream/system/lib/bluez-plugin/input.so
Install: out/target/product/dream/system/lib/liba2dp.so
Install: out/target/product/dream/system/xbin/attest
Install: out/target/product/dream/system/xbin/auth-agent
Install: out/target/product/dream/system/xbin/avinfo
Install: out/target/product/dream/system/xbin/dund
Install: out/target/product/dream/system/xbin/hciconfig
Install: out/target/product/dream/system/xbin/hcitool
Install: out/target/product/dream/system/xbin/hidd
Install: out/target/product/dream/system/xbin/hstest
Install: out/target/product/dream/system/xbin/l2ping
Install: out/target/product/dream/system/xbin/l2test
Install: out/target/product/dream/system/xbin/pand
Install: out/target/product/dream/system/xbin/passkey-agent
Install: out/target/product/dream/system/xbin/rctest
Install: out/target/product/dream/system/xbin/rfcomm
Install: out/target/product/dream/system/xbin/scotest
Finding NOTICE files: out/target/product/dream/obj/NOTICE_FILES/hash-timestamp
Combining NOTICE files: out/target/product/dream/obj/NOTICE.html
gzip -c out/target/product/dream/obj/NOTICE.html >
out/target/product/dream/obj/NOTICE.html.gz
make: Leaving directory `/home/erin/android/mydroid_G1'
If you still cannot find hidd, check this Android.mk file. It should
look like as below:
erin@daydreamer:~/android/mydroid_G1/external/bluez/utils$ cat hidd/Android.mk
LOCAL_PATH:= $(call my-dir)
#
# hidd
#
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
main.c \
sdp.c \
fakehid.c
LOCAL_CFLAGS:= \
-DVERSION=\"3.36\" \
-DSTORAGEDIR=\"/tmp\" \
-DNEED_PPOLL
LOCAL_C_INCLUDES:= \
$(call include-path-for, bluez-libs) \
$(call include-path-for, bluez-utils)/common
LOCAL_SHARED_LIBRARIES := \
libbluetooth
LOCAL_STATIC_LIBRARIES := \
libbluez-utils-common-static
LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
LOCAL_MODULE_TAGS := eng
LOCAL_MODULE:=hidd
include $(BUILD_EXECUTABLE)
On Wed, Sep 2, 2009 at 15:21, Magnus Falk<magnu...@gmail.com> wrote:
> Oooh, sweet trick with the touching Erin! Hadn't thought about that!
>
> One more question though: it seems like you're building the htc_dream
> target, while I'm building the generic target. How do I change that? Or
> doesn't it matter in this case?
it doesn't matter in this case. Both of them are built for arm
machines. You can use this command to check what version it is.
erin@daydreamer:~/android/mydroid_G1/out/target/product/dream/system/xbin$
file hidd
hidd: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically
linked (uses shared libs), stripped
If you'd like to change the target to G1 (htc_dream), you could read
this document in Android site.
http://source.android.com/documentation/building-for-dream
> And oh, when I copied the the Android makefile once again it worked. Seems
> like it was stupid of me to switch all the spaces to tabs in the first
> place. Now remember why I hate make... =P
> The pushing of the hidd binary to the phone didn't work though, but I guess
> that's just a matter of mounting it properly and I think I remember seeing
> such instructions in the tutorial I used to gain root access:
> failed to copy 'out/target/product/generic/system/xbin/hidd' to
> '/system/bin/hidd': Read-only file system
yes, it's file system permission problem. Just try below commands in
your Android phone:
$ su
$ mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
it would allow you upload hidd file to /system/xbin folder. If you
still cannot upload it, use 'chmod 777 /system' to modify folder
permission too.
After uploading hidd successfully, you could follow
"http://groups.google.com/group/android-platform/browse_thread/thread/73eed70fb229d7ae?pli=1"
this article (step from hcitool scan) to setup your bluetooth
keyboard.
I hope we can hear your good news soon!
1. check running process: we can see these three lines as below
$ su
# ps
bluetooth 36 1 1180 744 c00ad64c afe0d25c S /system/bin/dbus-daemon
bluetooth 81 1 744 328 c00ad64c afe0d25c S /system/bin/hciattach
bluetooth 106 1 1608 1016 c00ad64c afe0d25c S /system/bin/hcid
2. run hciconfig, it would tell us bluetooth device detailed information
# hciconfig -a
hci0: Type: UART
BD Address: 00:22:A5:B8:AD:65 ACL MTU: 1021:4 SCO MTU: 180:4
UP RUNNING PSCAN
RX bytes:2333 acl:9 sco:0 events:60 errors:0
TX bytes:697 acl:8 sco:0 commands:35 errors:0
Features: 0xff 0xff 0x2d 0xfe 0x9b 0xf9 0x00 0x80
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF PARK
Link mode: SLAVE ACCEPT
Name: 'Android Dev Phone 1'
Class: 0x48020c
Service Classes: Capturing, Telephony
Device Class: Phone, Smart phone
HCI Ver: 2.0 (0x3) HCI Rev: 0x0 LMP Ver: 2.0 (0x3) LMP Subver: 0x1126
Manufacturer: Texas Instruments Inc. (13)
3. From Android Setting UI, click 'Scan for devices', when you see
your Apple Wireless Keyboard, click it and pair with it.
4. After you see 'Paired but not connected' in your keyboard. Go back
to terminal, run hcitool to scan nearby devices,
# hcitool scan
Scanning ...
00:1D:4F:A7:9A:49 Apple Wireless Keyboard
00:22:43:C6:5B:B9 daydreamer-0
00:18:C5:42:18:78 Erin-Nokia N73
00:10:60:D0:00:14 SPEED
# hidd --connect 00:1D:4F:A7:9A:49
# hcitool con
Connections:
< ACL 00:1D:4F:A7:9A:49 handle 1 state 1 lm MASTER
5. DONE! you should be able to use your Apple Wireless Keyboard!
Cheers,
Erin Yueh
http://0xlab.org
On Fri, Sep 4, 2009 at 01:02, Magnus Falk<magnu...@gmail.com> wrote:
>
[...]
> Bleh, on my phone, only the dbus-daemon shows up. Some searching
> turned up how to start the other two, but it didn't seem to help,
> hcitool -a just got me a blank line and hcitool scan the same old
> "Device is not available: No such device".
>
> Is there an rc-file with settings somewhere I need to edit for the
> hciattach and hcid daemons to be running?
>
mmh....check *.rc files in "/" folder in Android. Did you see
Bluetooth ON in Settings menu? If we turn it one, it would start to
run other two processes. At least, it's the normal procedure in G1.
Except, HERO is not using native bluez library.
I mentioned bluetooth initialize in Android on my blog before,
http://i-miss-erin.blogspot.com/2009/06/android-bluetooth-introduction-part-i.html
http://i-miss-erin.blogspot.com/2009/05/few-notes-for-android-bluetooth.html
actually, you don't need to edit *.rc files, Settings application
would check Bluetooth value and decide whether it should run hcid or
not.
could you please cat your *.rc files and use ps to list all running
processes in your Android? then we could understand HERO more here.
On Fri, Sep 4, 2009 at 23:18, Magnus Falk<magnu...@gmail.com> wrote:
>
[...]
>>
>> #btips
>> service btips /system/bin/bts
>> socket bluetooth stream 660 bluetooth bluetooth
>> socket dbus_bluetooth stream 660 bluetooth bluetooth
>> group bluetooth net_bt_admin misc
>> disabled
>> oneshot
>
> Hmm, looks like there are few bluetooth-related services listed as
> "disabled", or am I reading it wrong?
>
It is disabled in the beginning, but system will start them later.
Here is a porting guide about Android init script.
http://www.netmite.com/android/mydroid/development/pdk/docs/bring_up.html
I guess something wrong in your bluez, so we cannot see hcid &
hciattach in the running processes. What files you upload to HERO?
'hidd','hciconfig','hcitool', or anything else? Before you uploaded
these files, have you used any other BT devices successfully?
mmh...we can manually power up bluetooh, not from Setting UI. Let's
try below steps:
1. Turn BT OFF in Setting UI
2. Pull high in BT power
# echo 1 > /sys/class/rfkill/rfkill0/state
3. Load BT firmware to hci stack
# hciattach -n -s 115200 /dev/ttyHS0 texas 4000000 flow
You would see the result like below,
Texas module LMP version : 0X3
Texas module LMP sub-version : 0X1126
internal version freeze: 38
software version: 2
chip: brf6300 (4)
Setting speed to 4000000
Texas speed changed to 4000000.
Loading firmware from /etc/firmware/brf6300.bin...
Firmware load successful.
4. Start HCI device
# hciconfig hci0 up
5. Start HCI daemon
# hcid -s -n -f /etc/bluez/hcid.conf
6. Check the running processes, can you see hcid and hciattach?
# ps
If you still cannot see them, you may download my bluez files from
here. Upload them to HERO, then repeat above steps... Good luck!
# wget http://androidobex.googlecode.com/files/hciattach
# adb push hciattach /system/bin
# wget http://androidobex.googlecode.com/files/hcid
# adb push hcid /system/bin
# wget http://androidobex.googlecode.com/files/libbluetooth.so
# adb push libbluetooth.so /system/lib
On Mon, Sep 7, 2009 at 09:32, Magnus Falk<magnu...@gmail.com> wrote:
>
> Hi Erin,
>
> Thank you for sticking with me, I really appreciate this!
You're welcome! I am glad that someone read my blog and I hope those
notes can help people.
>
[....]
>
> I tried with your files as well with the same result. So I guess they
> switched the bluetooth chip or something and I need to compile bluez
> specifically for that chip?
>
mmh.... I just google about Hero bluetooth and found this page. It
seems like this user had the same problem about BT functions. You
could take a look and check what HTC images you are using?
http://androidcommunity.com/forums/archive/index.php/t-23270.html
On Tue, Sep 8, 2009 at 07:50, Magnus Falk<magnu...@gmail.com> wrote:
>
[..]
>
> Problem is that I can't figure out how to install the damn thing... As
> far as I can tell you're supposed to use the recovery image and the
> Cyanogen image in tandem somehow?
>
mmh... here is an image chart and it has many types of Android images.
I also downloaded one and updated it in my Android Dev phone. It looks
great and BT function is working normally as well.
image chart: http://db.androidspin.com/android_build_information.asp
[ROM]TheOfficial TMO (US-CRC1/EU-CRC37) & ADP-CRC1 [9/5/09]- v1.7.1:
http://forum.xda-developers.com/showthread.php?t=538456
What i did?
I read post#4 carefully and did what they recommend. Pick one image
and then push it to /sdcard.
http://joomla.androidspin.com/downloads.php?dir=enomther/ROM/&file=TMO_OTA_CRC1_Rooted_FullFeatured_update_v1.7.1.zip
copied from the original post:
1) BACKUP ALL YOUR PHONE DATA AND SDCARD Contents to a computer,
external HD, or whatever, by whatever means you can. (Always better
Safe than ever sorry!)
2) If you are going to install the "TMO OTA CRC1 FullFeatured ROM"
READ THIS (if not, you can skip to step #3):
If you are coming from another Apps2SD ROM (if you don't know what
that means, goto step #3). In order to guarantee you won't have any
issues with the install you should remove all directories starting
with "app" and the dalvik-cache directory on your /system/sd
(ext2/ext3) partition. If you backed up your whole SDcard, this
shouldn't be a huge issue. - Yes you'll have to reinstall your apps.
You can try to skip this step, but if the install fails, rinse, wash,
repeat and don't skip this step.
(NOTE: I've see it successfully pull Apps2SD over from a cyanogen ROM
with no problems, but that's no guarantee!)
3) Download the desired base or full featured ROM from the original post.
4) Rename the downloaded file update.zip.
5) Copy the update.zip to your phone's SDcard. (DO NOT PLACE IT IN A FOLDER).
6) Power-Off your phone.
7) Press and Hold (Home+Power) buttons at the same time to boot into
recovery mode.
8) Perform a data wipe by pressing (Alt+w), may have to confirm by
pressing HOME (it will prompt).
9) Perform the update (install the ROM), by pressing (Alt+s).
10) When finished, reboot from recovery by pressing (Home+Back).
11) Once your phone has booted up, sign into your Google account (by
whatever means) through the setup/data-sync wizard.
12) Launch the "MarketApp" and accept the terms, download some app
you're familiar with by going to 'My Downloads' or search for one!
On Thu, Sep 10, 2009 at 10:03, Magnus Falk <magnu...@gmail.com> wrote:
>
[...]
> There's a thing I don't understand about the AndroidSPIN database you
> linked to though, how can I tell if a ROM will work with my phone? I
> tried several that said they were build upon 1.5 Hero (JACHeroSki-
> v1.8, JACMyTouchSkiv2.5.2 for instance) and a couple of others
> (Cyanogen stable and TMO-OTA-EU-CRC37) but none of them would even
> load. What should I look for?
umm...that is too bad you cannot see any one of them running in your
HERO. When I read that AndroidSpin database, I will choose the most
downloaded one and has more check items enabled. Phone type column is
any HTC dream. Actually, Dream, Magic and Hero hardware are almost the
same. If it's workable in Dream(G1), it should be able to run in Hero.
mmh.... i have no idea why you cannot load those images. How about we
try cyanogen's solution again? I also tried it in my ADP and it is
workable.
(1) flash recovery-image
http://www.cyanogenmod.com/downloads/recovery-image
Download image (right-click, save as):
http://n0rp.chemlab.org/android/cm-recovery-1.4.img
MD5Sum: f5135a878c705215f4012786e4261cfe
To install image: copy it to your sdcard and run below command in Android:
#flash_image recovery /sdcard/cm-recovery-1.4.img
If you have problems with a “no space on device” error, try using
fastboot and erasing first:
#fastboot erase recovery
#fastboot flash recovery cm-recovery-1.4.img
(2) update a stable ROM
http://n0rp.chemlab.org/android/update-cm-4.0.4-signed.zip
# adb push update-cm-4.0.4-signed.zip /sdcard/update.zip
Press HOME + Power key, it would enter into Recovery mode
Follow the menu and select [ALT+S] apply sdcard:update.zip
then it would say Install from sdcard complete.
Press HOME+ Back key, reboot system now!
DONE!
Cheer up! I hope you can enjoy HERO phone and have fun with Android community.