These are the steps I used to create an SPP connection between my Windows 7 PC and my Edison running the 159 image (because of the SPP issue mentioned in https://communities.intel.com/thread/101689):
#Edit line 8 and save
#after: ExecStart=/usr/lib/bluez5/bluetooth/bluetoothd -C
systemctl restart bluetooth.service
rfkill unblock bluetooth
sdptool add --channel=22 SP
rfcomm watch /dev/rfcomm0 22 > /dev/null &
Open Bluetooth devices, find Edison and click on pair.
An inquiry will pop-up, enter yes.
Now, SPP COM port is recognized. If you open your PC's device manager you should be able to find under the COM ports something similar to:
Standard Serial over Bluetooth link (COMX)
If this does not happen, go to Show Bluetooth Devices and right click on your Edison, go to properties, select services and enable SPP. Now the COM port should show up on your PC and you will be able to connect to your board through SPP. Select the COM port number that appears on your device manager as Standard Serial over Bluetooth link and use a baud rate of 9600.
Let me know if this works for you.
Thank you for your message. I have followed through your instructions and can see the Standard Serial over Bluetooth Links on my PC, and on the edison the rfcomm says its connected to my PC device on channel 22. But when I open a putty connection on my PC I can type characters in but nothing appears on the Edison terminal. Then if I close the putty window which is connected to the SPP over Bluetooth ComPort I get the following message on the Edison terminal:
[ 2509.830245] BUG: unable to handle kernel paging request at ffffffe0
[ 2509.830341] IP: [<c132243c>] __kmalloc_track_caller+0x9c/0x200
[ 2509.830416] *pdpt = 0000000001d14001 *pde = 0000000001d18067 *pte = 0000000000000000
[ 2509.830497] Oops: 0000 [#1] PREEMPT SMP
[ 2509.830550] Modules linked in: usb_f_acm u_serial g_multi libcomposite bcm_bt_lpm bcm4334x(O)
[ 2509.830666] CPU: 0 PID: 4 Comm: kworker/0:0 Tainted: G O 3.10.17-poky-edison+ #1
[ 2509.830732] Hardware name: Intel Corporation Merrifield/BODEGA BAY, BIOS 542 2015.01.21:18.19.48
[ 2509.830806] Workqueue: events flush_to_ldisc
[ 2509.830852] task: f6c810b0 ti: f6c96000 task.ti: f6c96000
[ 2509.830902] EIP: 0060:[<c132243c>] EFLAGS: 00010282 CPU: 0
[ 2509.830953] EIP is at __kmalloc_track_caller+0x9c/0x200
[ 2509.831000] EAX: 00000000 EBX: f73f04e0 ECX: ffffffe0 EDX: 00004346
[ 2509.831052] ESI: c1d0c4e0 EDI: f6c01b00 EBP: f6c97e10 ESP: f6c97de4
[ 2509.831104] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
[ 2509.831152] CR0: 8005003b CR2: ffffffe0 CR3: 01d17000 CR4: 001007f0
[ 2509.831203] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
[ 2509.831253] DR6: ffff0ff0 DR7: 00000400
[ 2509.831287] Stack:
[ 2509.831311] 00000003 00000001 f73efc50 f6c96000 c1733437 00000200 00010220 ffffffe0
[ 2509.831421] f6c97e3f 00000020 00000200 f6c97e2c c1732bb2 00000020 f5f1f000 f5f1f000
[ 2509.831529] f6c01c00 00000020 f6c97e4c c1733437 00000000 0000010c 00000000 f51b5000
[ 2509.831636] Call Trace:
[ 2509.831683] [<c1733437>] ? __alloc_skb+0x67/0x1a0
[ 2509.831740] [<c1732bb2>] __kmalloc_reserve.isra.33+0x22/0x70
[ 2509.831799] [<c1733437>] __alloc_skb+0x67/0x1a0
[ 2509.831853] [<c182fb81>] hci_reassembly+0x1a1/0x1f0
[ 2509.831908] [<c182fc8a>] hci_recv_stream_fragment+0x3a/0x70
[ 2509.831968] [<c1667e5f>] h4_recv+0x1f/0x50
[ 2509.832017] [<c1667483>] hci_uart_tty_receive+0x53/0x80
[ 2509.832073] [<c15379d0>] flush_to_ldisc+0xe0/0x130
[ 2509.832131] [<c125dbbe>] process_one_work+0xfe/0x410
[ 2509.832188] [<c1270ddb>] ? get_parent_ip+0xb/0x40
[ 2509.832241] [<c18e2b6d>] ? add_preempt_count+0x7d/0xf0
[ 2509.832295] [<c18e2c75>] ? sub_preempt_count+0x95/0xf0
[ 2509.832352] [<c125e29c>] worker_thread+0xfc/0x360
[ 2509.832406] [<c18df295>] ? _raw_spin_unlock_irqrestore+0x55/0x60
[ 2509.832468] [<c125e1a0>] ? rescuer_thread+0x2d0/0x2d0
[ 2509.832522] [<c1263570>] kthread+0xa0/0xb0
[ 2509.832570] [<c18e2c75>] ? sub_preempt_count+0x95/0xf0
[ 2509.832630] [<c18e4bf7>] ret_from_kernel_thread+0x1b/0x28
[ 2509.832687] [<c12634d0>] ? kthread_create_on_node+0xc0/0xc0
[ 2509.832735] Code: e8 ca 07 5c 00 8b 45 e0 8b 55 f0 8b 40 08 a8 08 0f 85 32 01 00 00 8b 03 85 c0 89 45 f0 0f 84 32 01 00 00 8b 47 14 8b 4d f0 8b 37 <8b> 1c 01 8d 4a 02 8b 45 f0 64 0f c7 0e 0f 94 c0 84 c0 74 a3 03
[ 2509.833248] EIP: [<c132243c>] __kmalloc_track_caller+0x9c/0x200 SS:ESP 0068:f6c97de4
[ 2509.833327] CR2: 00000000ffffffe0
[ 2509.833375] ---[ end trace 192e50bea969c6e5 ]---
[ 2509.833426] BUG: sleeping function called from invalid context at /data/jenkins_worker/workspace/edison-weekly/linux-kernel/kernel/rwsem.c:20
[ 2509.833517] in_atomic(): 1, irqs_disabled(): 1, pid: 4, name: kworker/0:0
[ 2509.833578] CPU: 0 PID: 4 Comm: kworker/0:0 Tainted: G D O 3.10.17-poky-edison+ #1
[ 2509.833641] Hardware name: Intel Corporation Merrifield/BODEGA BAY, BIOS 542 2015.01.21:18.19.48
[ 2509.833712] Workqueue: events flush_to_ldisc
[ 2509.833755] f6c810b0 00000004 f6c97bfc c18d9eea f6c97c20 c126d689 c1adaaf8 00000001
[ 2509.833865] 00000001 00000004 f6c813b0 f6c8caa8 f6c810b0 f6c97c2c c18dcd1c f6c810b0
[ 2509.833973] f6c97c40 c125573e 00000000 f6c97c40 00000009 f6c97c90 c12452fd 00000009
[ 2509.834081] Call Trace:
[ 2509.834126] [<c18d9eea>] dump_stack+0x16/0x18
[ 2509.834179] [<c126d689>] __might_sleep+0xe9/0x110
[ 2509.834234] [<c18dcd1c>] down_read+0x1c/0x30
[ 2509.834288] [<c125573e>] exit_signals+0x1e/0x110
[ 2509.834341] [<c12452fd>] do_exit+0x8d/0x9d0
[ 2509.834393] [<c18d7f19>] ? printk+0x1c/0x1e
[ 2509.834443] [<c124413b>] ? kmsg_dump+0xcb/0xe0
[ 2509.834497] [<c18e060b>] oops_end+0x8b/0xd0
[ 2509.834548] [<c12293a4>] no_context+0x104/0x1e0
[ 2509.834602] [<c1229535>] __bad_area_nosemaphore+0xb5/0x140
[ 2509.834662] [<c127a30a>] ? enqueue_task_fair+0x146a/0x17d0
[ 2509.834720] [<c12746b5>] ? sched_clock_cpu+0x125/0x180
[ 2509.834776] [<c12295d7>] bad_area_nosemaphore+0x17/0x20
[ 2509.834834] [<c18e24c7>] __do_page_fault+0xa7/0x550
[ 2509.834890] [<c1222367>] ? default_send_IPI_mask_logical+0xa7/0xe0
[ 2509.834954] [<c12cc531>] ? tracing_is_on+0x11/0x30
[ 2509.835011] [<c12d6ba0>] ? probe_sched_wakeup+0x20/0xa0
[ 2509.835068] [<c127050b>] ? check_preempt_curr+0x4b/0x80
[ 2509.835125] [<c12d6b80>] ? tracing_sched_wakeup_trace+0xc0/0xc0
[ 2509.835187] [<c12713cf>] ? ttwu_do_wakeup+0x10f/0x140
[ 2509.835246] [<c18e2970>] ? __do_page_fault+0x550/0x550
[ 2509.835303] [<c18e297d>] do_page_fault+0xd/0x10
[ 2509.835356] [<c18dfe6b>] error_code+0x5f/0x64
[ 2509.835411] [<c18e2970>] ? __do_page_fault+0x550/0x550
[ 2509.835467] [<c132243c>] ? __kmalloc_track_caller+0x9c/0x200
[ 2509.835527] [<c1733437>] ? __alloc_skb+0x67/0x1a0
[ 2509.835581] [<c1732bb2>] __kmalloc_reserve.isra.33+0x22/0x70
[ 2509.835641] [<c1733437>] __alloc_skb+0x67/0x1a0
[ 2509.835693] [<c182fb81>] hci_reassembly+0x1a1/0x1f0
[ 2509.835749] [<c182fc8a>] hci_recv_stream_fragment+0x3a/0x70
[ 2509.835808] [<c1667e5f>] h4_recv+0x1f/0x50
[ 2509.835857] [<c1667483>] hci_uart_tty_receive+0x53/0x80
[ 2509.835913] [<c15379d0>] flush_to_ldisc+0xe0/0x130
[ 2509.835970] [<c125dbbe>] process_one_work+0xfe/0x410
[ 2509.836026] [<c1270ddb>] ? get_parent_ip+0xb/0x40
[ 2509.836079] [<c18e2b6d>] ? add_preempt_count+0x7d/0xf0
[ 2509.836132] [<c18e2c75>] ? sub_preempt_count+0x95/0xf0
[ 2509.836190] [<c125e29c>] worker_thread+0xfc/0x360
[ 2509.836243] [<c18df295>] ? _raw_spin_unlock_irqrestore+0x55/0x60
[ 2509.836305] [<c125e1a0>] ? rescuer_thread+0x2d0/0x2d0
[ 2509.836359] [<c1263570>] kthread+0xa0/0xb0
[ 2509.836408] [<c18e2c75>] ? sub_preempt_count+0x95/0xf0
[ 2509.836468] [<c18e4bf7>] ret_from_kernel_thread+0x1b/0x28
[ 2509.836524] [<c12634d0>] ? kthread_create_on_node+0xc0/0xc0
[ 2509.836577] note: kworker/0:0 exited with preempt_count 1
Then the Edison reboots, and now every time it starts up it has hundreds of the following message:
[ 11.941909] Media Audio Port: ASoC: no backend DAIs enabled for Media Audio Port
I've had a look at making the changes you've described in the link, but the files and directories do not exist on my edison? Is there anything I need to install in order to be able to then modify the files?
Unfortunately the only way to make these changes are to build the image. In case you interested in doing so, you can find instructions on how to do it in http://www.intel.com/content/www/us/en/support/boards-and-kits/000005616.html.
I downloaded the source package "edison-src-ww25.5-15.tgz" but had the following problems when running trhough the guide.
2.1 In the guide "sudo apt-get: command not found", I tried using opkg command but says cannot install package.
2.3 Tried to run the setup script but come back with the following:
root@pearl-edison:/edison/edison-src# ./meta-intel-edison/setup.sh --dl_dir=/edison/bitbake_download_dir/ --sstate_dir=/edison/bitbake_sstate_dir/
We are building in external mode
./meta-intel-edison/setup.sh: line 159: git: command not found
3.1 If I try using make then i get the following error:
root@pearl-edison:/edison/edison-src# make setup
Setup buildenv for SDK host linux64
./meta-intel-edison/setup.sh --dl_dir=/edison/edison-src/bbcache/downloads --sstate_dir=/edison/edison-src/bbcache/sstate-cache --build_dir=/edison/edison-src/out/linux64 --build_name=custom_build_root@20160722132051 --sdk_host=linux64
We are building in external mode
./meta-intel-edison/setup.sh: line 159: git: command not found
Makefile:25: recipe for target 'setup' failed
make: *** [setup] Error 127
I am just trying to initally setup a basic serial communication via bluetooth to another device but this seems to be not possible using the edison board.
I'm sorry you have experienced so many issues.
Nevertheless, I'm afraid there might have been a misunderstanding about the guide. It is supposed to be followed on a full Linux PC (running, for example, Ubuntu 14). Could you please try again to build the image a make the modifications above from a Linux PC?
Sorry Peter I don't currently have a Linux PC thats why I was attempting to follow the guide on the Edison itself. I'll contact my IT department about getting me Linux PC but my contact is out on holiday this week.
Is there any other way of doing this? I did have the communication working from the PC to the Edison using the SPP-loopback.py file but couldnt send anything back from the Edison to the PC?
The other problem I have with using an older version of the image is that I can no longer program the Edison from the Eclispe IDE as I get the follwing message:
"error while loading shared libraries: libmraa.so.1: cannot open shared object file: No such file or directory"
Do you know a solution for this also?
Unfortunately no, the image can only be built on a Linux host machine. I'm afraid you will need a Linux PC in order to proceed.
In one of your earlier posts you mention that you can connect your Edison to your PC through PuTTY but you can't see any of the messages you send. That is because you have to be reading the port in order to check the messages. In you case it would be rfcomm0. In the same way if you would like to send messages from your Edison to your PC you'll have to send the message through that port. You can do that with the commands cat and echo. That way you will be able to see the messages on both sides.
Regarding the issue with mraa, have you tried updating the repos on your board and installing the latest version?
Thanks Peter! I've managed to send messages back and forth now using the cat and echo commands. I've also got Eclipse up and running again by updating the mraa repo to the latest version on the Edison. Thanks again.
I'll try to get hold of a Linux PC in order to build the image to fix the problem when closing the Com terminal. In order to do this I downloaded the "edison-src-ww25.5-15.tgz" file, is this the appropriate version to build from? Would the process be to build the image using the guide you provided, flash the image to edison and then update the three files "drivers/tty/tty_io.c", "include/linux/tty.h" & "net/bluetooth/rfcomm/tty.c" to the updated versions?
That great to hear! I'm glad you are now able to read and send messages from and to your Edison/PC. I'm really glad to hear that Eclipse is working again now that you've updated the repo.
Yes, you are right, that is the source you have to use. However, the process would be a little different, you have to set up the environment, make the modifications to the "drivers/tty/tty_io.c" files, build the image and flash the board.
Let me know how it goes.
Thanks for your help Peter! I'll let you know how it goes once I get hold of a Linux PC.