<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Carl Krauss on Medium]]></title>
        <description><![CDATA[Stories by Carl Krauss on Medium]]></description>
        <link>https://medium.com/@ckrauss?source=rss-249887786381------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*gqtIQS9Yhf7R4T35Ux-1rA.jpeg</url>
            <title>Stories by Carl Krauss on Medium</title>
            <link>https://medium.com/@ckrauss?source=rss-249887786381------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 19:28:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ckrauss/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Adding a Google Site to your Google Domain]]></title>
            <link>https://medium.com/@ckrauss/adding-a-google-site-to-your-google-domain-c5e55592a689?source=rss-249887786381------2</link>
            <guid isPermaLink="false">https://medium.com/p/c5e55592a689</guid>
            <category><![CDATA[web-hosting]]></category>
            <category><![CDATA[website]]></category>
            <category><![CDATA[google-sites]]></category>
            <category><![CDATA[google-domains]]></category>
            <category><![CDATA[domains]]></category>
            <dc:creator><![CDATA[Carl Krauss]]></dc:creator>
            <pubDate>Fri, 26 Jul 2019 16:46:01 GMT</pubDate>
            <atom:updated>2019-07-26T17:03:25.432Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ghIvK9_2BKUTifEENpk8kQ.png" /></figure><p>After buying a domain, setting up a website tends to be the next logical step for most people. In this post, I’m going to walk you through how to configure your domain to use the Google Sites. Google Sites is an easy way to get a free hosted website online without any coding. I’m also going to use Google Domains as my domain registrar. At this point I’m going to assume that you’ve already bought a domain from Google Domains and are ready to setup a site.</p><p>If you are looking to start a small business and need email and collaboration tools I suggest checking out <a href="https://gsuite.google.com/">G Suite</a>. If you are looking to just set up a small personal site then a normal google account will work as well.</p><p>Start by heading over to <a href="https://sites.google.com/">Google Sites</a> and create a new site. This is the time to get your creative juices flowing. You can start by customizing your site for your needs, like adding pictures, text, logos, etc. If you’re interested in learning more, I suggest checking out the “<a href="https://support.google.com/a/users/answer/9314941?hl=en">Get started with Sites</a>” section.</p><figure><img alt="A picture of the Google Sites console with a sample site." src="https://cdn-images-1.medium.com/max/1024/0*B_0HudES4UjeHiYO" /></figure><p>Awesome! So now you have a site that’s ready to be shown to the world. Next, we need to configure it to be served under the domain name that you’ve just purchased. To do that, we’ll need to add an entry to the “Custom URLs” section. It’s located under the 3 vertical dots in the top right corner.</p><figure><img alt="A picture of the Google Sites console showing the location of the customer urls" src="https://cdn-images-1.medium.com/max/1024/0*3yUEcq7M363KtTY5" /></figure><figure><img alt="A picture of adding a custom url in the Google Sites console." src="https://cdn-images-1.medium.com/max/1024/0*I4vd1Ekb3U6pJLJS" /></figure><p>In most cases, websites will use a <strong>www</strong> subdomain for hosting the main website. If you have something more custom feel free to use that instead of www. In my case, I have the domain reftly.com so I’m going to use www.reftly.com as the custom URL here.</p><p>The last thing to do here is to publish your new website to the web. To do that, you’ll click the publish button in the upper right hand corner. You can also choose to view your newly published website by clicking the little down arrow next to Publish and selecting “View published website”.</p><figure><img alt="A picture indicating the location of the publish button in Google Sites." src="https://cdn-images-1.medium.com/max/1024/0*by0mQxvvFGZTFXJH" /></figure><p>Now it’s time to move over and configure a few settings in <a href="https://domains.google/">Google Domains</a>. In your “My domains” view select the domain.</p><figure><img alt="A picture of the Google Domains console showing how to manage a domain." src="https://cdn-images-1.medium.com/max/1024/0*EAIZrFq_CYB02PXy" /></figure><p>Next we’ll head to the <strong>DNS</strong> section to add a few entries there.</p><figure><img alt="A picture of the Google Domains console showing the location of the DNS navigation" src="https://cdn-images-1.medium.com/max/1024/0*e5qrJb1vwUZ5-lfd" /></figure><p>The first section that we’re looking for is the “Synthetic Records” section. We’ll just need to create 1 record here. The record we’ll add is for redirecting the root domain to the www subdomain. In my case, if I just went to “reftly.com” it would then redirect to the <a href="http://www.reftly.com/">www.reftly.com</a> where I had setup my website. For redirecting the root domain you would use the “@” symbol.</p><figure><img alt="A picture of adding an example synthetic record in Google Domains" src="https://cdn-images-1.medium.com/max/1024/0*BSAf2GQLetNBnzp6" /></figure><p>The second record you’ll need to add is in the “Custom resource records” section. Here you’ll add <strong>CNAME</strong> record for <strong>www</strong> pointing it to <strong>ghs.googlehosted.com</strong>. This is where your Google Site is being hosted.</p><figure><img alt="A picture of adding a custom resource record in Google Domains" src="https://cdn-images-1.medium.com/max/1024/0*nl67fgAhHEfbR02H" /></figure><p>That’s it! You’ve successfully configured your domain in Google Domains to point to your Google Site. You should now be able to type in your domain name and see the site that you’ve created. If it doesn’t show up right away, you may have to wait a few minutes for all of the updates to take effect.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5e55592a689" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Connecting MicroPython devices to Google Cloud IoT Core]]></title>
            <link>https://medium.com/google-cloud/connecting-micropython-devices-to-google-cloud-iot-core-3680e632681e?source=rss-249887786381------2</link>
            <guid isPermaLink="false">https://medium.com/p/3680e632681e</guid>
            <category><![CDATA[esp32]]></category>
            <category><![CDATA[arduino]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[iot]]></category>
            <dc:creator><![CDATA[Carl Krauss]]></dc:creator>
            <pubDate>Wed, 12 Jun 2019 23:59:30 GMT</pubDate>
            <atom:updated>2019-06-14T22:23:26.027Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*7SfdS0wt7VnkVt7bk0LU5g.png" /></figure><h3>Intro</h3><p>A few weeks ago, I started building another IoT project. (More to come on that later) When laying out all of the components and determining how I’m going to set it up, I took a second to think about the software side of things. I saw two main paths forward. On one hand, I could go the Arduino C/C++ route which is a pretty well documented and in more cases a good route to go. But on the other hand, I had heard about MicroPython but had never gotten around to giving it a shot. I also could not find any good information about using MicroPython with Google Cloud IoT Core.</p><p>So the goal of this blog is to share a step-by-step walk through of how to get a MicroPython-compatible micro-controller, in this case a ESP32, configured to connect and send events over MQTT to Google Cloud IoT Core.</p><h3>Select a device</h3><p>Like I mentioned before, we’ll be starting out with an ESP32 development board. These can be found fairly cheaply on eBay, Banggood, Aliexpress, etc. However, I picked up a lolin32 on Amazon. In any case, most (if not all) ESP32 development boards should work.</p><p>Because your device likely doesn’t have MicroPython already installed, we’ll need to go ahead and flash it. Don’t worry, this is a pretty straightforward process. In my case I’m using the current latest stable (esp32–20190529-v1.11.bin) but if you’re up for it, it might be worth checking out the latest and greatest. You can find the binary files on the MicroPython site: <a href="http://micropython.org/download#esp32">http://micropython.org/download#esp32</a></p><p>After you’ve selected and downloaded the MicroPython binary file, we’ll want to make sure you have the esptool which allows you to easily communicate with the ROM bootloader of the device. The code for this is located <a href="https://github.com/espressif/esptool">here</a>, but you can easily install it using pip. Additionally, we’ll also want to have a tool that can communicate and control the MicroPython board over serial. This tool is called ampy and we’ll install that now as well.</p><pre>pip install esptool adafruit-ampy</pre><p>Now that you have the esptool installed, you’ll want to plug the board into your computer and find out which serial port it is on. Since I’m using a Mac, I’ll do something like:</p><pre>ls /dev/ | grep -i &quot;tty&quot; | grep -i &quot;usb&quot;</pre><p>In my case the serial port ended up being /dev/tty.SLAB_USBtoUART, however yours may be different depending on your operating system. We can store this in an environment variable to make it a little easier.</p><pre>export SERIALPORT=&quot;/dev/tty.SLAB_USBtoUART&quot;</pre><p>You can now confirm that everything is working by running a check on the device:</p><pre>esptool.py —-port $SERIALPORT flash_id</pre><p>This should print out some details about the ESP32 chip.</p><p>At this point we’re ready to erase the flash that’s currently on the board and go ahead and flash it with MicroPython. Here are the two commands to do that. [Note: This assumes that your MicroPython file is in your home directory Downloads folder and your serial port may be different from the one listed below]</p><pre>esptool.py —-chip esp32 —-port $SERIALPORT erase_flash</pre><pre>esptool.py —-chip esp32 —-port $SERIALPORT —-baud 460800 write_flash -z 0x1000 ~/Downloads/esp32–20190529-v1.11.bin</pre><p>After that finishes…Success! You now have MicroPython installed on your ESP32 board. You can view the files that are currently on the device by using ampy. There should only be one file named boot.py which is loaded unsurprisingly every time the device boots.</p><pre>ampy —-port $SERIALPORT -—baud 115200 ls</pre><p>Now it’s time to generate an RSA public/private key pair. You can do this by running the following two commands.</p><pre>openssl genrsa -out rsa_private.pem 2048</pre><pre>openssl rsa -in rsa_private.pem -pubout -out rsa_public.pem</pre><p>This will output 2 files rsa_private.pem and rsa_public.pem. You’re going to need these in the next step, but make sure to keep them private.</p><h3>Configure Google Cloud IoT Core</h3><p>We now need to setup setup Google Cloud IoT Core so that we have all of the values that we need when configuring the device. Login to <a href="https://console.cloud.google.com/">https://console.cloud.google.com</a>. If you don’t already have an account, you can try it for free.</p><p>On the left hand side you’ll want to navigate to “IoT Core”. If this is your first time, you’ll need to enable the API.</p><p>Next you’ll need to create a registry and fill out the following information:</p><p><strong>Registry ID</strong> — This is a registry that will contain 1 or more devices that you would like to connect.</p><p><strong>Region</strong> — Select the region that’s best for you. In my case I’ll use us-central1 since it’s the closest to me.</p><p>Select the Pub/Sub topics for telemetry and state. (You can create a new one for each of these)</p><p>Once the registry is created, we can now create a device in the registry for our esp32 board. Go to “Devices” then “Create a new device”. In this section we’ll configure the device. Give it a unique device ID, for this setup I just used something like esp32-dev-1, but you can use whatever ID you would like. We’ll leave the defaults as they are.</p><p>Device Communication — Allow<br>Authentication — Enter Manually <br>Public key format — RS256.</p><p>In the Public key value we’ll paste in the contents of the file rsa_public.pem that was created in a previous step. At this point we can click create and we’re all set on the Google Cloud side.</p><h3>Device Setup</h3><p>Cool. So now we’re ready to get some code onto this device. For this we’re going to use some sample code from here: <a href="https://github.com/GoogleCloudPlatform/iot-core-micropython"><strong>https://github.com/GoogleCloudPlatform/iot-core-micropython</strong></a></p><pre>git clone https://github.com/GoogleCloudPlatform/iot-core-micropython</pre><pre>cd iot-core-micropython/</pre><p>In this repo there will be a file named config.py.example. This is a template config that you will need to update with your information. When you get to the jwt_config section, we’re going to have to do a little work around to get this working. I wasn’t able to get the pyasn1 library to run on the ESP32 in MicroPython due to memory constraints. (However, this might change in the future) This is used to encode and decode ASN.1 data types in to PEM or DER formats, which are the formats used by RSA. To work around this we’ll have to use our local machine to decode the private key and store the components of the key in a tuple. We’ll then use this with the RSA library. To read the values you can run:</p><pre>pip install rsa</pre><pre>python utils/decode_rsa.py</pre><p>And it should output 5 (very large) integers within parentheses. You’ll need to copy and paste this value into the jwt_config section for the private_key value. After you’ve updated the information you’ll need to rename the file to config.py.</p><p>Next, we will use ampy to copy the files to the device. We’ll do this by issuing the following 3 commands.</p><pre>ampy —-port $SERIALPORT —-baud 115200 put lib</pre><pre>ampy —-port $SERIALPORT —-baud 115200 put config.py</pre><pre>ampy —-port $SERIALPORT —-baud 115200 put main.py</pre><p>You can verify that the files are on the board by using an ampy ls command.</p><pre>ampy —-port /dev/tty.SLAB_USBtoUART —-baud 115200 ls</pre><pre>/boot.py<br>/config.py<br>/lib<br>/main.py</pre><p>At this point you can reset your board and view the output by using screen.</p><pre>screen -L /dev/tty.SLAB_USBtoUART 115200 -L</pre><p>If all goes well you should see output that looks something like this:</p><pre>Publishing message {“temp”: 113, “device_id”: “esp32-oled-1”}<br>Publishing message {“temp”: 114, “device_id”: “esp32-oled-1”}<br>Publishing message {“temp”: 114, “device_id”: “esp32-oled-1”}</pre><h3>Wrapping Up</h3><p>Congratulations! You now have your device sending data to IoT Core. You can view the message by opening up a cloud shell and running the command:</p><pre>gcloud pubsub subscriptions pull —-limit=10 —-auto-ack projects/[your-project-id]/subscriptions/[your-subscription-id]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iBPUUO9EeQhrUn9p" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3680e632681e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/connecting-micropython-devices-to-google-cloud-iot-core-3680e632681e">Connecting MicroPython devices to Google Cloud IoT Core</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>