<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[My memory is Volatile]]></title><description><![CDATA[This is a place where I'll be making tutorials for future-me on archlinux-related installs and fixes so I don't have to figure stuff out againe every few months]]></description><link>https://blog.gravityfargo.dev</link><generator>RSS for Node</generator><lastBuildDate>Tue, 14 Apr 2026 16:05:07 GMT</lastBuildDate><atom:link href="https://blog.gravityfargo.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Wazuh Dashboard + Nginx Proxy Manager]]></title><description><![CDATA[Server Wazuh Dashboard via docker behind NGINX Proxy Manager
Set up a docker network. Change the subnet to whatever you want.
docker network create \
    --driver=bridge \
    --subnet=10.0.1.0/24 \
    --gateway=10.0.1.1 \
    wazuh_npm

Clone and e...]]></description><link>https://blog.gravityfargo.dev/wazuh-dashboard-nginx-proxy-manager</link><guid isPermaLink="true">https://blog.gravityfargo.dev/wazuh-dashboard-nginx-proxy-manager</guid><category><![CDATA[nginx proxy manager]]></category><category><![CDATA[Wazuh Dashboard]]></category><category><![CDATA[wazuh]]></category><category><![CDATA[nginx]]></category><category><![CDATA[Docker]]></category><category><![CDATA[Docker compose]]></category><dc:creator><![CDATA[Nathan Price]]></dc:creator><pubDate>Wed, 24 Jul 2024 17:57:52 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1721843803326/ea412f9a-f338-451f-b243-d9577fd97d0d.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Server Wazuh Dashboard via docker behind NGINX Proxy Manager</p>
<p>Set up a docker network. Change the subnet to whatever you want.</p>
<pre><code class="lang-bash">docker network create \
    --driver=bridge \
    --subnet=10.0.1.0/24 \
    --gateway=10.0.1.1 \
    wazuh_npm
</code></pre>
<p>Clone and enter the Wazuh repo.</p>
<pre><code class="lang-bash">git <span class="hljs-built_in">clone</span> https://github.com/wazuh/wazuh-docker.git -b v4.8.1 &amp;&amp; \
<span class="hljs-built_in">cd</span> wazuh-docker/single-node
</code></pre>
<p>Generate the Certificates</p>
<pre><code class="lang-bash">docker-compose -f generate-indexer-certs.yml run --rm generator
</code></pre>
<p>Now in, the docker-compose file, add static IPs to each container. I like setting a container name as well.</p>
<pre><code class="lang-yaml"><span class="hljs-comment"># single-node/docker-compose.yml</span>
<span class="hljs-attr">services:</span>
    <span class="hljs-attr">wazuh.manager:</span>
        <span class="hljs-attr">image:</span> <span class="hljs-string">wazuh/wazuh-manager:4.8.1</span>
        <span class="hljs-attr">hostname:</span> <span class="hljs-string">wazuh.manager</span>
        <span class="hljs-attr">container_name:</span> <span class="hljs-string">wazuh-manager</span>
        <span class="hljs-attr">networks:</span>
            <span class="hljs-attr">wazuh_npm:</span>
                <span class="hljs-attr">ipv4_address:</span> <span class="hljs-number">10.0</span><span class="hljs-number">.1</span><span class="hljs-number">.30</span>
        <span class="hljs-string">.</span> <span class="hljs-string">.</span> <span class="hljs-string">.</span>
    <span class="hljs-attr">wazuh.indexer:</span>
        <span class="hljs-attr">image:</span> <span class="hljs-string">wazuh/wazuh-indexer:4.8.1</span>
        <span class="hljs-attr">container_name:</span> <span class="hljs-string">wazuh-indexer</span>
        <span class="hljs-attr">hostname:</span> <span class="hljs-string">wazuh.indexer</span>
        <span class="hljs-attr">networks:</span>
            <span class="hljs-attr">wazuh_npm:</span>
                <span class="hljs-attr">ipv4_address:</span> <span class="hljs-number">10.0</span><span class="hljs-number">.1</span><span class="hljs-number">.31</span>
        <span class="hljs-string">.</span> <span class="hljs-string">.</span> <span class="hljs-string">.</span>
    <span class="hljs-attr">wazuh.dashboard:</span>
        <span class="hljs-attr">image:</span> <span class="hljs-string">wazuh/wazuh-dashboard:4.8.1</span>
        <span class="hljs-attr">container_name:</span> <span class="hljs-string">wazuh-dashboard</span>
        <span class="hljs-attr">hostname:</span> <span class="hljs-string">wazuh.dashboard</span>
        <span class="hljs-attr">networks:</span>
            <span class="hljs-attr">wazuh_npm:</span>
                <span class="hljs-attr">ipv4_address:</span> <span class="hljs-number">10.0</span><span class="hljs-number">.1</span><span class="hljs-number">.32</span>
        <span class="hljs-string">.</span> <span class="hljs-string">.</span> <span class="hljs-string">.</span>
    <span class="hljs-attr">app:</span>
      <span class="hljs-attr">image:</span> <span class="hljs-string">jc21/nginx-proxy-manager:latest</span>
      <span class="hljs-attr">networks:</span>
          <span class="hljs-attr">wazuh_npm:</span>
              <span class="hljs-attr">ipv4_address:</span> <span class="hljs-number">10.0</span><span class="hljs-number">.1</span><span class="hljs-number">.20</span>
<span class="hljs-attr">networks:</span>
    <span class="hljs-attr">wazuh_npm:</span>
        <span class="hljs-attr">name:</span> <span class="hljs-string">wazuh_npm</span>
        <span class="hljs-attr">external:</span> <span class="hljs-literal">true</span>
</code></pre>
<p>Whatever IP you assign the Wazuh Dashboard needs to be put into <code>single-node/config/wazuh_dashboard/opensearch_dashboards.yml</code></p>
<pre><code class="lang-yaml"><span class="hljs-comment"># single-node/config/wazuh_dashboard/opensearch_dashboards.yml</span>
<span class="hljs-attr">server.host:</span> <span class="hljs-number">10.0</span><span class="hljs-number">.1</span><span class="hljs-number">.32</span>
<span class="hljs-attr">server.port:</span> <span class="hljs-number">5601</span>
<span class="hljs-string">.</span> <span class="hljs-string">.</span> <span class="hljs-string">.</span>
</code></pre>
<p>Grab the certificate files generated for the dashboard and the root ca. You'll need to change the permissions to copy them first.</p>
<pre><code class="lang-yaml"><span class="hljs-string">config/wazuh_indexer_ssl_certs/wazuh.dashboard.pem</span>
<span class="hljs-string">config/wazuh_indexer_ssl_certs/wazuh.dashboard-key.pem</span>
<span class="hljs-string">config/wazuh_indexer_ssl_certs/root-ca.pem</span>
</code></pre>
<p>Start the containers.</p>
<pre><code class="lang-yaml"><span class="hljs-string">docker-compose</span> <span class="hljs-string">up</span> <span class="hljs-string">-d</span>
</code></pre>
<p>Go to the NPM web interface, import the SSL certificates, and create a proxy host.</p>
<p>IP: <a target="_blank" href="http://10.0.1.32:5601">http://10.0.1.32:5601</a><br />Enable websockets support.</p>
<p>Should be good.</p>
]]></content:encoded></item><item><title><![CDATA[Flash Tasmota firmware on the WiFi version of the Sonoff Zigbee Bridge Pro]]></title><description><![CDATA[This is a tutorial on how to flash Tasmota firmware on the WiFi version of the Sonoff Zigbee Bridge Pro.
Use this tutorial at your own risk. It's not my fault if you brick your device.
Notable Identifiers on the boardSN-NG-ZBP-01WW220300ZB Bridge-P
F...]]></description><link>https://blog.gravityfargo.dev/flash-tasmota-firmware-on-the-wifi-version-of-the-sonoff-zigbee-bridge-pro</link><guid isPermaLink="true">https://blog.gravityfargo.dev/flash-tasmota-firmware-on-the-wifi-version-of-the-sonoff-zigbee-bridge-pro</guid><category><![CDATA[SN-NG-ZBP-01]]></category><category><![CDATA[ZB Bridge-P]]></category><category><![CDATA[Sonoff Zigbee Bridge Pro]]></category><category><![CDATA[tasmota]]></category><dc:creator><![CDATA[Nathan Price]]></dc:creator><pubDate>Tue, 16 Jan 2024 16:06:33 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1705421189677/37cc3e86-4771-4fbe-afde-2c4ec5c95653.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This is a tutorial on how to flash Tasmota firmware on the WiFi version of the <strong>Sonoff Zigbee Bridge Pro.</strong></p>
<p>Use this tutorial at your own risk. It's not my fault if you brick your device.</p>
<p><strong>Notable Identifiers on the board</strong><br />SN-NG-ZBP-01<br />WW220300<br />ZB Bridge-P</p>
<p>Front of board. A 5 pin header has been soldered on.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705418710849/0c4bf1ff-259e-4a80-8e78-33e1af0a1a26.jpeg" alt class="image--center mx-auto" /></p>
<p>Back of board. I did some probing on the other pads just for fun, so ignore their ugliness.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705418716991/2e67dbe0-ee98-4c18-b059-233cd43d90a8.jpeg" alt class="image--center mx-auto" /></p>
<p><strong>Note</strong>: The USB port on the bridge will no longer work for data after this flash.</p>
<p>Hold down the button on the Arduino, plug it in, then release the button to wipe the Arduino. Unplug it before connecting it to the bridge, of course.</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Arduino Nano</td><td>ZPro</td></tr>
</thead>
<tbody>
<tr>
<td>3.3V</td><td>3.3V</td></tr>
<tr>
<td>RX</td><td>RX</td></tr>
<tr>
<td>TX</td><td>TX</td></tr>
<tr>
<td>GND</td><td>GND</td></tr>
<tr>
<td>GND</td><td>GPIO00</td></tr>
</tbody>
</table>
</div><p>Add a udev rule to allow user access to the port. Or run everything with sudo if you're feeling frisky.</p>
<p><code>sudo /etc/udev/rules.d/01-ttyusb.rules</code></p>
<pre><code class="lang-plaintext">SUBSYSTEMS=="usb-serial", TAG+="uaccess"
</code></pre>
<p>Reboot or reload udev rules</p>
<p><code>sudo udevadm control --reload</code></p>
<p><code>sudo udevadm trigger</code></p>
<p>Connect the nano via USB. Make sure the mini-USB cable you use is capable of data transfer. Try the example blink sketch to make sure.</p>
<p>use <code>dmesg</code> to make sure the OS sees and attaches the Arduino</p>
<p><code>sudo dmesg -w</code></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705191746081/e2c73f1e-6a74-447c-9387-b49b6c22a790.png" alt class="image--center mx-auto" /></p>
<p>Note the attached port <code>ttyUSB0</code>. You'll need that in the next step.</p>
<p>Go to the <a target="_blank" href="https://tasmota.github.io/install/">Tasmota Web Flash Tool</a>. I used Chrome. Select this firmware.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705190491339/d5d99f11-ec5d-4539-b4cd-3d9307249b9c.png" alt class="image--center mx-auto" /></p>
<p>Click connect, and choose the USB device you saw in dmesg.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705191913821/50ef64bb-b2e4-4b86-b66c-c68d255796d2.png" alt class="image--center mx-auto" /></p>
<p>If the Arduino is properly connected, it will start the flash.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705190571164/964dfc59-c9af-4629-b30c-e04e44adf318.png" alt class="image--center mx-auto" /></p>
<p>Once it's done, close the page and disconnect everything.</p>
<p>Connect a micro-USB to the bridge, wait for the lights to flash, and search for a WiFi access point.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705192392619/e6353337-6cc5-4c26-acd2-66b55b0ee0bc.jpeg" alt class="image--center mx-auto" /></p>
<p>go to 192.168.4.1 in your browser. Choose your WiFi network and log in.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705192529619/c3bac11a-8f89-4e2d-adef-dc20906fd8c9.jpeg" alt class="image--center mx-auto" /></p>
<p>After it connects, I'll give you the address assigned by your router.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705192554393/0687747f-08fa-49d7-920a-79048220ddcf.jpeg" alt class="image--center mx-auto" /></p>
<p>Reconnect to your regular WiFi network. In the web interface go to "Configuration" &gt; "Auto-configuration" and select "Sonoff ZBPro TCP" and apply it. The config without "TCP" means the bridge will manage it's own zigbee connections. We'd rather HomeAssistant do that.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705195531945/24bd1ac1-a924-4aed-840d-9ffd3ff7c80f.png" alt class="image--center mx-auto" /></p>
<p>After the reboot, go to "Consoles" &gt; "Console" and look for</p>
<p><code>Starting TCP server on port 8888</code></p>
<p>Now switch over to Home Assistant.</p>
<p>Go to integrations and click "Add Integration". Search for Zigbee.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705197082886/65ec48ac-c5e6-498e-9159-78493314e3bc.png" alt class="image--center mx-auto" /></p>
<p>Make sure you use "Zigbee Home Automation" and not "Add a Zigbee Device"</p>
<p>Click Proceed</p>
<p>Select "Enter Manually" then Submit</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705193501499/5d450e46-5452-4803-8080-d4505227989d.png" alt class="image--center mx-auto" /></p>
<p>Select Radio Type "ZNP".</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705197187996/bd653695-636c-4028-912e-d3fd003a00de.png" alt class="image--center mx-auto" /></p>
<p>for Serial Port Settings, type in socket://10.10.10.153:8888 using whatever IP was assigned. Leave the Port speed, and select "software".</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705197219302/9b6bf110-4c55-4d0c-9e9d-ffa4b16a680a.png" alt class="image--center mx-auto" /></p>
<p>Select "Create a network"</p>
<p>Now, after a few minutes, a "Success" modal will appear along with all unpaired Zigbee devices HA has found. Do not add anything other than "Zigbee Coordinator" at this time.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705197479193/c5319926-78b2-47d8-8aa0-635c36a042eb.png" alt class="image--center mx-auto" /></p>
<p>In HA go to Settings &gt;Devices and services &gt; Zigbee Home Automation<br />click "0 devices"</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705419697385/8f29a364-351b-41c8-b1c5-3c5a7cfed20d.png" alt class="image--center mx-auto" /></p>
<p>Then "ADD DEVICE" at the bottom right. Follow the prompts.</p>
<p>And we're done.</p>
]]></content:encoded></item><item><title><![CDATA[Manjaro (Archlinux) PGP Error Fix]]></title><description><![CDATA[error: android-udev: signature from "Anatol Pomozov (Arch Linux developer account) <anatolik@archlinux.org>" is unknown trust
:: File /var/cache/pacman/pkg/android-udev-20231104-1-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signat...]]></description><link>https://blog.gravityfargo.dev/manjaro-archlinux-pgp-error-fix</link><guid isPermaLink="true">https://blog.gravityfargo.dev/manjaro-archlinux-pgp-error-fix</guid><category><![CDATA[unknown trust]]></category><category><![CDATA[ArchLinux]]></category><category><![CDATA[Manjaro]]></category><category><![CDATA[PGP]]></category><dc:creator><![CDATA[Nathan Price]]></dc:creator><pubDate>Tue, 21 Nov 2023 07:15:19 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1700550843621/5d4c1992-3ddd-4553-bf93-c65b7abb36d1.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<pre><code class="lang-bash">error: android-udev: signature from <span class="hljs-string">"Anatol Pomozov (Arch Linux developer account) &lt;anatolik@archlinux.org&gt;"</span> is unknown trust
:: File /var/cache/pacman/pkg/android-udev-20231104-1-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] y
error: failed to commit transaction (invalid or corrupted package (PGP signature))
Errors occurred, no packages were upgraded.
 -&gt; error installing repo packages
