<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Ble – Yeri Tiete</title>
    <link>https://yeri.be/tag/ble/</link>
    <description>Yeri Tiete&#39;s blog</description>
    <language>en</language>
    <copyright>© Yeri Tiete</copyright>
    <lastBuildDate>Tue, 01 Sep 2020 22:30:16 +0200</lastBuildDate>
    <atom:link href="https://yeri.be/tag/ble/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
      <title>Making Bluetooth work on RPi4</title>
      <link>https://yeri.be/making-bluetooth-work-on-rpi4/</link>
      <pubDate>Tue, 01 Sep 2020 22:30:16 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/making-bluetooth-work-on-rpi4/</guid><enclosure url="https://static.yeri.be/2020/09/Screenshot-2020-09-01-at-15.33.24.png" length="0" type="image/png" />
      <description>&lt;p&gt;I &lt;a href=&#34;https://www.benkuhn.net/wireless/&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34;&gt;rarely use&lt;/a&gt; Bluetooth on my RPis. I&#39;m already facing enough issues with my iMac and Mac Mini (it lags, it randomly disconnects in meetings, etc). &lt;/p&gt;&#xA;&lt;p&gt;My &lt;a href=&#34;http://pwnagotchi.ai/&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34;&gt;pwnagotchi&lt;/a&gt; on the other hand is counting on a BLE network to connect to the internet: for now I am using my iPad, and while that works, it causes my iPad to disconnect from WiFi (because of course, it can only do tethering from a mobile network, not from its WiFi network). &lt;/p&gt;</description>
      <content:encoded><![CDATA[<p><img src="https://static.yeri.be/2020/09/Screenshot-2020-09-01-at-15.33.24.png" alt="Making Bluetooth work on RPi4"></p><p>I <a href="https://www.benkuhn.net/wireless/" target="_blank" rel="noreferrer noopener">rarely use</a> Bluetooth on my RPis. I'm already facing enough issues with my iMac and Mac Mini (it lags, it randomly disconnects in meetings, etc). </p>
<p>My <a href="http://pwnagotchi.ai/" target="_blank" rel="noreferrer noopener">pwnagotchi</a> on the other hand is counting on a BLE network to connect to the internet: for now I am using my iPad, and while that works, it causes my iPad to disconnect from WiFi (because of course, it can only do tethering from a mobile network, not from its WiFi network). </p>
<p>I wanted to explore if I could set up bluetooth tethering/internet sharing from my RPi4 server... But for that BLE had to work! And for some reason BLE was not working on <a href="https://yeri.be/raspberry-pi-4-ssd" target="_blank" rel="noreferrer noopener">Liana</a>.</p>
<pre class="wp-block-code"><code>&#91;bluetooth]# power on
No default controller available</code></pre>
<p>For some reason no controller was available. The drivers were definitely installed... </p>
<pre class="wp-block-code"><code>apt install bluetooth pi-bluetooth bluez raspberrypi-sys-mods</code></pre>
<p>but <code>hcitool dev ; hciconfig -a</code> weren't returning anything.  </p>
<p>After quite some extensive Googling I found <a href="https://raspberrypi.stackexchange.com/questions/72419/raspberry-pi-3-bluetooth-no-controller/85158#85158" target="_blank" rel="noreferrer noopener">the solution</a>... </p>
<p>Check if this returns something:</p>
<pre class="wp-block-code"><code># ls -l /dev | grep ttyAMA0
lrwxrwxrwx 1 root root           7 Sep  1 15:08 serial1 -> ttyAMA0
crw-rw---- 1 root dialout 204,  64 Sep  1 15:08 ttyAMA0</code></pre>
<p>As opposed to:</p>
<pre class="wp-block-code"><code># ls -l /dev | grep ttyS0
# (no output)</code></pre>
<p>Then continue to do the following:</p>
<pre class="wp-block-code"><code># make a backup
cp /boot/cmdline.txt /boot/cmdline.txt.bak
# edit the file
nano -w /boot/cmdline.txt
# edit the first part from
# console=ttySerial0 to console=ttyAMA0
# the line should be something similar to but do NOT blindly copy paste it as you won't be able to boot due to your PARTUUID being different
console=ttyAMA0,115200 console=tty1 root=PARTUUID=6c586e13-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
reboot</code></pre>
<p>After rebooting ... it works!</p>
<pre class="wp-block-code"><code>liana ~ # hcitool dev ; hciconfig -a
Devices:
	hci0	DC:A6:32:B1:0E:79
hci0:	Type: Primary  Bus: UART
	BD Address: DC:A6:32:B1:0E:79  ACL MTU: 1021:8  SCO MTU: 64:1
	UP RUNNING 
	RX bytes:2397 acl:0 sco:0 events:118 errors:0
	TX bytes:2603 acl:0 sco:0 commands:99 errors:0
	Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
	Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
	Link policy: RSWITCH SNIFF 
	Link mode: SLAVE ACCEPT 
	Name: 'liana'
	Class: 0x000000
	Service Classes: Unspecified
	Device Class: Miscellaneous, 
	HCI Version: 5.0 (0x9)  Revision: 0x13b
	LMP Version: 5.0 (0x9)  Subversion: 0x6119
	Manufacturer: Cypress Semiconductor Corporation (305)

liana ~ # bluetoothctl 
Agent registered
&#91;bluetooth]# scan on
Discovery started
&#91;CHG] Controller DC:A6:32:B1:0E:79 Discovering: yes
&#91;NEW] Device 7F:A9:BC:8D:E4:14 7F-A9-BC-8D-E4-14
&#91;NEW] Device 58:EB:19:D8:D4:23 58-EB-19-D8-D4-23
&#91;NEW] Device A4:83:E7:42:79:F6 A4-83-E7-42-79-F6
&#91;NEW] Device 58:7B:24:1B:CC:5C 58-7B-24-1B-CC-5C
&#91;NEW] Device D9:05:9F:DB:55:19 N0163
&#91;NEW] Device 5F:DA:90:34:82:68 5F-DA-90-34-82-68
&#91;NEW] Device 77:2A:1B:11:54:7D 77-2A-1B-11-54-7D
&#91;NEW] Device 42:BF:0B:38:F3:20 42-BF-0B-38-F3-20</code></pre>
<p>Next step is trying to get tethering to work... </p>
]]></content:encoded>
      <category>hardware</category><category>linux</category><category>software</category>
      <category>ble</category><category>raspberrypi</category>
    </item>
    
  </channel>
</rss>
