... | ... | @@ -9,7 +9,7 @@ |
|
|
|
|
|
<p id="top"></p>
|
|
|
|
|
|
### Features
|
|
|
## Features
|
|
|
* **Estimated Time: 1 Hour (basic; base lab) - 4 Hours (advanced; enhancements)**
|
|
|
* **Appropriate Grades: 6-12**
|
|
|
* **Topic Alignment:** ( **L**imited, **M**edium, **H**igh )
|
... | ... | @@ -39,10 +39,10 @@ |
|
|
| Think Like an Adversary | H |
|
|
|
| Keep It Simple | L |
|
|
|
|
|
|
### Description
|
|
|
## Description
|
|
|
You will learn about radio signals through beacon detection. We have provided the code for the beacon(s), which simply sends their ID over their specified group/channel. You will implement scanners that listen for beacons and leads you to the location of the beacon by measuring signal strength.
|
|
|
|
|
|
### Step 0: The Basics
|
|
|
## Step 0: The Basics
|
|
|
* Micro::Bit Coding Options
|
|
|
* [Click here to code with JavaScript/Blocks] (https://makecode.microbit.org)
|
|
|
* [Click here to code with MicroPython](https://python.microbit.org)
|
... | ... | @@ -51,12 +51,12 @@ You will learn about radio signals through beacon detection. We have provided th |
|
|
* [Click here for information on beacons] (https://kontakt.io/beacon-basics/what-is-a-beacon/)
|
|
|
* [Click here for Micro::Bit radio basics](https://makecode.microbit.org/reference/radio)
|
|
|
|
|
|
### Step 1: Gather Materials
|
|
|
## Step 1: Gather Materials
|
|
|
* Micro::Bit
|
|
|
* Micro-USB Cable
|
|
|
* Battery Pack (Equivalent to two AA batteries)
|
|
|
|
|
|
### Step 2: Get Familiar With Beacons
|
|
|
## Step 2: Get Familiar With Beacons
|
|
|
Beacons are rarely moved after they are set up. Beacons send out one-way messages that receivers can acquire if they are within range. Below is an example of the most basic implementation of a beacon on a Micro::Bit in Javascript, shown with Blocks as well as the code.
|
|
|
|
|
|
![Screen_Shot_2018-06-24_at_2.56.49_PM](/uploads/f8ee4d06accd90ab8b9023433d711785/Screen_Shot_2018-06-24_at_2.56.49_PM.png)
|
... | ... | @@ -77,7 +77,7 @@ basic.forever(() => { |
|
|
Groups are very similar to channels. Even if you are in range of a beacon, you cannot receive their messages if you are not on the same channel as the beacon.
|
|
|
The beacon shown above will set the group to 1, so it can be heard from any in-range receiver listening to group 1. Then, the beacon above repeatedly sends the number 0 over the radio and shows a diamond pattern on the screen. It is not necessary to display the diamond pattern, however it is useful for debugging purposes in more complex beacons.
|
|
|
|
|
|
### Step 3: Download The Files
|
|
|
## Step 3: Download The Files
|
|
|
* Download (click on) the following file to get started: [BeaconLab.zip](/uploads/c352ac346a5cf5ea40d9bcc88f0e0152/BeaconLab.zip)
|
|
|
|
|
|
* Unzip BeaconLab.zip (right click on the BeaconLab.zip and select "extract all". Then, just pick where you want to save your copy of these files). Notice there are three folders/directories in BeaconLab:
|
... | ... | @@ -87,19 +87,19 @@ The beacon shown above will set the group to 1, so it can be heard from any in-r |
|
|
|
|
|
![files_new](/uploads/db7d5badc4c093fab35c294881ace7e4/files_new.PNG)
|
|
|
|
|
|
### Step 4: Open your editor.
|
|
|
## Step 4: Open your editor.
|
|
|
For JavaScript/Blocks, you will use the Micro::Bit online editor: [MakeCode](https://makecode.microbit.org/). Here, you can switch back and forth between JavaScript and Blocks by clicking on the button/slider in the top center of the screen.
|
|
|
|
|
|
![blocks](/uploads/7061a5064100caa0790c714bdb1182c1/blocks.PNG)
|
|
|
|
|
|
For Python, you will have to use the beta version of Mu: [Mu 1.0.0.beta.15](https://github.com/mu-editor/mu/releases/tag/v1.0.0.beta.15).
|
|
|
|
|
|
### Step 5: Flash the base code.
|
|
|
## Step 5: Flash the base code.
|
|
|
Here is a .hex file with the base code: [Base.hex](/uploads/b71c963e764972c0780481b4ca69b68a/Base.hex).
|
|
|
|
|
|
This base code is also available in the directory that you downloaded as well as this repository. If you don't remember how to flash code to your Micro::Bit, see the instructions [here](how-to-flash).
|
|
|
|
|
|
### Step 6: Programming!
|
|
|
## Step 6: Programming!
|
|
|
1. Test the base code. This code should start by displaying a diamond. When you are in range of the beacon, it will show a check mark. Then, open up the base code by doing the following:
|
|
|
1. Go to the files you downloaded from above
|
|
|
2. Double-click on the JavaScript or Python folder
|
... | ... | @@ -541,7 +541,7 @@ This base code is also available in the directory that you downloaded as well as |
|
|
|
|
|
|
|
|
|
|
|
### Step 7: Further Exploration
|
|
|
## Step 7: Further Exploration
|
|
|
* Can you think of a better receiver than the tune-able one? What if your receiver scanned all of the possible group ids for you? What if the receiver always tracked the strongest signal? What else can you think of? Spend some time exploring with your Micro::Bit and see what kind of improvements you can make. The sky is the limit. Below is the JavaScript and blocks of a scanning receiver that we built in the CEDAR lab (Cybersecurity EDucation And Research) and it is also available in the directory you downloaded.
|
|
|
<details>
|
|
|
<summary>
|
... | ... | |