</code></pre>
<p>fix:</p>
<pre><code class="lang-bash">sudo rm -rfv /etc/pacman.d/gnupg
</code></pre>
<pre><code class="lang-bash">sudo pacman-key --init
</code></pre>
<pre><code class="lang-bash">sudo pacman-key --populate archlinux
</code></pre>
<pre><code class="lang-bash">sudo pacman-key --populate manjaro
</code></pre>
<pre><code class="lang-bash">sudo pacman -Sy gnupg archlinux-keyring manjaro-keyring
</code></pre>
<pre><code class="lang-bash">sudo pacman -Syyu
</code></pre>
]]></content:encoded></item><item><title><![CDATA[Sync Google Chrome Tab Groups Across Devices]]></title><description><![CDATA[Go to chrome://flags/
Search for Tab Groups Save and Sync

Change to Enabled
Restart Chrome
Create a new Tab Group

Right-click the group name and select Save Group

The group will now save to the Bookmarks Toolbar

Follow the same process on all oth...]]></description><link>https://blog.gravityfargo.dev/sync-google-chrome-tab-groups-across-devices</link><guid isPermaLink="true">https://blog.gravityfargo.dev/sync-google-chrome-tab-groups-across-devices</guid><category><![CDATA[Google Chrome]]></category><category><![CDATA[tabs]]></category><category><![CDATA[sync]]></category><dc:creator><![CDATA[Nathan Price]]></dc:creator><pubDate>Sun, 05 Nov 2023 20:09:53 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/s5kTY-Ve1c0/upload/41ad16a60a99dd98f267eaf8d59e38f8.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Go to chrome://flags/</p>
<p>Search for <code>Tab Groups Save and Sync</code></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1699214319615/c45b29a6-4295-4ef2-a8d0-9c8bd8932c4b.png" alt class="image--center mx-auto" /></p>
<p>Change to <code>Enabled</code></p>
<p>Restart Chrome</p>
<p>Create a new Tab Group</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1699214431858/82b0f6b0-25f7-4216-a832-074d677c7ff9.png" alt class="image--center mx-auto" /></p>
<p>Right-click the group name and select <code>Save Group</code></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1699214462503/13903d81-f9e7-458c-97c8-14c69db6bea8.png" alt class="image--center mx-auto" /></p>
<p>The group will now save to the Bookmarks Toolbar</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1699214536554/68b17137-02d8-40ef-aafb-241fbc852bb6.png" alt class="image--center mx-auto" /></p>
<p>Follow the same process on all other computers, and now the group will stay synced on those devices, and persist across sessions.</p>
<p>When you open new tabs and have Chrome open on more than one device with this setup, the tab will also open on the other devices.</p>
<p>Keep in mind, that the process can be slow, and for me takes about 45 seconds for this to update across devices.</p>
<p>Doesn't work on Android chrome it seems. Bookmarking <code>chrome://history/syncedTabs</code> is a good shortcut I've found to have front and center for mobile.</p>
<p>Enjoy!</p>
]]></content:encoded></item><item><title><![CDATA[Flash Tasmota firmware to a Sonoff S31 Smart Monitoring Outlet using an Arduino Nano]]></title><description><![CDATA[DO NOT CONNECT THE SWITCH TO AC POWER AT ANY POINT THE CASE IS OPEN.

Bridge the Nano's GND and Reset pins.

The TX/RX pins don't need to be swapped.





NanoS31



3.3VVCC

RXRX

TXTX

GNDGND


Hold the button on the side, plug it into the computer...]]></description><link>https://blog.gravityfargo.dev/flash-tasmota-firmware-to-a-sonoff-s31-smart-monitoring-outlet-using-an-arduino-nano</link><guid isPermaLink="true">https://blog.gravityfargo.dev/flash-tasmota-firmware-to-a-sonoff-s31-smart-monitoring-outlet-using-an-arduino-nano</guid><category><![CDATA[firmware]]></category><category><![CDATA[Home Assistant]]></category><category><![CDATA[tasmota]]></category><category><![CDATA[Sonoff]]></category><category><![CDATA[S31]]></category><dc:creator><![CDATA[Nathan Price]]></dc:creator><pubDate>Sun, 10 Sep 2023 22:51:07 GMT</pubDate><content:encoded><![CDATA[<p><img src="https://lh3.googleusercontent.com/pw/AIL4fc-KsGCfOKScCQbihosNs9S0nZuXg5WSI19REFemq3eC2uRjERE6juEchFzD1GP7kEOT7WCPqn6goJzYFP3f6IWs-WTxq7Y_EMmgvKC0kmEsphoxqx1ywAsSlyNRs-QwTUdvYFuBU4LKrufVNB_kAFSHeaWgf0Ww0nqO7aitqUIE7T6Q3thOGc3hUuMuLypyCvIoHcVnd6uqzO-UoFl500fdIwd-u5bw5lGq6BXdxHvHTim4FDVE9zwM6JgWtj0h4j3EG-ckGNxeyh9Hd6mJx9HuiehWrFtwhjzgpxlciE7DlmfmDXdDs63m6MsPpB34TQCR6BAKjPOYVUYpczL3bpZfFm07qbMrfHVE8_5hlbfPGBqpC_Apcf1OcRtG9ABItY_X0zzHjG6G3r6pHZ2N8dsKtu4pZWZfFqseXtIC0C88s9LvYzDVdXaVFnRw2iYaNtxvwC3EYVNRI1gY7awTlqZOJ-dfbmcEx83XoZPKAkYvNOO7HcOrU3aF9DaayDnjN2OPJPpls3R8OBekkdeFRfCqb_Tl2TLghfJ9MqgX4DChbmg6TgoW76d4wK2DepASLGI_9N69S8fD9QfzhaunEh0KZQM7gYfwmkKhIE9clqXMZDr3MhtLSiV4AmFJOfiJAhaanCE2sdDwHBeZ5XDhncRYkyXvC1VIgIVuS8bUATwlxKmGHL_NCwbkFO3AsPytZzXh7yT75cK3AekfVh-nU-iSh29yPaHOpOyaC2RqBRcGS2MfZELX70Ip9gkH_dhonILgwShntbpmW5lM6-vra6jAlsPq0xDTvUnOofN00KfprlxF2pIKhuzzuPod4rsPUvUZw4qNUMmHBb55P3wwwV_-VOtDMewQrML10ZpuCtEk_JWiWt1ic-D298CqW7YGzhQ6zZliEe_5X8Goq0jMjrWZpnUftU0qzzSZ-CsyX6ItXfgs-gANn_XU3XtWWMHmjR2KVfWBCJWcjouHMuDXJxlLZFS7qQ=w1656-h1242-s-no?authuser=0" alt /></p>
<h1 id="heading-do-not-connect-the-switch-to-ac-power-at-any-point-the-case-is-open">DO NOT CONNECT THE SWITCH TO AC POWER AT ANY POINT THE CASE IS OPEN.</h1>
<p><img src="https://lh3.googleusercontent.com/pw/AIL4fc9g1sSz1XK1q4SJ3dDX_z48cTmg7s0772oTxxTvVdp1bPnvCypGMlcMxNfNL7kmeXZF6gLXp5K9HDLhYudwMh5pU_ZFf_WuHJp2Ga8h0hMxG247TZ2DaYzZG-xT4e_wq7jjINVYlIVKOcImSZ2_DRJuskw2ZiM778vSUHOKWDrlGeUaKokLRhqy8j4TMEwqTyAsTCtdsVuMAXmvf6VajRblNDMBBB1sgUi4HzI74IONRd8W7G86r1U7zCmzOv6vOCPjG-4I-6-TDxzEkaVPrjnfvyIdHBIiQUTIJr6CzlVWmocTqkTlgzA7miR4r2q_h5bODwKHHXPEAGHa3bXyBfHMtB4HfdYloV4swhfJhJcQXsrV26ujySbbxG_qP75xpsx3Yr_Z8SuH-kiHPDoc_Ks4GY_BUQBYS45smkSB6FZclJhq368SGe1BTLgrh_SewTLuvCpsuvv9A-oBYE7D2tMSlQWp1og5jWN3td5M7LZo61eJS6DG_LLjeRIM81hu32TWIdFmtdq2CRfB1jvmFWImMzSsIdjcGPGcGW7XDNsEek26JiqT3anBOO6CEZjAkm7aojClyTbnlHvxM7xdtYc-LkcpvgVyjnkVWMQWVaUtdzOKqpaBzHHryyDD9ONK4KqBEIzSoX7M3enLEfGTZ2r1BoXc1fBkK7k1YS_mcx1rPfCpS1yodXAC_4OF9nNncdvvJHc-tkqQIqpjxzqqfoUDW1h9TMK9PIKCaR1L42LpxFeuZiNbquw8VGv1mAZc36O_Qe7U7Ia2azvQqEgIUO39aVyHlPfJwdOvLHSSwma87xjsSBjM4nOxq0AFAk6XBEhpqH7TZSC9Owl_7QDH7KryzwHHyrx4jZGs868P8QdE2FZEEO3qfpgjdlJhCb9wKtkB9v8Ym2xhRGmAaYmX5ELeo9TUydPSRADaE_Su2KGHPTW7w0HLBOzhiwAOnzcEevjIhxiY3ZsD2ZU0dagVCD-sc-Rzyg=w932-h1242-s-no?authuser=0" alt /></p>
<p>Bridge the Nano's GND and Reset pins.</p>
<blockquote>
<p>The TX/RX pins don't need to be swapped.</p>
</blockquote>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Nano</td><td>S31</td></tr>
</thead>
<tbody>
<tr>
<td>3.3V</td><td>VCC</td></tr>
<tr>
<td>RX</td><td>RX</td></tr>
<tr>
<td>TX</td><td>TX</td></tr>
<tr>
<td>GND</td><td>GND</td></tr>
</tbody>
</table>
</div><p>Hold the button on the side, plug it into the computer, release the button after 5 seconds</p>
<pre><code class="lang-bash">sudo dmesg -w
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1694383560336/2d72eee9-7b4d-4db9-8a23-c20acfeaacd7.png" alt class="image--center mx-auto" /></p>
<p>/dev/<strong>ttyUSB0</strong></p>
<p>Install the pyserial python module. Pip for most people, an AUR for Arch.</p>
<pre><code class="lang-bash">sudo pacman -S python-pyserial
</code></pre>
<p>Download the esptool to do the flashing</p>
<pre><code class="lang-bash"><span class="hljs-built_in">cd</span> ~/Downloads &amp;&amp; git <span class="hljs-built_in">clone</span> https://github.com/espressif/esptool.git esp &amp;&amp; <span class="hljs-built_in">cd</span> esp
</code></pre>
<p>Download the tasmota firmware</p>
<pre><code class="lang-bash">wget http://ota.tasmota.com/tasmota/release/tasmota.bin
</code></pre>
<p>Check if your computer can talk to the ESP</p>
<pre><code class="lang-bash">sudo python3 esptool.py --port /dev/ttyUSB0 -c esp8266 flash_id
</code></pre>
<p>Anything other than this output means your wiring is wrong, or you didn't put it into programming mode (the button holding part)</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1694383636637/517cfb69-87a9-4d4a-98c4-46358839cd5a.png" alt class="image--center mx-auto" /></p>
<p>Actually write the firmware.</p>
<pre><code class="lang-bash">sudo python3 esptool.py --port /dev/ttyUSB0 -c esp8266 write_flash 0x0  ~/Downloads/esp/tasmota.bin
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1694383721930/82db4a92-0c37-484a-9f54-115e4302692b.png" alt class="image--center mx-auto" /></p>
<p>After it's done, connect to the new tasmota wifi network and go to this address.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1694384049712/3895bd2a-38fc-4a76-b259-13827d9294f2.png" alt class="image--center mx-auto" /></p>
<p>https://192.168.4.1/</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1694384783830/9a3e2060-0928-4e18-8e3f-4c089f5afadd.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1694384794548/306099b2-ed45-402a-a7c4-36c3e302d0f5.png" alt class="image--center mx-auto" /></p>
<ul>
<li><p>Go to your router and set a DHCP reservation.</p>
</li>
<li><p>Go to <strong><em>Configuration -&gt; Configure Module -&gt; Module type</em></strong></p>
<ul>
<li>Change the module to "Sonoff S31 (41)"</li>
</ul>
</li>
<li><p>Go to <strong><em>Configuration -&gt; Configure Other</em></strong></p>
<ul>
<li><p>Change the <strong>Device Name</strong> and <strong>Friendly Name 1</strong> to something else</p>
</li>
<li><p>"Sonoff-S31-A"</p>
</li>
</ul>
</li>
<li><p>Go to <strong><em>Configuration -&gt; Configure MQTT</em></strong></p>
<ul>
<li>Input the settings that match your broker options in home assistant</li>
</ul>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1694385384619/90633c51-68d1-4189-86ce-ba288ee4c35f.png" alt class="image--center mx-auto" /></p>
<p>Optional:</p>
<ul>
<li><p>Login to your Home Assistant server and go to <strong>Settings</strong> &gt; <strong>Add-Ons</strong> and click the <strong>Add-on Store</strong> button.</p>
</li>
<li><p>Search for “TasmoAdmin” in the search and then click on the “TasmoAdmin” add-on in search results.</p>
</li>
<li><p>In the add-on configuration disable SSL or it wont start.</p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Hacking Xbox controller]]></title><description><![CDATA[Chips to remove:
U4 - TCA6416RTWR - (the only large ic on the power board)
This chip handles IO Expansion for all the buttons.
Test points to tap:
// ON THE POWER BOARD
13 - 5v from the USB
19 - LB
20 - RB
21 - A
22 - X
23 - Y
28 - LED through Q3
39 ...]]></description><link>https://blog.gravityfargo.dev/hacking-xbox-controller</link><guid isPermaLink="true">https://blog.gravityfargo.dev/hacking-xbox-controller</guid><dc:creator><![CDATA[Nathan Price]]></dc:creator><pubDate>Sun, 09 Apr 2023 17:08:49 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1681060123325/f4fb5156-755d-4c05-a176-ccf766e49fb1.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-chips-to-remove">Chips to remove:</h3>
<p>U4 - <a target="_blank" href="https://www.ti.com/lit/ds/symlink/tca6416a.pdf?ts=1680939460357&amp;ref_url=https%253A%252F%252Fwww.google.com%252F">TCA6416RTWR</a> - (the only large ic on the power board)</p>
<p>This chip handles IO Expansion for all the buttons.</p>
<h3 id="heading-test-points-to-tap">Test points to tap:</h3>
<pre><code class="lang-bash">// ON THE POWER BOARD
13 - 5v from the USB
19 - LB
20 - RB
21 - A
22 - X
23 - Y
28 - LED through Q3
39 - Share

// ON THE MCU BOARD
63 - LStick Y
65 - RStick Y
67 - RTrigger
68 - LTrigger
112 - RStick X
DT - Left Sick X
</code></pre>
<p>Right Stick Points</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680979358724/2c106872-84ef-43e2-8c98-5eae11d693cb.png" alt class="image--center mx-auto" /></p>
<p>Left Stick Points - Direct Tap</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680979324322/5d155e26-b3b3-4643-ba1d-3cc7b36de8df.png" alt class="image--center mx-auto" /></p>
<p>Power Board</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680979615397/649a216b-8f59-4cf4-bc04-cc3c2ba4fd09.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-test-points-to-pull-high">Test points to pull high</h3>
<p><code>TP113</code> Enables TRG+ for the left and right trigger via <a target="_blank" href="https://www.ti.com/lit/ds/symlink/tlv707p.pdf?HQS=dis-mous-null-mousermode-dsf-pf-null-wwe&amp;ts=1680973258625&amp;ref_url=https%253A%252F%252Fwww.mouser.com%252F">TLV707</a></p>
<p><code>TP36</code> Enables the 1.8v Rail needed for the analog sticks va <a target="_blank" href="https://www.monolithicpower.com/en/documentview/productdocument/index/version/2/document_type/Datasheet/lang/en/sku/MP1476L/document_id/3728/">MP1476L</a></p>
]]></content:encoded></item><item><title><![CDATA[Arch, QEMU, and Virt-Manager]]></title><description><![CDATA[sudo pacman -Syu

sudo pacman -S qemu virt-manager virt-viewer dnsmasq vde2 bridge-utils openbsd-netcat libguestfs

I chose these providers for qemu and virtiofsd

yay virt-bootstrap

sudo systemctl enable libvirtd

sudo systemctl start libvirtd

sud...]]></description><link>https://blog.gravityfargo.dev/arch-qemu-and-virt-manager</link><guid isPermaLink="true">https://blog.gravityfargo.dev/arch-qemu-and-virt-manager</guid><category><![CDATA[QEMU]]></category><category><![CDATA[ArchLinux]]></category><category><![CDATA[Virtual Machine Manager]]></category><dc:creator><![CDATA[Nathan Price]]></dc:creator><pubDate>Mon, 27 Mar 2023 03:59:27 GMT</pubDate><content:encoded><![CDATA[<pre><code class="lang-bash">sudo pacman -Syu
</code></pre>
<pre><code class="lang-bash">sudo pacman -S qemu virt-manager virt-viewer dnsmasq vde2 bridge-utils openbsd-netcat libguestfs
</code></pre>
<p>I chose these providers for qemu and virtiofsd</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1679889772615/2a6d4ca0-d311-4b5e-87b9-33f1e1ccf1bd.png" alt class="image--center mx-auto" /></p>
<pre><code class="lang-bash">yay virt-bootstrap
</code></pre>
<pre><code class="lang-bash">sudo systemctl <span class="hljs-built_in">enable</span> libvirtd
</code></pre>
<pre><code class="lang-bash">sudo systemctl start libvirtd
</code></pre>
<pre><code class="lang-bash">sudo nano /etc/libvirt/libvirtd.conf
</code></pre>
<p><code>unix_sock_group = "libvirt"</code></p>
<p><code>unix_sock_rw_perms = "0770"</code></p>
<pre><code class="lang-bash">sudo usermod -a -G libvirt user &amp;&amp; newgrp libvirt
</code></pre>
<pre><code class="lang-bash">sudo nano /etc/libvirt/qemu.conf
</code></pre>
<p><code>user = "nathan"</code></p>
<p><code>group = "nathan"</code></p>
<h2 id="heading-add-vm">Add VM</h2>
<p>Open virt-manager</p>
<p>File &gt; Add Connection</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1679889031313/d5a6567f-3fdc-4106-bcd8-2e995b6ec564.png" alt class="image--center mx-auto" /></p>
<p>Might need to manually choose the OS when selecting the ISO.</p>
<h2 id="heading-move-the-vm">Move the VM</h2>
<p>Find the disk location</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1681066872276/21aa13ac-0d92-466b-8e10-6adb123af332.png" alt class="image--center mx-auto" /></p>
<p>create a new location</p>
<pre><code class="lang-plaintext">sudo /mnt/Storage/QEMU &amp;&amp; sudo chown nathan:nathan /mnt/Storage/QEMU
</code></pre>
<pre><code class="lang-plaintext">mv /home/nathan/.local/share/libvirt/images/win10.qcow2 win10.qcow2
</code></pre>
<p>Edit the xml to reflect the new path</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1681066955616/6fce9f54-8334-48b6-85dc-b6a6c1ecaf6d.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-settings">Settings</h2>
<p>I've found that using VGA graphics and Spice Server with Opengl enabled has given me the best performance.</p>
]]></content:encoded></item><item><title><![CDATA[Start mariadb in recovery mode - Unraid: official docker container]]></title><description><![CDATA[mysql recovery mode
ssh into unraid
cd /mnt/user/appdata/mariadb-official/config

nano my.cnf

paste in
[mysqld]
innodb_force_recovery=1

exit
chmod 0444 my.cnf

restart the docker container.
Fix whatever broke
specifically, I broke a table in my nex...]]></description><link>https://blog.gravityfargo.dev/start-mariadb-in-recovery-mode-unraid-official-docker-container</link><guid isPermaLink="true">https://blog.gravityfargo.dev/start-mariadb-in-recovery-mode-unraid-official-docker-container</guid><category><![CDATA[MySQL]]></category><category><![CDATA[MariaDB]]></category><category><![CDATA[Docker]]></category><category><![CDATA[unraid]]></category><dc:creator><![CDATA[Nathan Price]]></dc:creator><pubDate>Sat, 18 Mar 2023 01:42:53 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/Y9kOsyoWyaU/upload/5600cdcd0fabf918ce7489de00464509.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-mysql-recovery-mode">mysql recovery mode</h3>
<p>ssh into unraid</p>
<pre><code class="lang-bash"><span class="hljs-built_in">cd</span> /mnt/user/appdata/mariadb-official/config
</code></pre>
<pre><code class="lang-bash">nano my.cnf
</code></pre>
<p>paste in</p>
<pre><code class="lang-bash">[mysqld]
innodb_force_recovery=1
</code></pre>
<p>exit</p>
<pre><code class="lang-bash">chmod 0444 my.cnf
</code></pre>
<p>restart the docker container.</p>
<h3 id="heading-fix-whatever-broke">Fix whatever broke</h3>
<p>specifically, I broke a table in my nextcloud database</p>
<p>in the unraid ssh session, attach to the mariadb container</p>
<pre><code class="lang-bash">docker <span class="hljs-built_in">exec</span> -it MariaDB-Official /bin/bash
</code></pre>
<p><code>mysqlcheck</code> is a feature built into mariadb, and is a lot faster</p>
<pre><code class="lang-bash">mysqlcheck -u nextcloud -p --auto-repair --check --all-databases
</code></pre>
<p>delete the <code>my.cnf</code> file</p>
<h3 id="heading-done">done :)</h3>
]]></content:encoded></item><item><title><![CDATA[Raspberry Pi Pico & Code-OSS on Archlinux - A Comprehensive Guide]]></title><description><![CDATA[I got really annoyed trying to figure out how to use the pico with vscode on arch, and I'm sure others are as well. Here's everything I did to get it working. I'll definitely forget all this so it def needed to be written down.
System Packages
sudo p...]]></description><link>https://blog.gravityfargo.dev/raspberry-pi-pico-code-oss-on-archlinux-a-comprehensive-guide</link><guid isPermaLink="true">https://blog.gravityfargo.dev/raspberry-pi-pico-code-oss-on-archlinux-a-comprehensive-guide</guid><category><![CDATA[ArchLinux]]></category><category><![CDATA[Raspberry Pi]]></category><category><![CDATA[raspberry-pi-pico]]></category><category><![CDATA[vscode]]></category><dc:creator><![CDATA[Nathan Price]]></dc:creator><pubDate>Sun, 05 Mar 2023 19:13:14 GMT</pubDate><content:encoded><![CDATA[<p>I got really annoyed trying to figure out how to use the pico with vscode on arch, and I'm sure others are as well. Here's everything I did to get it working. I'll definitely forget all this so it def needed to be written down.</p>
<h2 id="heading-system-packages">System Packages</h2>
<pre><code class="lang-bash">sudo pacman -Syu --noconfirm git cmake gcc arm-none-eabi-gcc arm-none-eabi-gdb automake autoconf base-devel texinfo libtool libftdi libusb code minicom
</code></pre>
<p>For some reason, I needed to import the Maintainer's gpg key.</p>
<pre><code class="lang-bash">gpg --recv-keys 92EDB04BFF325CF3
</code></pre>
<pre><code class="lang-bash"><span class="hljs-built_in">cd</span> ~/Downloads &amp;&amp; git <span class="hljs-built_in">clone</span> https://aur.archlinux.org/gdb-multiarch.git &amp;&amp;  <span class="hljs-built_in">cd</span> gdb-multiarch &amp;&amp; makepkg -sri &amp;&amp; <span class="hljs-built_in">cd</span> .. &amp;&amp; rm -rf gdb-multiarch
</code></pre>
<h2 id="heading-sdk-install">SDK install</h2>
<pre><code class="lang-bash"><span class="hljs-built_in">cd</span> ~/Development/Libs &amp;&amp; git <span class="hljs-built_in">clone</span> https://github.com/raspberrypi/pico-sdk.git
</code></pre>
<pre><code class="lang-bash"><span class="hljs-built_in">cd</span> ~/Development/Libs/pico-sdk &amp;&amp; git reset --hard origin/master &amp;&amp; git submodule update --init &amp;&amp; mkdir build &amp;&amp; <span class="hljs-built_in">cd</span> build &amp;&amp; cmake .. &amp;&amp; chmod -R 755 ~/Development/Libs/pico-sdk
</code></pre>
<p>build it, change 16 to however many cores you want to allow the compiler to use.</p>
<pre><code class="lang-bash">make -j16
</code></pre>
<h2 id="heading-environment-variables">Environment Variables</h2>
<pre><code class="lang-bash"><span class="hljs-built_in">export</span> PICO_SDK_PATH=/home/nathan/Development/Libs/pico-sdk
</code></pre>
<p>check the variable is set</p>
<pre><code class="lang-bash">printenv | grep PICO
</code></pre>
<p>make it persistent</p>
<pre><code class="lang-bash">nano ~/.zshrc
</code></pre>
<p>add <code>export PICO_SDK_PATH=/home/nathan/Development/pico-sdk</code></p>
<p>then source it</p>
<pre><code class="lang-bash">. ~/.zshrc
</code></pre>
<p><strong>if you screw up</strong>, unset the variable and restart this process.</p>
<pre><code class="lang-bash"><span class="hljs-built_in">unset</span> PICO_SDK_PATH
</code></pre>
<h2 id="heading-vscode">VSCode</h2>
<p><strong>Extensions:</strong></p>
<pre><code class="lang-bash">    code --install-extension marus25.cortex-debug &amp;&amp;
    code --install-extension ms-vscode.cmake-tools &amp;&amp;
    code --install-extension ms-vscode.cpptools
</code></pre>
<p>open vscode</p>
<ol>
<li><p>Click the <strong>Extensions</strong> button</p>
</li>
<li><p>Select <strong>"CMake Tools"</strong> under installed</p>
</li>
<li><p>Click the gear icon then <strong>"Extension Settings"</strong></p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1678037344410/fa67833e-7b91-443b-870c-1b4e601b2b5a.png" alt class="image--center mx-auto" /></p>
<p> Scroll down to find "<strong>Cmake: Generator"</strong></p>
</li>
<li><p>Paste in “<strong>Unix Makefiles</strong>”</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1678037578965/1825a9ce-2f98-46ec-997d-978822305d8e.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>Open a blank folder and create a file "<strong>main.c</strong>"</p>
<pre><code class="lang-c"> <span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;stdio.h&gt;</span></span>
 <span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">"pico/stdlib.h"</span></span>

 <span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span> </span>{

     <span class="hljs-keyword">const</span> uint led_pin = <span class="hljs-number">25</span>;

     <span class="hljs-comment">// Initialize LED pin</span>
     gpio_init(led_pin);
     gpio_set_dir(led_pin, GPIO_OUT);

     <span class="hljs-comment">// Initialize chosen serial port</span>
     stdio_init_all();

     <span class="hljs-comment">// Loop forever</span>
     <span class="hljs-keyword">while</span> (<span class="hljs-literal">true</span>) {

         <span class="hljs-comment">// Blink LED</span>
         <span class="hljs-built_in">printf</span>(<span class="hljs-string">"Blinking!\r\n"</span>);
         gpio_put(led_pin, <span class="hljs-literal">true</span>);
         sleep_ms(<span class="hljs-number">1000</span>);
         gpio_put(led_pin, <span class="hljs-literal">false</span>);
         sleep_ms(<span class="hljs-number">1000</span>);
     }
 }
</code></pre>
</li>
<li><p>create a file "<strong>CMakeLists.txt</strong>"</p>
<pre><code class="lang-c"> # <span class="hljs-function">Set minimum required version of CMake
 <span class="hljs-title">cmake_minimum_required</span><span class="hljs-params">(VERSION <span class="hljs-number">3.12</span>)</span>

 # Include build functions from Pico SDK
 <span class="hljs-title">include</span><span class="hljs-params">($ENV{PICO_SDK_PATH}/external/pico_sdk_import.cmake)</span>

 # Set name of <span class="hljs-title">project</span> <span class="hljs-params">(as PROJECT_NAME)</span> <span class="hljs-keyword">and</span> C/C++ standards
 <span class="hljs-title">project</span><span class="hljs-params">(blink C CXX ASM)</span>
 <span class="hljs-title">set</span><span class="hljs-params">(CMAKE_C_STANDARD <span class="hljs-number">11</span>)</span>
 <span class="hljs-title">set</span><span class="hljs-params">(CMAKE_CXX_STANDARD <span class="hljs-number">17</span>)</span>

 # Creates a pico-sdk subdirectory in our project <span class="hljs-keyword">for</span> the libraries
 <span class="hljs-title">pico_sdk_init</span><span class="hljs-params">()</span>

 # Tell CMake where to find the executable source file
 <span class="hljs-title">add_executable</span><span class="hljs-params">(${PROJECT_NAME} 
     main.c
 )</span>

 # Create <span class="hljs-built_in">map</span>/bin/hex/uf2 files
 <span class="hljs-title">pico_add_extra_outputs</span><span class="hljs-params">(${PROJECT_NAME})</span>

 # Link to <span class="hljs-title">pico_stdlib</span> <span class="hljs-params">(gpio, time, etc. functions)</span>
 <span class="hljs-title">target_link_libraries</span><span class="hljs-params">(${PROJECT_NAME} 
     pico_stdlib
 )</span>

 # Enable usb output, disable uart output
 <span class="hljs-title">pico_enable_stdio_usb</span><span class="hljs-params">(${PROJECT_NAME} <span class="hljs-number">1</span>)</span>
 <span class="hljs-title">pico_enable_stdio_uart</span><span class="hljs-params">(${PROJECT_NAME} <span class="hljs-number">0</span>)</span></span>
</code></pre>
</li>
<li><p>restart vscode</p>
<p> *Note: #include will be squiggled until you build the project. You do not need to add any additional includes in the C/C++ or CMake tools.</p>
</li>
<li><p>there will be a popup at the bottom right hand side when you reopen the project, click yes, then "<strong>Scan for Kits</strong>".</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1678038280158/4a0aeaac-0445-4b5b-91ea-17b9563a3cd9.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>At the bottom of VS Code, you should see a blue status bar. At the bottom left, click "<strong>No active kit"</strong> then "<strong>GCC arm-none-eabi".</strong></p>
</li>
<li><p>Click "<strong>Cmake: [Debug]: Ready"</strong> next to that, and select "<strong>Debug"</strong> This should run CMake and create a <em>build</em> directory in your project folder.</p>
</li>
<li><p>Click "<strong>Build</strong>" in the same status bar. This will call <em>make</em> to build your project. You should see new, compiled binaries appear in the <em>build</em> folder</p>
</li>
</ol>
<h2 id="heading-cmake-arguments">cmake arguments</h2>
<p>If you want to specify cmake options, like selecting a board:</p>
<ol>
<li><p>Click the <strong>Extensions</strong> button</p>
</li>
<li><p>Select <strong>"CMake Tools"</strong> under installed</p>
</li>
<li><p>Click the gear icon then <strong>"Extension Settings"</strong></p>
</li>
<li><p>Scroll down to "<strong>Cmake: Configure Args"</strong> and add your arguments there.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1678039808575/e5dd07e5-16f4-44fc-b7e8-bbaeb1626733.png" alt class="image--center mx-auto" /></p>
<pre><code class="lang-bash"> -DPICO_BOARD=pico_w
</code></pre>
</li>
<li><p>Click press build as done before.</p>
</li>
</ol>
<h2 id="heading-install-additional-libraries-using-pico-arduino-compat">Install additional libraries using <strong>pico-arduino-compat</strong></h2>
<pre><code class="lang-bash"><span class="hljs-built_in">cd</span> ~/Development/Libs
</code></pre>
<pre><code class="lang-bash">git <span class="hljs-built_in">clone</span> https://github.com/fhdm-dev/pico-arduino-compat.git &amp;&amp; <span class="hljs-built_in">cd</span> pico-arduino-compat &amp;&amp; git submodule update --init arduino-compat/arduino-pico
</code></pre>
<p>You'll need the exact library name for the Arduino library that you're planning to use.</p>
<p>I suggest the arduino app or cli.</p>
<p><a target="_blank" href="https://www.hackster.io/fhdm-dev/use-arduino-libraries-with-the-rasperry-pi-pico-c-c-sdk-eff55c"><code>This guide kinda works</code></a></p>
]]></content:encoded></item><item><title><![CDATA[Linux - Arduino udev rules]]></title><description><![CDATA[sudo nano /etc/udev/rules.d/52-arduino.rules

paste in the following
SUBSYSTEMS=="usb",KERNEL=="ttyACM*",ATTRS{idVendor}=="16c0",ATTRS{idProduct}=="0483",SYMLINK+="USBIO%n",GROUP="dialout",MODE="0666"
#Arduino Uno Auto Tool Changer
#SUBSYSTEMS=="usb"...]]></description><link>https://blog.gravityfargo.dev/linux-arduino-udev-rules</link><guid isPermaLink="true">https://blog.gravityfargo.dev/linux-arduino-udev-rules</guid><category><![CDATA[arduino]]></category><category><![CDATA[ArchLinux]]></category><category><![CDATA[arduino nano]]></category><category><![CDATA[udev]]></category><dc:creator><![CDATA[Nathan Price]]></dc:creator><pubDate>Sat, 04 Mar 2023 19:54:42 GMT</pubDate><content:encoded><![CDATA[<pre><code class="lang-bash">sudo nano /etc/udev/rules.d/52-arduino.rules
</code></pre>
<p>paste in the following</p>
<pre><code class="lang-bash">SUBSYSTEMS==<span class="hljs-string">"usb"</span>,KERNEL==<span class="hljs-string">"ttyACM*"</span>,ATTRS{idVendor}==<span class="hljs-string">"16c0"</span>,ATTRS{idProduct}==<span class="hljs-string">"0483"</span>,SYMLINK+=<span class="hljs-string">"USBIO%n"</span>,GROUP=<span class="hljs-string">"dialout"</span>,MODE=<span class="hljs-string">"0666"</span>
<span class="hljs-comment">#Arduino Uno Auto Tool Changer</span>
<span class="hljs-comment">#SUBSYSTEMS=="usb",KERNEL=="ttyACM*",ATTRS{idVendor}=="2341",ATTRS{idProduct}=="0043",SYMLINK+="zbot_atc",GROUP="dialout",MODE="0666"</span>
<span class="hljs-comment">#Arduino Nano Auto Tool Changer (CH340 Bus IC)</span>
SUBSYSTEMS==<span class="hljs-string">"usb"</span>,KERNEL==<span class="hljs-string">"ttyUSB*"</span>,ATTRS{idVendor}==<span class="hljs-string">"1a86"</span>,ATTRS{idProduct}==<span class="hljs-string">"7523"</span>,SYMLINK+=<span class="hljs-string">"zbot_atc"</span>,GROUP=<span class="hljs-string">"dialout"</span>,MODE=<span class="hljs-string">"0666"</span>
</code></pre>
<p>save, and reboot.</p>
]]></content:encoded></item><item><title><![CDATA[Solidworks Standalone in a VM]]></title><description><![CDATA[Virtualbox
Solidworks with education licenses doesn't like VirtualBox. I get the error using a standalone license for solidworks is not supported in this virtual environment. Since I exclusively run Arch as my daily driver, this is a bummer.
Turns ou...]]></description><link>https://blog.gravityfargo.dev/solidworks-standalone-in-a-vm</link><guid isPermaLink="true">https://blog.gravityfargo.dev/solidworks-standalone-in-a-vm</guid><category><![CDATA[solidworks]]></category><category><![CDATA[VirtualBox ]]></category><category><![CDATA[ArchLinux]]></category><category><![CDATA[QEMU]]></category><category><![CDATA[solidwork]]></category><dc:creator><![CDATA[Nathan Price]]></dc:creator><pubDate>Sat, 25 Feb 2023 02:25:03 GMT</pubDate><content:encoded><![CDATA[<h1 id="heading-virtualbox">Virtualbox</h1>
<p>Solidworks with education licenses doesn't like VirtualBox. I get the error <code>using a standalone license for solidworks is not supported in this virtual environment</code>. Since I exclusively run Arch as my daily driver, this is a bummer.</p>
<p>Turns out you have to trick windows into thinking it isn't running in a VM. Found this <a target="_blank" href="https://gist.github.com/W-Floyd/7ccf5e4f074939e403bed483f82a4042">bash script</a> so I'm cloning it here for posterity.</p>
<pre><code class="lang-bash">nano bash.sh
</code></pre>
<p>past and save this, change <code>__my_vm='W10'</code> to the name of the VM you're working on</p>
<pre><code class="lang-bash"><span class="hljs-meta">#!/bin/bash</span>

<span class="hljs-function"><span class="hljs-title">__get_random_string</span></span> () {

    openssl rand -hex <span class="hljs-string">"<span class="hljs-variable">${1}</span>"</span> | cut -c <span class="hljs-string">"1-<span class="hljs-variable">${1}</span>"</span>

}

__my_vm=<span class="hljs-string">'W10'</span>

VBoxManage setextradata <span class="hljs-string">"<span class="hljs-variable">${__my_vm}</span>"</span> <span class="hljs-string">"VBoxInternal/Devices/pcbios/0/Config/DmiBIOSVendor"</span> <span class="hljs-string">"American Megatrends Inc"</span>
VBoxManage setextradata <span class="hljs-string">"<span class="hljs-variable">${__my_vm}</span>"</span> <span class="hljs-string">"VBoxInternal/Devices/pcbios/0/Config/DmiBIOSVersion"</span> <span class="hljs-string">"2.1.0"</span>
VBoxManage setextradata <span class="hljs-string">"<span class="hljs-variable">${__my_vm}</span>"</span> <span class="hljs-string">"VBoxInternal/Devices/pcbios/0/Config/DmiSystemVendor"</span> <span class="hljs-string">"ASUSTek Computer"</span>
VBoxManage setextradata <span class="hljs-string">"<span class="hljs-variable">${__my_vm}</span>"</span> <span class="hljs-string">"VBoxInternal/Devices/pcbios/0/Config/DmiSystemSerial"</span> <span class="hljs-string">"<span class="hljs-subst">$(__get_random_string 9)</span>"</span>
VBoxManage setextradata <span class="hljs-string">"<span class="hljs-variable">${__my_vm}</span>"</span> <span class="hljs-string">"VBoxInternal/Devices/ahci/0/Config/Port0/SerialNumber"</span> <span class="hljs-string">"<span class="hljs-subst">$(__get_random_string 20)</span>"</span>
VBoxManage setextradata <span class="hljs-string">"<span class="hljs-variable">${__my_vm}</span>"</span> <span class="hljs-string">"VBoxInternal/Devices/ahci/0/Config/Port0/FirmwareRevision"</span> <span class="hljs-string">"<span class="hljs-subst">$(__get_random_string 8)</span>"</span>
VBoxManage setextradata <span class="hljs-string">"<span class="hljs-variable">${__my_vm}</span>"</span> <span class="hljs-string">"VBoxInternal/Devices/ahci/0/Config/Port0/ModelNumber"</span> <span class="hljs-string">"SEAGATE ST3750525AS"</span>

<span class="hljs-built_in">exit</span>
</code></pre>
<pre><code class="lang-bash">chmod +x bash.sh
</code></pre>
<pre><code class="lang-bash">./bash.sh
</code></pre>
<h1 id="heading-qemu">QEMU</h1>
<p>First, you will need to set a CPU type in virt-manager. The default QEMU virtual CPU cannot have its hypervisor flag removed within libvirt.</p>
<p>For best performance and functionality, you should just select "Copy host CPU configuration" and "Apply". This will allow you to use nested virtualization, running 64-bit accelerated virtual machines inside this virtual machine.</p>
<p>next</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1682482235494/cef0adfa-0440-4bf5-b975-22149f0660c2.png" alt class="image--center mx-auto" /></p>
<p>under CPU in the XML add:</p>
<pre><code class="lang-plaintext">&lt;feature policy='disable' name='hypervisor'/&gt;
</code></pre>
<p>next,</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1682482390849/4d2f54f7-0304-4374-8ab0-0350ac317011.png" alt class="image--center mx-auto" /></p>
<p>add</p>
<pre><code class="lang-plaintext"> &lt;kvm&gt;
    &lt;hidden state='on'/&gt;
  &lt;/kvm&gt;
</code></pre>
<p>into the features section</p>
<p>Windows now thinks its a <em>real</em> boy. Yay.</p>
]]></content:encoded></item><item><title><![CDATA[Custom ROS Dockerfile with Poetry]]></title><description><![CDATA[Basic Usage

Create a directory called umaineros2and cd into it. Paste the code below into a new file "Dockerfile"

build it
 docker build -t umaineros2 .

Run the container detached docker
 run -itd --privileged --name umorosworkspace umaineros2 /bi...]]></description><link>https://blog.gravityfargo.dev/custom-ros-dockerfile-with-poetry</link><guid isPermaLink="true">https://blog.gravityfargo.dev/custom-ros-dockerfile-with-poetry</guid><category><![CDATA[ROS]]></category><category><![CDATA[Poetry]]></category><category><![CDATA[python-poetry]]></category><category><![CDATA[Docker]]></category><dc:creator><![CDATA[Nathan Price]]></dc:creator><pubDate>Sun, 01 Jan 2023 19:03:21 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1672599797734/132c888c-5231-41a6-ad82-1548b4207934.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>Basic Usage</strong></p>
<ol>
<li><p>Create a directory called <code>umaineros2</code>and cd into it. Paste the code below into a new file "Dockerfile"</p>
</li>
<li><p>build it</p>
<p> <code>docker build -t umaineros2 .</code></p>
</li>
<li><p>Run the container detached docker</p>
<p> <code>run -itd --privileged --name umorosworkspace umaineros2 /bin/bash</code></p>
</li>
<li><p>Check if the container is up with</p>
<p> <code>docker ps -a</code></p>
</li>
<li><p>You can connect to the container's shell at any time via</p>
<p> <code>docker exec -it umorosworkspace bash</code></p>
</li>
<li><p>detach from the shell with the key combo <code>CTRL+A+D</code></p>
</li>
</ol>
<pre><code class="lang-bash">FROM ros:foxy-ros-core-focal

<span class="hljs-comment"># Global PATH </span>
ENV PIP_NO_CACHE_DIR=off \
    PIP_DISABLE_PIP_VERSION_CHECK=on \
    PIP_DEFAULT_TIMEOUT=100 \
    VENV_PATH=/opt/venv  \
    ROS_DOMAIN_ID=4 \
    ROS_DISTRO=foxy \
    POETRY_PATH=/opt/poetry \
    VENV_PATH=/opt/venv \
    POETRY_VERSION=0.12.17 \
    ROS2_WS=/opt/ros2_ws \
    PATH=<span class="hljs-string">"/opt/poetry/bin:<span class="hljs-variable">$PATH</span>"</span> \
    LC_ALL=C.UTF-8 \
    LANG=C.UTF-8

