Introduction: Pixel Kit Running MicroPython: First Steps
The journey to unlock the full potential of Kano's Pixel starts with replacing the factory firmware with MicroPython but that is only the beginning.
In order to code on the Pixel Kit we must connect our computers to it.
This tutorial will explain what the boot screens mean, how to access the terminal page and how to connect to Pixel Kit.
Step 1: Boot Screens
When your Pixel Kit boots up it shows a few screens to let you know what it's doing and its state. Here is what they mean:
- Orange: Trying to connect.
- Blue: Created its own wifi network.
- Green: Connected to a wifi network.
- Red: Tried to connect to a wifi network and failed.
When Pixel Kit creates its own wifi network, It should be named something like PIXEL_KIT_XXXX but with a number instead of the XXXX.
The first time your Pixel Kit boots it will always display the blue screen.
In cases your Pixel Kit is connected to (green screen) or created a wifi network (blue screen), it will display its ip address in binary format: Red dots mean 1, no dots mean 0.
Step 2: Accessing the Terminal Page
If your Pixel Kit boots to the blue screen, you will find an open wifi network named PIXEL_KIT_*NUMBERS*.
To open the terminal page in your browser, make sure you are connected to the Pixel Kit wifi network and navigate to http://192.168.4.1. You will see the page on the pictures. Although it's accessible via this address, it's strongly recommendedto click on the download button and save this page offline. It will work just the same but way faster!
The Pixel Kit ip address while displaying the blue screen will never change: it will always be http://192.168.4.1.
If your Pixel kit boots to the green screen, it will display its ip address on the network it's connected. We'll assume it's connected to the same network as your computer but if it's not, check the last step on how to recover/reconnect your Pixel Kit.
Once you make sure your computer and Pixel Kit are connected to the same network, navigate to its ip address to access the terminal page.
Step 3: Saving Terminal Page to Your Computer
When you access the terminal browser from your Pixel Kit ip, your Pixel Kit is behaving like a web server: It hosts a web page that you can access on your browser. Every time you request or refresh this page, the Pixel Kit must stop everything it's doing and answer this request.
While it's awesome Pixel Kit can behave like a web server, it was not meant to be a web server and sometimes it can be very slow. The good news is once you have loaded the terminal page, you can save it offline!
To save the terminal page offline, click on the download button on the sidebar. It will automatically save the file on your "Downloads" folder but you can move and rename it to wherever you want.
Step 4: Connecting to Pixel Kit
With your terminal page opened and after you made sure your Pixel Kit and computer are on the same network (either the one Pixel Kit created itself or the one you connected it to) and type the ip address in binary or decimal format. It will look something like this:
If you want to know how to convert binary numbers in decimal, check this link: https://www.instructables.com/howto/how+to+convert+binary+to+decimal/
Once connected the headers will turn green and you will be presented to a Python REPL: Read, Evaluate, Print and Loop. Yay!
Step 5: Connecting to a Wifi Network
While connected on the network created by the Pixel Kit you won't have access to internet.
If you want to code and have access to internet at the same time you must connect the Pixel Kit to a wifi network that has internet. The computer you will use to code and your Pixel Kit must always be connected to the same network.
The easiest way to connect to a wifi network is to run "saveWifiConf(ssid, passord)" on the REPL where ssid is the name of the network you want your Pixel Kit to connect and password is the network password:
After running "saveWifiConf(ssid, password)", you must turn your Pixel Kit off and on again to apply the changes.
Pro tip: You can reset your Pixel Kit from the terminal page by typing the following command:
Your terminal will loose connection once you restart your Pixel Kit. If you saved your terminal page offline, just refresh it and connect to the new ip displayed on the green screen(once your computer reconnects to the wifi you just connected your Pixel Kit to).
If you haven't saved the page offline, convert the binary number displayed by the Pixel Kit into an ip and access it from your browser.
Step 6: Recovery/Offline Mode
At any time, turn your Pixel Kit off and on again while holding both red buttons to gently force it to show the blue screen.
This is very useful in a few cases:
- You have connected to the wrong wifi network, wrong password, typo, etc... In this cases Pixel Kit will boot to the red screen and forcing the blue screen is the only way to connect again to the Pixel Kit.
- The wifi network you connected is not available anymore. This can be due to technical problems but it also can be because you connected to your home wifi and now you are at school or a friend's place. Entering the blue screen will allow you to connect to a new wifi network.
- We seem to live in a connected world but I believe we should not rely on network availability to be able to learn, make things and be creative! If you want to code your Pixel Kit 100% offline or if there is no wifi available, make your Pixel Kit enter in the blue screen and happy coding!
Step 7: Code With Lights!
You can find all the documentation of things you can do with your Pixel Kit running Pixel32 on:
But Pixel Kit also have all the documentation offline! You can access it by clicking on the question mark button or by navigating to http://192.168.4.1/index.html/#!/docs if your Pixel Kit is showing the blue screen. If your Pixel Kit is showing the green screen it will be http://IP_ADDRESS/index.html/#!/docs.
There are basically two ways to draw on Pixel Kit LEDs: PixelTurtle and PixelKit libraries.
The first one is the simplest way to get started and you can find all it can do at:
The second one is a more advanced library (PixelTurtle is written using it) and you will find how to use it at:
If you are having trouble with Python, there is also a quick introduction included on the offline documentation and on the following links:
If you are having a problem that is not described on the documentation, have a look on the troubleshooting / FAQ page:
For inspirational videos on what can be done by Pixel Kit, check the Tutorial pages: