Posts Tagged Raspberry Pi
For some reason, my SD card got corrupted. I had to re-build it.
The process to create new SD card for Windows 10 IoT Core is quite simple. All you need is the Windows IoT Dashboard application and an SD card (at least 8Gb is recommended).
- Start Windows IoT Dashboard application
- Give it a few seconds to populate Device type
- Select your device
- Insert you SD card into your computer
- Select your SD card in the Drive drop down list
- Click the “Download and install”
- The application will then download the image (this will take a few minutes). A progress bar is provided.
- Then a command line application will then write the image on the card (again this will take a few minutes). A progress bar is provided.
- When completed you get the following screen:
- Once your device is booted up, you should see it in the My device.
Re-imaging an SD is an easy strait forward process. It takes only 5-10 minutes and you get a brand new device.
You will loose any changes or information stored on your card. So you will have to re-configure it after.
I’ve had somewhat of an adventure with the Windows Update process on the Windows 10 IoT Core.
In the Windows Device Portal I was on the Windows Update page. So to make sure my device was up to date, I clicked the “Check for updates” button and … nothing happened on screen. Knowing that the process was probably running in the background, I moved on to check other pages.
When I came back to that screen later I got a You must restart your device to apply the updates kind of button. So I clicked on it and the device proceeded to reboot as expected. I got the cog wheel going and a progress bar for a number of minutes. Then I got a giant frown emoticon:
And the screen went blank. I waited for 30 minutes then turned off the device. Then turned it back on, got cog wheels for a few minutes, then frown, then blank. It had essentially screwed up the Operating System.
Flashing the SD card
I took out my SD card, placed it in my development machine. And proceeded to re-image it without issues. Placed the card back in my device and it started without issues.
In any case, it gave me the material to write a post about Flashing the SD card…
This happened to me on a brand new device with a new SD card that is part of a starter pack.
This may have been a bad fluke. But getting errors like this on a clean device is a bit worrisome.
Now that my development computer is setup, I wanted to look at some code. So I explored a little around the start up sample projects offered by Adafruit where I purchased the Microsoft IoT Pack for Raspberry Pi 2. I also looked at Microsoft supplied samples and the Raspberry Pi Foundation web site.
My goal here was: To look at code to understand the general anatomy of the process to develop IoT devices using the Raspberry Pi. To see someone using the GPOI in C#.
I found tons of good projects of all kind. I just wanted one that would be simple, but would give me an overall view. The one offered by Adafruit offered all the information I wanted:
This blog post clarified a number of points for me:
Windows Universal Application
Visual Studio offers a large amount project templates. Choosing the right template can mean the difference between success and re-doing everything. Unfortunately for me, having done mostly ASP.NET and MVC (with some WPF) applications for the past 15 years, I was not aware of the Windows Universal application thread.
I had already started coding some useful libraries that I wanted to re-use across multiple project types. I used the Portable Libraries project type for those. Of course, I could just copy/paste the code into a Windows Universal class library but that defeats the purpose of re-use… Some re-design will be required there for sure.
WPF User Interface on the Device
I did not expect this and I did not expect it would be this easy. You can write the User Interface for your application to run directly on the device.
Best of all it’s WPF and I am quite comfortable with it. I see great things happening in this department!
Coding the GPIO
Although the code in this application is very linear and repetitive (for simplicity purpose I am sure), it shows that the code to access and control the GPIO is simple. I did some additional research and figured out that: Yeah! This is actually really simple!
Building Electronic Circuit
Last time I wrote an electronic circuit was in 1992. I do have a lot updating to do. The section “Building out the circuit” in this sample was just what I needed to get me thinking about this again.
Perhaps the most interesting thing here is Fritzing . Fritzing is an application to create and document your electronic circuit prototype. That is definitely something I will have to explore deeper.
Running and Debugging
There is no talk about debugging, but running seems quite easy and strait forward. Just start the application on the device, provide device IP address and Voila!
I feel quite confident we can get this working and have fun doing it. This is going to be a lot easier than I expected!