<span class="hljs-comment"># install bootstrap tools</span>
RUN apt-get update &amp;&amp; apt-get install --no-install-recommends -y \
    build-essential \
    curl \
    git \
    python3-colcon-common-extensions \
    python3-colcon-mixin \
    python3-rosdep \
    python3-vcstool \
    python3-pip \
    python3-argcomplete \
    python3.8-venv \
    &amp;&amp; rm -rf /var/lib/apt/lists/*

<span class="hljs-comment"># bootstrap rosdep</span>
RUN rosdep init &amp;&amp; \
    rosdep update --rosdistro <span class="hljs-variable">$ROS_DISTRO</span>

<span class="hljs-comment"># setup colcon mixin and metadata</span>
RUN colcon mixin add default \
      https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml &amp;&amp; \
    colcon mixin update &amp;&amp; \
    colcon metadata add default \
      https://raw.githubusercontent.com/colcon/colcon-metadata-repository/master/index.yaml &amp;&amp; \
    colcon metadata update

<span class="hljs-comment"># install ros2 packages</span>
RUN apt-get update &amp;&amp;  apt-get install -y --no-install-recommends \
    ros-foxy-ros-base=0.9.2-1* \
    ros-foxy-desktop \
    &amp;&amp; rm -rf /var/lib/apt/lists/*
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y ros-foxy-desktop

<span class="hljs-comment"># install Poetry</span>
RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python3 - \
    &amp;&amp; poetry --version \
    &amp;&amp; python3 -m venv <span class="hljs-variable">$VENV_PATH</span> \
    &amp;&amp; poetry config settings.virtualenvs.create <span class="hljs-literal">false</span> \
    &amp;&amp; rm -rf /var/lib/apt/lists/*

<span class="hljs-comment"># setup workspace</span>
RUN mkdir -p <span class="hljs-variable">$ROS2_WS</span>/code \
    &amp;&amp; mkdir <span class="hljs-variable">$ROS2_WS</span>/Lepton
WORKDIR <span class="hljs-variable">$ROS2_WS</span>
RUN <span class="hljs-built_in">echo</span> <span class="hljs-string">"source /opt/ros/<span class="hljs-variable">$ROS_DISTRO</span>/setup.bash"</span> &gt;&gt; /root/.bashrc 

ENTRYPOINT [<span class="hljs-string">"/ros_entrypoint.sh"</span>]
CMD [<span class="hljs-string">"bash"</span>]
</code></pre>
]]></content:encoded></item><item><title><![CDATA[Reverse Engineering the USB Driver for the  Corsair Virtuoso SE Headset]]></title><description><![CDATA[12/17/22: My goal is to have the ability to control the LEDs of the headset via the program ckb-next and sidetone with HeadsetControl
This device uses the Slipstream Wireless Dongle, and I won't be. I'm figuring this out as I go, and adding a wireles...]]></description><link>https://blog.gravityfargo.dev/reverse-engineering-the-usb-driver-for-the-corsair-virtuoso-se-headset</link><guid isPermaLink="true">https://blog.gravityfargo.dev/reverse-engineering-the-usb-driver-for-the-corsair-virtuoso-se-headset</guid><dc:creator><![CDATA[Nathan Price]]></dc:creator><pubDate>Mon, 19 Dec 2022 00:13:10 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1671737363920/816dedd6-ba28-414c-b69e-c98d90572f7d.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>12/17/22:</strong> My goal is to have the ability to control the LEDs of the headset via the program <a target="_blank" href="https://github.com/ckb-next/ckb-next">ckb-next</a> and sidetone with <a target="_blank" href="https://github.com/Sapd/HeadsetControl">HeadsetControl</a></p>
<p>This device uses the Slipstream Wireless Dongle, and I won't be. I'm figuring this out as I go, and adding a wireless dongle (that neither program has worked on yet) will add a layer of complexity to something I already don't know how to do. For now, USB only.</p>
<p><strong>1/2/23</strong>: As you can see in the "USB Description Overview w/ lsusb" section, I've managed to map out my best estimation of what each nibble does. I am working solely on ckb-next integration for LED control at this stage. The unfortunate issue I face is that I was hoping I could build off of the bragi protocol already implemented in ckb-next, but it looks like it isn't compatible.</p>
<p><strong>1/3/23</strong>: When I first started out, I focused on the packets sent to control functionality. With the new info that it isn't bragi compatible, I have to decipher the initiation packets sent when iCUE first recognizes the headset. Yay me.</p>
<h1 id="heading-references">References:</h1>
<p><a target="_blank" href="https://www.usb.org/document-library/device-class-definition-hid-111">USB.org - HID 1.1 Specsheet</a></p>
<p>How to setup Wireshark for the purpose of USB packet capture on <a target="_blank" href="https://github.com/liquidctl/liquidctl/blob/main/docs/developer/capturing-usb-traffic.md">liquidctl wiki</a></p>
<p><a target="_blank" href="https://www.beyondlogic.org/usbnutshell/usb1.shtml">beyondlogic: USB in a NutShell</a></p>
<p><a target="_blank" href="https://github.com/liquidctl/liquidctl/blob/main/docs/developer/techniques-for-analyzing-usb-protocols.md">liquidctl Wiki Techniques for analyzing USB protocols</a></p>
<p><a target="_blank" href="https://www.reddit.com/r/MechanicalKeyboards/comments/2ij2um/corsair_k70_rgb_usb_protocol_reverse_engineering/">A Reddit post</a> outlining the reverse engineering of a Corsair Keyboard</p>
<p><a target="_blank" href="https://github.com/ckb-next/ckb-next/wiki/Corsair-Protocol#07-05---lighting-control">ckb-next wiki</a> on the Corsair Protocol</p>
<p><a target="_blank" href="https://github.com/liquidctl/liquidctl/blob/main/docs/developer/protocol/commander_core.md">liquidctl wiki</a> on the Corsair Commander Core</p>
<h3 id="heading-ffr">FFR</h3>
<p><code>Device ID: 0x0a3d</code></p>
<p>dev_address determined from the "GET DESCRIPTOR Response DEVICE" Packet, which is like the fourth one sent in in Wireshark, depending on how many USB devices are passed to the VM. For me, #1 was the VirtualBox mouse driver.</p>
<p>Wireshark Filter:</p>
<p><code>((((usb.device_address == 2)) &amp;&amp; (usb.data_len == 64)) ) &amp;&amp; (usb.irp_info.direction == 0x0)</code></p>
<p>Bash output in OSS-Code looks pretty when put in a JSON file.</p>
<h1 id="heading-usb-description-overview-with-lsusb">USB Description Overview w/ lsusb</h1>
<p><code>lsusb -v -d 1b1c:0a3d</code> <em>verbose output for the specific device</em></p>
<pre><code class="lang-markdown">Bus 001 Device 008: ID 1b1c:0a3d Corsair CORSAIR VIRTUOSO SE USB
</code></pre>
<p><strong>1b1c</strong>:0a3d = Vendor ID, unique to manufacturer (usually)</p>
<p>1b1c:<strong>0a3d</strong> = Product ID, unique to device</p>
<p>Ref: USB HID Appendix</p>
<h3 id="heading-device-descriptor">Device Descriptor</h3>
<p>USB device required by OS to explain descriptor. Not all fields are required.</p>
<p><code>idVendor 0x1b1c Corsair</code></p>
<p><code>iProduct 2 CORSAIR VIRTUOSO SE USB</code></p>
<h3 id="heading-configuration-descriptor">Configuration Descriptor</h3>
<p><code>MaxPower 150mA</code></p>
<h3 id="heading-interface-descriptor">Interface Descriptor</h3>
<p><code>bInterfaceProtocol 0</code> "none," not a keyboard or mouse</p>
<p>The headset has 4 interfaces starting at 0. Interface 3 is the HID device to control the LEDs and other settings.</p>
<h3 id="heading-endpoint-descriptor">Endpoint Descriptor</h3>
<p>The host computer initiates everything. Interrupts in USB are seen by the host at a certain poll rate and know, based on this descriptor, what that interval is, and what packet size is expected. In this case, 64 bytes.</p>
<p><code>bEndpointAddress 0x81 EP 1 IN</code> Endpoint 1 <strong>IN</strong>, Most significant bit sent 8</p>
<p><em>The host is telling the device to send it data.</em></p>
<p><code>bEndpointAddress 0x01 EP 1 OUT</code> Endpoint 1 <strong>OUT</strong>, Most significant bit sent 0</p>
<p><em>The host is giving the device stuff to do.</em></p>
<h1 id="heading-frame-analysis-initialization">Frame Analysis: Initialization</h1>
<h2 id="heading-raw-frame">Raw Frame</h2>
<pre><code class="lang-markdown">0000   [1b 00] [e0 a6 c5 1d 82 91 ff ff] [00 00 00 00] [09 00]
0010   [00] [01 00] [02 00] [01] [01] [40 00 00 00] {[02] [08] [(02 11 00
0020   00 00 00 00 00 00 00 00 00 00 00) 00 00 00 00 00
0030   00 00 00 00 00 00 00 00 00 00 00] [00 00 00 00 00
0040   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0050   00 00 00 00 00 00 00 00 00 00 00]}
</code></pre>
<p>91 bytes on the wire, this specific frame is the first interrupt_out sent to the headset.</p>
<p>I broke the bytes up in square brackets by function, according to Wireshark. Curly brackets indicate the HID data. I'll break down each square bracket by field name indicated in Wireshark.</p>
<ol>
<li><p>usbpcap_header_len</p>
</li>
<li><p>irp_id</p>
</li>
<li><p>usbd_status</p>
</li>
<li><p>function</p>
</li>
<li><p>irp_info</p>
</li>
<li><p>bus id</p>
</li>
<li><p>device address</p>
</li>
<li><p>endpoint</p>
</li>
<li><p>transfer_type</p>
</li>
<li><p>packet data length</p>
</li>
<li><p>report id</p>
</li>
<li><p>vendor data</p>
</li>
<li><p>padding (only first 15 bytes have been observed to be used)</p>
</li>
<li><p>not specified</p>
</li>
</ol>
<p>Only items 11, 12, and 13 are relevant HID data.</p>
<h2 id="heading-initialization-frames">Initialization Frames</h2>
<p>There are 33 of these.... Hopefully they'll help decipher the Interrupt_out mappings.</p>
<h1 id="heading-hid-data-decoding">HID Data Decoding</h1>
<h2 id="heading-interruptout-mapping">INTERRUPT_OUT Mapping</h2>
<pre><code class="lang-markdown">Pkt  Purpose            Out    IN
[0]  Report ID          02     01
[1]  Vendor Data        08     00
[2]  Commands                  Echo
[3]  Feature Select
[4]  Data (1)
[5]  Data (2)
[6]  Unknown (2)
[7]  Unknown (3)
[8]  Red
[9]  Mic (1)? 
[10] Mic (2)
[11] Green 
[12] Charge LED
[13] Mic (3)
[14] Blue
</code></pre>
<h3 id="heading-2-commands">[2] Commands</h3>
<p>Possibly indicates what feature of the headset is being modified</p>
<pre><code class="lang-markdown"><span class="hljs-strong">**<span class="hljs-emphasis">* Seen in Initialization <span class="hljs-strong">**<span class="hljs-emphasis">*
01
02
0d Sleep Enabled Status
09
08
05

<span class="hljs-strong">**<span class="hljs-emphasis">* Seen while expirementing with settings <span class="hljs-strong">**<span class="hljs-emphasis">*
06 RGB
0e Sleep wait time

<span class="hljs-strong">**<span class="hljs-emphasis">* Seen Ocasionally with no user input <span class="hljs-strong">**<span class="hljs-emphasis">*
12</span></span></span></span></span></span></span></span></span></span></span></span>
</code></pre>
<h3 id="heading-3-feature-select">[3] Feature Select</h3>
<p>Indicates the feature being written to/read from</p>
<pre><code class="lang-markdown">00 LED
02 Brightness
0d Sleep toggle 
0e Sleep time
</code></pre>
<h3 id="heading-4-5-data-bytes">[4] [5] Data Bytes</h3>
<p>I'm pretty sure these two bytes are the values passed by whatever setting is altered. I have only seen them change when changing the sleep time and brightness.</p>
<p><strong>Case of the Battery:</strong> I started a capture when I knew the headset wasn't fully charged. The reply packets indicate that Data (2) was the only byte that changed slowly over a few minutes. "XX 03" seems to indicate that "XX" (data 1) is the battery level, and "03" (data 2) maybe indicates that data 1 is outputting battery info. <em>TODO: VERIFY SETTING INDICATOR DURING CHARGE</em></p>
<pre><code class="lang-markdown">09 00     Mic LED color
XX 03     Battery Level
</code></pre>
<p><code>XX</code> = byte changes</p>
<h3 id="heading-91013microphone">[9][10][13]Microphone</h3>
<pre><code class="lang-bash">Mic (2)    ff
Mic (3)    00
Microphone is Muted and <span class="hljs-string">"Disabled LED When Mic is Active"</span> does nothing.
Mic LED is RED

Mic (2)    00
Mic (3)    ff
Microphone is not Muted and <span class="hljs-string">"Disabled LED When Mic is Active"</span> is disabled.
Mic LED is Green

Mic (2)    00
Mic (3)    00
Microphone is not Muted and <span class="hljs-string">"Disabled LED When Mic is Active"</span> is enabled.
Mic LED is off

Mic (2)    ff
Mic (3)    ff
unknown
Mic LED is yellow


I think Mic (1) indicates that the Green RGB contol byte is being used to control the charge LED rather than the main logo LEDs. <span class="hljs-string">"e1"</span>
</code></pre>
<p>Data (1) is <code>09</code>. Also, the button on the microphone controls the mute/unmute bytes.</p>
<p>Microphone LED is also full RGB which can be observed when switching the headset to wireless mode and may be independently controllable, but iCUE won't let users change this.</p>
<h2 id="heading-features-without-dedicated-bytes">Features without dedicated bytes</h2>
<h3 id="heading-sleep-toggle-and-wait-time">Sleep Toggle and Wait Time</h3>
<p>Sleep on, 2 packets. Sleep off, 1 packet. Change sleep time, 2 packets.</p>
<p>When sleep is turned on, the ("when to start" setting in iCUE) sleep time must be re-assigned every time. The two Data Bytes change when the sleep time value has been changed. I think the Setting Indicator byte flips to <code>0d</code> to toggle the actual sleep function since all other values are zeros at this point, and it is present for the first sleep-on packet and the only sleep-off packet. The byte goes to <code>0e</code> only after the first sleep-on packet to reassign the sleep time to the newly re-enabled sleep function.</p>
<p>Order of operations</p>
<ol>
<li><p><strong>Turn sleep on in iCUE</strong></p>
<p> Packet 1 = Feature Select <code>0d</code> , Data Bytes <code>ff</code></p>
<p> Packet 2 = Feature Select <code>0e</code> , Data Bytes specify the when to start time</p>
</li>
<li><p><strong>Turn sleep off in iCUE</strong></p>
<p> Packet 1 = Feature Select <code>0d</code> , Data Bytes <code>00</code></p>
</li>
</ol>
<h3 id="heading-charge-indicator-led">Charge indicator LED</h3>
<p>When the headset is connected VIA USB and fully charged, this led flashes. The speed at which interrupt-out packets are sent corresponds to the speed of the LED pulsing. <s>When it's solid green, it sticks to 80</s>. This LED is also full RGB which can be observed when switching the headset to wireless mode and may be independently controllable, but iCUE won't let users change this.</p>
<p>This byte is the dedicated brightness of the charge led.</p>
<p>You can send datum to this byte to change the intensity, but it is overwritten by, assumably, the firmware.</p>
<h3 id="heading-software-brightness-control-packets">Software Brightness control packets</h3>
<p>Six packets are sent to the device when using the dedicated brightness slider.</p>
<h3 id="heading-logo-led">Logo-LED</h3>
<p>No contention here. Pretty obvious which bytes control the primary LED just by toggling them.</p>
<h3 id="heading-software-only">Software only</h3>
<p>There are no packets sent from the host for the following functions: Sidetone and its volume slider, 7.1/Stereo, lighting link presets, EQ presets, Voice Prompts, Battery indicator in the status bar.</p>
]]></content:encoded></item><item><title><![CDATA[Dell XPS 15 9520 Archlinux Compatability Modifications]]></title><description><![CDATA[I'll update this list regularly, so I have a history of personalization I make to my OS in case I ever need a fresh install.

Enable S3 Deep Sleep

BIOS

Disable TPM, SGX, SMM, and

Absolute On the Power =- lid turns on machine

disable early sign of...]]></description><link>https://blog.gravityfargo.dev/dell-xps-15-9520-archlinux-compatability-modifications</link><guid isPermaLink="true">https://blog.gravityfargo.dev/dell-xps-15-9520-archlinux-compatability-modifications</guid><dc:creator><![CDATA[Nathan Price]]></dc:creator><pubDate>Sat, 17 Dec 2022 20:52:55 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1671737542687/6d1e4a1c-1feb-43e7-8a7d-95e2c0e1aef5.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I'll update this list regularly, so I have a history of personalization I make to my OS in case I ever need a fresh install.</p>
<ul>
<li><p><strong>Enable S3 Deep Sleep</strong></p>
<ul>
<li><p>BIOS</p>
<ul>
<li><p>Disable TPM, SGX, SMM, and</p>
</li>
<li><p>Absolute On the Power =- lid turns on machine</p>
</li>
<li><p>disable early sign of life</p>
</li>
</ul>
</li>
</ul>
</li>
<li><p>/etc/default/grub</p>
<pre><code class="lang-bash">  GRUB_CMDLINE_LINUX_DEFAULT=<span class="hljs-string">"quiet splash ibt=off  mem_sleep_defualt=deep intel_pstate=active"</span>
</code></pre>
</li>
<li><p>/etc/bluetooth/main.conf</p>
<ul>
<li><code>Experimental=true</code></li>
</ul>
</li>
</ul>
<h3 id="heading-software">Software</h3>
<pre><code class="lang-bash">libinput xorg-xinput xf86-input-libinput xdotool
</code></pre>
<ul>
<li><p>powertop</p>
<ul>
<li><code>powertop --calibrate</code></li>
</ul>
</li>
<li><p><code>cpupower</code> as service</p>
</li>
<li><p>AURs</p>
<ul>
<li><p>mkinitcpio-firmware</p>
<ul>
<li>get rid of the annoying 'WARNING: Possibly missing firmware for module:' messages</li>
</ul>
</li>
<li><p>v4l2-ctl</p>
<ul>
<li>webcam</li>
</ul>
</li>
</ul>
</li>
<li><p>KDE</p>
<ul>
<li><p>add a 5 second delay to the .desktop file of all applications that autostart</p>
<ul>
<li><code>Exec=sleep 5 &amp;&amp; /usr/bin/protonmail-bridge</code></li>
</ul>
</li>
</ul>
</li>
</ul>
<h3 id="heading-notes">Notes</h3>
<p>"<code>Kernels between 5.17 and 5.18.3 (included) can not suspend properly when Bluetooth is enabled</code>" - "Bug fixed in linux-5.19.2" <a target="_blank" href="https://bugzilla.kernel.org/show_bug.cgi?id=215768">link</a></p>
]]></content:encoded></item><item><title><![CDATA[Standard Archlinux w/ KDE setup]]></title><description><![CDATA[I'll update this list regularly, so I have a history of personalization I make to my OS in case I ever need to a fresh install.
KDE
Virtual Desktops


6 desktops
    * Desktop 1, Desktop 2, Desktop 3, Productivity (Calendar, Todos), Email, Comms (dis...]]></description><link>https://blog.gravityfargo.dev/standard-archlinux-w-kde-setup</link><guid isPermaLink="true">https://blog.gravityfargo.dev/standard-archlinux-w-kde-setup</guid><dc:creator><![CDATA[Nathan Price]]></dc:creator><pubDate>Sat, 17 Dec 2022 20:52:43 GMT</pubDate><content:encoded><![CDATA[<p>I'll update this list regularly, so I have a history of personalization I make to my OS in case I ever need to a fresh install.</p>
<p><strong>KDE</strong></p>
<p>Virtual Desktops</p>
<ul>
<li><ul>
<li><p>6 desktops</p>
<p>    * Desktop 1, Desktop 2, Desktop 3, Productivity (Calendar, Todos), Email, Comms (discord, teams, slack)</p>
<p>    * Keybindings</p>
<p>    * Switch to Next Desktop <code>ctrl + right</code></p>
<p>    * Switch to Previous Desktop <code>ctrl + left</code></p>
</li>
</ul>
</li>
<li><p>Personalizations</p>
<ul>
<li><p>AUR</p>
<ul>
<li>kwin-effects-cube-git</li>
</ul>
</li>
</ul>
</li>
</ul>
<p><strong>Arch</strong></p>
<ul>
<li><p>ZSH default Shell</p>
<ul>
<li><p><code>sudo pacman -S zsh</code></p>
</li>
<li><p><code>zsh /usr/share/zsh/functions/Newuser/zsh-newuser-install -f</code></p>
</li>
<li><p>Install <a target="_blank" href="https://github.com/ohmyzsh/ohmyzsh">oh my zsh</a></p>
</li>
<li><p><a target="_blank" href="https://github.com/scopatz/nanorc">https://github.com/scopatz/nanorc</a></p>
</li>
</ul>
</li>
<li><p>do not use iwd w/ eduroam, use WPA Supplicant</p>
</li>
<li><p>Printer Driver</p>
<ul>
<li>Canon TS3400 series Ver.6.10 (color) "cnijbe2://"</li>
</ul>
</li>
</ul>
<h2 id="heading-config-files">Config Files</h2>
<pre><code class="lang-bash">// KDE-Dolphin main configuration:
~/.config/dolphinrc
~/.<span class="hljs-built_in">local</span>/share/kxmlgui5/dolphin
~/.<span class="hljs-built_in">local</span>/share/dolphin/view_properties
~/.<span class="hljs-built_in">local</span>/share/kxmlgui5/dolphin/dolphinui.rc.

// KDE-Dolphin sidebar and bookmark configuration:
~/.<span class="hljs-built_in">local</span>/share/user-places.xbel

// KDE-Dolphin keyboard shortcuts configuration:
~/.config/kdeglobals
~/.config/kglobalshortcutsrc
</code></pre>
<pre><code class="lang-bash">// Packages
dolphin-plugins
mkinitcpio-btrfs
mkinitcpio-firmware
</code></pre>
]]></content:encoded></item><item><title><![CDATA[Archlinux: MATLAB Reactivation]]></title><description><![CDATA[I prefer to use MATLAB headless, and when running matlab --nodesktop I was greeted with:
MATLAB is selecting SOFTWARE OPENGL rendering.
License checkout failed.
License Manager Error -9
The hostid of your computer ("000000000") does not match the hos...]]></description><link>https://blog.gravityfargo.dev/archlinux-matlab-reactivation</link><guid isPermaLink="true">https://blog.gravityfargo.dev/archlinux-matlab-reactivation</guid><category><![CDATA[Matlab]]></category><category><![CDATA[ArchLinux]]></category><dc:creator><![CDATA[Nathan Price]]></dc:creator><pubDate>Sun, 11 Dec 2022 23:27:33 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1670801184231/WxWR4odl1.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I prefer to use MATLAB headless, and when running <code>matlab --nodesktop</code> I was greeted with:</p>
<pre><code class="lang-bash">MATLAB is selecting SOFTWARE OPENGL rendering.
License checkout failed.
License Manager Error -9
The hostid of your computer (<span class="hljs-string">"000000000"</span>) does not match the hostid of the license
file (0000000000). 
To run on this computer, you must run the Activation client to reactivate your license.

Troubleshoot this issue by visiting: 
https://www.mathworks.com/support/lme/R2022a/9

Diagnostic Information:
Feature: MATLAB 
License path: /home/nathan/.matlab/R2022a_licenses/license_Price-Desktop-Arch-Image_00000_R2022a.lic:/home/nathan
/.<span class="hljs-built_in">local</span>/share/MATLAB/R2022a/licenses/license.dat:/home/nathan/.<span class="hljs-built_in">local</span>/share/MATLAB/R2022a/licenses 
Licensing error: -9,57.
</code></pre>
<p>So, the first thing we need to do is delete the old license file.</p>
<pre><code class="lang-bash">rm -rf /home/nathan/.matlab/R2022a_licenses/license_Price-Desktop-Arch-Image_00000_R2022a.lic
</code></pre>
<p>Now run the GUI version.</p>
<pre><code class="lang-bash">matlab
</code></pre>
<p>you should be greeted with:</p>
<p>![](https://cdn.hashnode.com/res/hashnode/image/upload/v1670801030787/Ox7MmxHsG.png align="middle")</p>
<p>Just click next, log in with your MathWorks account, and success.</p>
]]></content:encoded></item><item><title><![CDATA[Suppress "[ 6] BadTLP" Error]]></title><description><![CDATA[kernel: pcieport 0000:00:01.1:    [12] Timeout               
kernel: pcieport 0000:00:01.1: AER: Corrected error received: 0000:00:00.0
kernel: pcieport 0000:00:01.1: PCIe Bus Error: severity=Corrected, type=Data Link Layer, (Receiver ID)
kernel: pc...]]></description><link>https://blog.gravityfargo.dev/suppress-6-badtlp-error</link><guid isPermaLink="true">https://blog.gravityfargo.dev/suppress-6-badtlp-error</guid><dc:creator><![CDATA[Nathan Price]]></dc:creator><pubDate>Sun, 04 Dec 2022 15:24:34 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1670167465571/WUhxbW2Ux.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<pre><code class="lang-yaml"><span class="hljs-attr">kernel: pcieport 0000:00:01.1:</span>    [<span class="hljs-number">12</span>] <span class="hljs-string">Timeout</span>               
<span class="hljs-attr">kernel: pcieport 0000:00:01.1: AER: Corrected error received:</span> <span class="hljs-number">0000</span><span class="hljs-string">:00:00.0</span>
<span class="hljs-attr">kernel: pcieport 0000:00:01.1: PCIe Bus Error:</span> <span class="hljs-string">severity=Corrected,</span> <span class="hljs-string">type=Data</span> <span class="hljs-string">Link</span> <span class="hljs-string">Layer,</span> <span class="hljs-string">(Receiver</span> <span class="hljs-string">ID)</span>
<span class="hljs-attr">kernel: pcieport 0000:00:01.1:</span>   <span class="hljs-string">device</span> [<span class="hljs-number">1022</span><span class="hljs-string">:1453</span>] <span class="hljs-string">error</span> <span class="hljs-string">status/mask=00000040/00006000</span>
<span class="hljs-attr">kernel: pcieport 0000:00:01.1:</span>    [ <span class="hljs-number">6</span>] <span class="hljs-string">BadTLP</span>                
<span class="hljs-attr">kernel: pcieport 0000:00:01.1: AER: Corrected error received:</span> <span class="hljs-number">0000</span><span class="hljs-string">:00:00.0</span>
<span class="hljs-attr">kernel: pcieport 0000:00:01.1: PCIe Bus Error:</span> <span class="hljs-string">severity=Corrected,</span> <span class="hljs-string">type=Data</span> <span class="hljs-string">Link</span> <span class="hljs-string">Layer,</span> <span class="hljs-string">(Receiver</span> <span class="hljs-string">ID)</span>
<span class="hljs-attr">kernel: pcieport 0000:00:01.1:</span>   <span class="hljs-string">device</span> [<span class="hljs-number">1022</span><span class="hljs-string">:1453</span>] <span class="hljs-string">error</span> <span class="hljs-string">status/mask=00000040/00006000</span>
<span class="hljs-attr">kernel: pcieport 0000:00:01.1:</span>    [ <span class="hljs-number">6</span>] <span class="hljs-string">BadTLP</span>                
<span class="hljs-attr">kernel: pcieport 0000:00:01.1: AER: Corrected error received:</span> <span class="hljs-number">0000</span><span class="hljs-string">:00:00.0</span>
<span class="hljs-attr">kernel: pcieport 0000:00:01.1: AER:</span> <span class="hljs-string">can't</span> <span class="hljs-string">find</span> <span class="hljs-string">device</span> <span class="hljs-string">of</span> <span class="hljs-string">ID0000</span>
</code></pre>
<p>These errors are hardware related, and I probably shouldn't ignore them. Most likely from a PCIe card that isn't seated properly or something. Either way, I want to stop filling my Syslog with several gigs of this every day on a machine I don't care about. To suppress them, add the kernel parameter</p>
<pre><code class="lang-bash">append initrd=/bzroot pci=noaer
</code></pre>
<p>to your grub bootloader or, in the case of this system, syslinux configuration.</p>
]]></content:encoded></item><item><title><![CDATA[Arch Linux - Switch to LTS Kernel]]></title><description><![CDATA[There are two starting points. If your boot partition isn't very large, you'll get errors when installing the linux-lts package. Example:
zstd: error 25 : Write error : No space left on device (cannot write compressed block)  
bsdtar: Write error 
bs...]]></description><link>https://blog.gravityfargo.dev/arch-linux-switch-to-lts-kernel</link><guid isPermaLink="true">https://blog.gravityfargo.dev/arch-linux-switch-to-lts-kernel</guid><category><![CDATA[ArchLinux]]></category><category><![CDATA[linux kernel]]></category><category><![CDATA[lts]]></category><dc:creator><![CDATA[Nathan Price]]></dc:creator><pubDate>Fri, 02 Dec 2022 18:58:16 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1670042185732/5b0a630a-9e91-4bd3-a2f1-fd680de13e57.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>There are two starting points. If your boot partition isn't very large, you'll get errors when installing the linux-lts package. Example:</p>
<pre><code class="lang-bash">zstd: error 25 : Write error : No space left on device (cannot write compressed block)  
bsdtar: Write error 
bsdtar: Write error 
==&gt; ERROR: Image generation FAILED: sort reported an error 
error: <span class="hljs-built_in">command</span> failed to execute correctly
</code></pre>
<p>So I just deleted all of the .img files in /boot</p>
<pre><code class="lang-bash">sudo rm /boot/*.img
</code></pre>
<p>Now install the LTS kernel. If you reboot before installing the new one, your system will not boot.</p>
<pre><code class="lang-bash">sudo pacman -Syu linux-lts linux-lts-headers
</code></pre>
<p>If using VirtualBox, you need to swap its kernel modules to match the new LTS kernel before you can remove the Linux package.</p>
<pre><code class="lang-bash">sudo pacman -S virtualbox-host-dkms
</code></pre>
<p>Allow the replacement.</p>
<p><code>virtualbox-host-dkms and virtualbox-host-modules-arch are in conflict. Remove virtualbox-host-modules-arch? [y/N] y</code></p>
<p>Now remove the linux and linux headers packages</p>
<pre><code class="lang-bash">sudo pacman -R linux linux-headers
</code></pre>
<p>Finally, update your bootloader.</p>
<pre><code class="lang-bash">sudo grub-mkconfig -o /boot/grub/grub.cfg
</code></pre>
]]></content:encoded></item><item><title><![CDATA[Raspberry Pi Pico SDK - Manual Installation and Test]]></title><description><![CDATA[Pico SDK
Download the pico SDK from the official GitHub into your chosen directory. I don't like looking at it, so I put it in a hidden folder.
mkdir ~/.picob && cd ~/.pico
git clone https://github.com/raspberrypi/pico-sdk.git

Add the SDK to your PA...]]></description><link>https://blog.gravityfargo.dev/raspberry-pi-pico-sdk-manual-installation-and-test</link><guid isPermaLink="true">https://blog.gravityfargo.dev/raspberry-pi-pico-sdk-manual-installation-and-test</guid><category><![CDATA[Raspberry Pi]]></category><category><![CDATA[pico]]></category><category><![CDATA[raspberry-pi-pico]]></category><dc:creator><![CDATA[Nathan Price]]></dc:creator><pubDate>Thu, 01 Dec 2022 18:13:15 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1670041992626/d149fad3-193b-4e4b-917b-7179b6118bf5.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-pico-sdk">Pico SDK</h3>
<p>Download the pico SDK from the official GitHub into your chosen directory. I don't like looking at it, so I put it in a hidden folder.</p>
<pre><code class="lang-bash">mkdir ~/.picob &amp;&amp; <span class="hljs-built_in">cd</span> ~/.pico
git <span class="hljs-built_in">clone</span> https://github.com/raspberrypi/pico-sdk.git
</code></pre>
<p>Add the SDK to your PATH. I like using zsh instead of bash.</p>
<pre><code class="lang-bash">nano ~/.zshrc
</code></pre>
<p>append the following lines to the bottom of the file</p>
<pre><code class="lang-bash"><span class="hljs-built_in">export</span> PICO_SDK_PATH=<span class="hljs-string">"/home/nathan/.pico/pico-sdk"</span>
</code></pre>
<p>Log out and back in to update the PATH or</p>
<pre><code class="lang-bash">. ~/.zshrc
</code></pre>
<p>add sub-modules</p>
<pre><code class="lang-bash"><span class="hljs-built_in">cd</span> ~/.pico/pico-sdk/
git submodule update --init
</code></pre>
<h3 id="heading-picotool-optional"><strong>Picotool (optional)</strong></h3>
<p>download code, compile, move to local bin</p>
<pre><code class="lang-bash"><span class="hljs-built_in">cd</span> ~/.pico
git <span class="hljs-built_in">clone</span> https://github.com/raspberrypi/picotool.git
<span class="hljs-built_in">cd</span> picotool
mkdir build &amp;&amp; <span class="hljs-built_in">cd</span> build
cmake ../
make
sudo cp picotool /usr/<span class="hljs-built_in">local</span>/bin/
</code></pre>
<h3 id="heading-pico-extras-optional">Pico-extras (optional)</h3>
<p>download code, compile, and add to path.</p>
<pre><code class="lang-bash"><span class="hljs-built_in">cd</span> ~/.pico
git <span class="hljs-built_in">clone</span> https://github.com/raspberrypi/pico-extras.git
nano ~/.zshrc
</code></pre>
<p>append the following lines to the bottom of the file</p>
<pre><code class="lang-bash"><span class="hljs-built_in">export</span> PICO_EXTRAS_PATH=<span class="hljs-string">"/home/nathan/.pico/pico-extras"</span>
</code></pre>
<p>Log out and back in to update the PATH or</p>
<pre><code class="lang-bash">. ~/.zshrc
</code></pre>
<h3 id="heading-compile-the-blink-example">Compile the "blink" example</h3>
<pre><code class="lang-bash"><span class="hljs-built_in">cd</span> ~/Downloads
git <span class="hljs-built_in">clone</span> https://github.com/raspberrypi/pico-examples
<span class="hljs-built_in">cd</span> pico-examples
mkdir build &amp;&amp; <span class="hljs-built_in">cd</span> build
cmake ..
<span class="hljs-built_in">cd</span> blink
make
</code></pre>
<p><strong>BOOTSEL Mode</strong></p>
<p>Hold the BOOTSEL button (White color button near the micro USB connector) located on the Pico board while connecting the Pico to the computer.</p>
<h3 id="heading-find-and-mount-the-pico">Find and mount the pico</h3>
<pre><code class="lang-bash">lsblk -f
</code></pre>
<p>look for something like</p>
<p>sde<br />└─<em>sde1</em>              vfat        FAT16    <strong>RPI-RP2</strong>         0009-4A70`</p>
<p><code>/dev/sde</code> is the device <code>/dev/sde1</code> is a filesystem on the device.</p>
<pre><code class="lang-bash">sudo mkdir /mnt/usb &amp;&amp; sudo chown <span class="hljs-variable">$USER</span>:<span class="hljs-variable">$USER</span> /mnt/usb
sudo mount /dev/sde1 /mnt/usb
</code></pre>
<p>Copy over the "blink.uf2" file to the pi.</p>
<pre><code class="lang-bash">cp blink.uf2 /mnt/usb
</code></pre>
<p>It should immediately start blinking.</p>
<h3 id="heading-cont-for-ece-101">CONT. for ECE 101</h3>
<p>Download the three multimeter files from the course website. Use RMB on each link and select "Save as...". I would include wget/curl commands, but those hardlinks could change. After you download them, copy them to the adc_console directory.</p>
<pre><code class="lang-bash">cp adc_console.c digits.c CMakeLists.txt ~/Downloads/pico-examples/adc/adc_console/
</code></pre>
<p>Remove the prior builds and compile</p>
<pre><code class="lang-bash"><span class="hljs-built_in">cd</span> ~/Downloads/pico-examples
rm -rf build
mkdir build &amp;&amp; <span class="hljs-built_in">cd</span> build
cmake ..
<span class="hljs-built_in">cd</span> adc/adc_console
make
</code></pre>
<p>put the pi in BOOTSEL mode and copy over .uf2 as shown before.</p>
<pre><code class="lang-bash">sudo cp adc_console.uf2 /mnt/usb
</code></pre>
<h3 id="heading-monitor-the-serial-output">Monitor the serial output</h3>
<p>There are several ways to do this. I like using screen, but you can use a GUI like Putty or a command line tool like minicom. The first few steps to identify the pico serial interface will still be needed to use the other methods.</p>
<p>First, check the kernel message buffer (basically a system log) for info relating to the pico</p>
<pre><code class="lang-bash">sudo dmesg
</code></pre>
<p>the output to look for:</p>
<pre><code class="lang-yaml">[<span class="hljs-number">169801.734603</span>] <span class="hljs-attr">usb 5-1:</span> <span class="hljs-string">USB</span> <span class="hljs-string">disconnect,</span> <span class="hljs-string">device</span> <span class="hljs-string">number</span> <span class="hljs-number">4</span>
[<span class="hljs-number">169801.735187</span>] <span class="hljs-string">device</span> <span class="hljs-string">offline</span> <span class="hljs-string">error,</span> <span class="hljs-string">dev</span> <span class="hljs-string">sde,</span> <span class="hljs-string">sector</span> <span class="hljs-number">260</span> <span class="hljs-string">op</span> <span class="hljs-number">0x1</span><span class="hljs-string">:(WRITE)</span> <span class="hljs-string">flags</span> <span class="hljs-number">0x0</span> <span class="hljs-string">phys_seg</span> <span class="hljs-number">1</span> <span class="hljs-string">prio</span> <span class="hljs-string">class</span> <span class="hljs-number">2</span>
[<span class="hljs-number">169801.735195</span>] <span class="hljs-string">Buffer</span> <span class="hljs-string">I/O</span> <span class="hljs-string">error</span> <span class="hljs-string">on</span> <span class="hljs-string">dev</span> <span class="hljs-string">sde1,</span> <span class="hljs-string">logical</span> <span class="hljs-string">block</span> <span class="hljs-number">259</span><span class="hljs-string">,</span> <span class="hljs-string">lost</span> <span class="hljs-string">async</span> <span class="hljs-string">page</span> <span class="hljs-string">write</span>
[<span class="hljs-number">169802.064671</span>] <span class="hljs-attr">usb 5-1:</span> <span class="hljs-string">new</span> <span class="hljs-string">full-speed</span> <span class="hljs-string">USB</span> <span class="hljs-string">device</span> <span class="hljs-string">number</span> <span class="hljs-number">5</span> <span class="hljs-string">using</span> <span class="hljs-string">xhci_hcd</span>
[<span class="hljs-number">169802.222607</span>] <span class="hljs-attr">usb 5-1:</span> <span class="hljs-string">New</span> <span class="hljs-string">USB</span> <span class="hljs-string">device</span> <span class="hljs-string">found,</span> <span class="hljs-string">idVendor=2e8a,</span> <span class="hljs-string">idProduct=000a,</span> <span class="hljs-string">bcdDevice=</span> <span class="hljs-number">1.00</span>
[<span class="hljs-number">169802.222615</span>] <span class="hljs-attr">usb 5-1: New USB device strings:</span> <span class="hljs-string">Mfr=1,</span> <span class="hljs-string">Product=2,</span> <span class="hljs-string">SerialNumber=3</span>
[<span class="hljs-number">169802.222617</span>] <span class="hljs-attr">usb 5-1: Product:</span> <span class="hljs-string">Pico</span>
[<span class="hljs-number">169802.222619</span>] <span class="hljs-attr">usb 5-1: Manufacturer:</span> <span class="hljs-string">Raspberry</span> <span class="hljs-string">Pi</span>
[<span class="hljs-number">169802.222621</span>] <span class="hljs-attr">usb 5-1: SerialNumber:</span> <span class="hljs-string">E66098F29B400D32</span>
[<span class="hljs-number">169802.285360</span>] <span class="hljs-attr">cdc_acm 5-1:1.0: ttyACM0:</span> <span class="hljs-string">USB</span> <span class="hljs-string">ACM</span> <span class="hljs-string">device</span>
[<span class="hljs-number">169802.285388</span>] <span class="hljs-attr">usbcore:</span> <span class="hljs-string">registered</span> <span class="hljs-string">new</span> <span class="hljs-string">interface</span> <span class="hljs-string">driver</span> <span class="hljs-string">cdc_acm</span>
[<span class="hljs-number">169802.285391</span>] <span class="hljs-attr">cdc_acm:</span> <span class="hljs-string">USB</span> <span class="hljs-string">Abstract</span> <span class="hljs-string">Control</span> <span class="hljs-string">Model</span> <span class="hljs-string">driver</span> <span class="hljs-string">for</span> <span class="hljs-string">USB</span> <span class="hljs-string">modems</span> <span class="hljs-string">and</span> <span class="hljs-string">ISDN</span> <span class="hljs-string">adapters</span>
</code></pre>
<p>specifically, <code>cdc_acm 5-1:1.0: ttyACM0: USB ACM device</code>. /dev/ttyACM0 is the port we can use to talk to the pico.</p>
<pre><code class="lang-bash">sudo screen /dev/ttyACM0 115200
</code></pre>
<p>To end the session, press <code>Ctrl+A</code> followed by <code>K</code>. Alternatively, press <code>Ctrl+A</code>, type <code>:quit</code> and confirm it by pressing Enter.</p>
<p>With that, you should be connected. As you can see from the screenshot, my multimeter (which only has the pico plugged in - no power supply) is reading 0.02. This shows that I need to calibrate the meter.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1670041606076/8dd8eba1-761d-4138-a6c1-4c5929c03a07.png" alt /></p>
]]></content:encoded></item><item><title><![CDATA[Add a command to path - zsh]]></title><description><![CDATA[10/10 install ohmyzsh
add
export PATH=~/path/to/thing:$PATH

to the end of ./zshrc
Logout and back in to update or
. ~/.zshrc]]></description><link>https://blog.gravityfargo.dev/add-a-command-to-path-zsh</link><guid isPermaLink="true">https://blog.gravityfargo.dev/add-a-command-to-path-zsh</guid><dc:creator><![CDATA[Nathan Price]]></dc:creator><pubDate>Sun, 27 Nov 2022 22:46:33 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1670042405676/3e3313dc-7d53-4914-bdfc-c67c0359b9de.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>10/10 install <a target="_blank" href="https://github.com/ohmyzsh/ohmyzsh">ohmyzsh</a></p>
<p>add</p>
<pre><code class="lang-bash"><span class="hljs-built_in">export</span> PATH=~/path/to/thing:<span class="hljs-variable">$PATH</span>
</code></pre>
<p>to the end of ./zshrc</p>
<p>Logout and back in to update or</p>
<pre><code class="lang-bash">. ~/.zshrc
</code></pre>
]]></content:encoded></item></channel></rss>