Bluetooth: Receiving files failure

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Bluetooth: Receiving files failure

6,184 Views
blessy_abraham
Contributor III

Hi,
I am using imx7d processor interfaced with the wifi/bluetooth module wl1831. 
I need to transfer files between a the board and a phone. Pairing and connection to the phone is working well using  bluetoothctl. Also sending files from board to the phone is also a success using obexctl.  

While receiving files from phone to the board, i face i below error, 

Aug 16 13:27:34 imx7d obexd[546]: CONNECT(0x0), <unknown>(0xff)
Aug 16 13:27:34 imx7d obexd[546]: CONNECT(0x0), <unknown>(0x0)
Aug 16 13:27:35 imx7d obexd[546]: disconnected: Unicode conversion failed: Conversion from character set “UTF-16BE” to “UTF-8” is not supported.

I followed the below steps to initiate transfer

$ /usr/libexec/bluetooth/obexd -r /home/root -a -d & obexctl 

[2] 564
[NEW] Client /org/bluez/obex
[obex]# Name already in use
connect 8C:BE:BE:03:EA:0D
Attempting to connect to 8C:BE:BE:03:EA:0D
[NEW] Session /org/bluez/obex/client/session3 [default]
[NEW] ObjectPush /org/bluez/obex/client/session3
Connection successful
[8C:BE:BE:03:EA:0D]#
[NEW] Session /org/bluez/obex/server/session1
[NEW] Transfer /org/bluez/obex/server/session1/transfer0
[DEL] Transfer /org/bluez/obex/server/session1/transfer0
[DEL] Session /org/bluez/obex/server/session1
[8C:BE:BE:03:EA:0D]#

Labels (3)
19 Replies

5,420 Views
yyc1975
Contributor III

Hi All,

I finally found solution to solve this Unicode conversion issue.

According to this discussion thread,  glibc's iconv implementation is based around plug in modules for specific translations. If you know which encoding you need, you can add it in your recipe.

For example, UTF-16BE is not suppported in this case so that I add "glibc-gconv-utf-16" to IMAGE_INSTALL.

I also add "glibc-utils" cause I want iconv in my rootfs.

IMAGE_INSTALL += " glibc-gconv-utf-16 glibc-utils"

After than, I can receive file from host PC (Windows) without any error.

Best Regards,

YY.

5,420 Views
weibinchi
Contributor II

Hi Yu-Yuan Chen,

      Nice to hear you have resolved the problem. And thank you for providing another solution.

      I referenced the the patch (meta-arago-var/0001-obexd-fix-UTF-conversions.patch at master · varigit/meta-arago-var · GitHub ), modify the bluez source code and recompile bluez.

      

0 Kudos

5,420 Views
yyc1975
Contributor III

Hi weibinchi‌,

I was trying to patch meta-arago-var/0001-obexd-fix-UTF-conversions.patch at master · varigit/meta-arago-var · GitHub but found that I don' have obexd recipe in my distribution. In my distribution, obexd is integrated into bleuZ 5.x.

Luckily, after thousand of searches, I found this solution and fix it without add any patch/bbappend added.

Hope it helps.

YY 

0 Kudos

5,420 Views
weibinchi
Contributor II

Hello  Blessy Abraham

       I also encountered the same problem. Have you solved it?

       If it is solved, what is it done?

 

       Thanks!

0 Kudos

5,420 Views
blessy_abraham
Contributor III

Hi weibin chi, 
   I solved this issue by applying the patch mentioned in the below link, 
meta-arago-var/0001-obexd-fix-UTF-conversions.patch at master · varigit/meta-arago-var · GitHub 

1,553 Views
Akhil228
Contributor I

Hello could you please mention the steps how to add patches for obexd to get rid off receiving files failure 

0 Kudos

5,420 Views
dianyuan_li
Contributor I

Hi @blessy abraham,would you please show me what is the receiveing files steps?mine also send files OK,but I don't know how to receive files from a phone to my test-board ,can you show me the details steps and the commands in the process,appreciate my brother~

0 Kudos

5,420 Views
blessy_abraham
Contributor III

Hi Dianyuan, 
Did you mean, you want to send a file from your phone to the test board? I followed the below steps. 
1. $bluetoothctl
[bluetooth]# power on
[bluetooth]# agent on
[bluetooth]# default-agent
[bluetooth]# discoverable on
[bluetooth]# pairable on
 Send pairing and connection request from phone to test board. Pair and establish the connection. 
1. $ export $(dbus-launch)
2. $ /usr/libexec/bluetooth/obexdti -r /home/root -a -d -n & obexctl
[obex]# connect 6C:C4:D5:6C:C5:BC
Try sending files from phone to target board. Files will be present in /home/root directory
 

0 Kudos

5,420 Views
dianyuan_li
Contributor I

And when I send files from a phone to my test-board,I can't find the test-board in the search list 。the follwing is my steps:

[0;94m[bluetooth] [0m# default-agent
[KDefault agent request successful
[0;94m[bluetooth] [0m# discoverable on
[KChanging discoverable on succeeded
[K[ [0;93mCHG [0m] Controller 8F:8F:8E:8E:6D:6D Discoverable: yes
[0;94m[bluetooth] [0m# pairable on
[KChanging pairable on succeeded
[K[ [0;93mCHG [0m] Device 94:87:E0:E3:95:16 Connected: yes
[K[ [0;93mCHG [0m] Device 94:87:E0:E3:95:16 Connected: no
[0;94m[bluetooth] [0m# quit
[KAgent unregisteredm#
[ [0;91mDEL [0m] Controller 8F:8F:8E:8E:6D:6D BlueZ 5.48 [default]
root@sl8521e-base:/ # export $(dbus-launch)
root@sl8521e-base:/ # /usr/libexec/bluetooth/obexd -r /tmp -a -d & obexctl
[K[ [0;92mNEW [0m] Client /org/bluez/obex
[0;94m[obex] [0m# connect 94:87:E0:E3:95:16
Attempting to connect to 94:87:E0:E3:95:16
[K[ [0;92mNEW [0m] Session /org/bluez/obex/client/session0 [default]
[K[ [0;92mNEW [0m] ObjectPush /org/bluez/obex/client/session0
[KConnection successful6] [0m#
[0;94m[94:87:E0:E3:95:16] [0m#

Then I used a phone choose a file to send it ,but i can't find the BlueZ 5.48。(when scan theBlueZ 5.48  can

be found,but send a file BlueZ 5.48 cannot be found)

0 Kudos

5,420 Views
dianyuan_li
Contributor I

blessy.abraham@vvdntech.in‌ brother,I connecting is OK ,But I donnot konw how did you display the “

[NEW] Session /org/bluez/obex/server/session1
[NEW] Transfer /org/bluez/obex/server/session1/transfer0
[DEL] Transfer /org/bluez/obex/server/session1/transfer0 ”,

mine is always client ,not server,such as “

[NEW] Session /org/bluez/obex/client/session0 [default]
[NEW] ObjectPush /org/bluez/obex/client/session0”

What kind of operation will this interface appear???thanks buddy

0 Kudos

5,420 Views
blessy_abraham
Contributor III

HI Dianyuan, 

Did you try 
connect 8C:BE:BE:03:EA:0D 
from obexd? 

0 Kudos

5,420 Views
dianyuan_li
Contributor I

Hi blessy.abraham@vvdntech.in,I did it,in obexctl, connect 94:87:E0:E3:95:16(it's  the phone's mac addr),

root@sl8521e-base:/ # /usr/libexec/bluetooth/obexd -r /tmp -a -d & obexctl
[ [0;92mNEW [0m] Client /org/bluez/obex
[0;94m[obex] [0m# connect 94:87:E0:E3:95:16
Attempting to connect to 94:87:E0:E3:95:16
[ [0;92mNEW [0m] Session /org/bluez/obex/client/session0 [default]
[ [0;92mNEW [0m] ObjectPush /org/bluez/obex/client/session0
[Connection successful] 

[94:87:E0:E3:95:16] # 

Now you see,the connecting is OK,then how can i operate  on the phone or test-board to make it display 

[NEW] Session /org/bluez/obex/server/session1 ,the problem is the server doesn't  raise up。how did you do for that next?

I almost died...

0 Kudos

5,420 Views
yyc1975
Contributor III

Hi  blessy.abraham@vvdntech.in‌ and weibinchi‌,

I have encountered same the same problem.

Could you tell me how to use the patch (meta-arago-var/0001-obexd-fix-UTF-conversions.patch at master · varigit/meta-arago-var · GitHub ) to fix this problem?

Best Regards,

YY

0 Kudos

5,421 Views
weibinchi
Contributor II

HelloBlessy Abraham

          Thank you for your answer. I referenced the link you gave and the problem was solved. 

          Thank you very much.

5,421 Views
blessy_abraham
Contributor III

Hi igorpadykov, 

I am also facing the same issue in imx7d sabre board too which is using murata bcm4339 chipset. Can we get anyy support from here?  

0 Kudos

5,421 Views
blessy_abraham
Contributor III

Hi,
Thank you for your time. The above mentioned link didn't solve my issue. I am still getting the same error mentioned in my above query. 

I am seeing the same issue in the imx7d sabre board (4.14.98) too.  


Feb 21 02:12:28 imx7dsabresd obexd[511]: CONNECT(0x0), <unknown>(0x0)
Feb 21 02:12:28 imx7dsabresd obexd[511]: disconnected: Unicode conversion failed: Conversion from character set “UTF-16BE” to “UTF-8” i
Feb 21 02:13:18 imx7dsabresd bluetoothd[478]: Unable to get io data for Object Push: getpeername: Transport endpoint is not connected (107)
Feb 21 02:13:19 imx7dsabresd obexd[541]: OBEX daemon 5.49
Feb 21 02:13:19 imx7dsabresd obexd[541]: ../bluez-5.49/obexd/src/main.c:main() Entering main loop
Feb 21 02:13:19 imx7dsabresd obexd[541]: ../bluez-5.49/obexd/src/manager.c:manager_init()
Feb 21 02:13:19 imx7dsabresd obexd[541]: manager_init failed
Feb 21 02:13:44 imx7dsabresd obexd[511]: CONNECT(0x0), <unknown>(0xff)
Feb 21 02:13:44 imx7dsabresd obexd[511]: CONNECT(0x0), <unknown>(0x0)
Feb 21 02:13:44 imx7dsabresd obexd[511]: disconnected: Unicode conversion failed: Conversion from character set “UTF-16BE” to “UTF-8” i

How do we enable UTF-8 encoding in yocto? 

 Any help would be appreciated. 

0 Kudos

5,421 Views
igorpadykov
NXP Employee
NXP Employee

may be recommended to apply to vendor wl1831 chip, ti tech support.

Best regards
igor

0 Kudos

5,420 Views
igorpadykov
NXP Employee
NXP Employee

Hi Blessy

one can look at variscite bluetooth usage

IMX Bluetooth Obex - Variscite Wiki 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos