|
| 1 | +--- |
| 2 | +title: Controlling a Physical Device via Moonchain |
| 3 | +sidebar_position: 11 |
| 4 | +--- |
| 5 | + |
| 6 | +This demonstration showcases the ability to control a physical device using Moonchain. It highlights how a blockchain transaction on Moonchain can remotely turn an LED on or off. Through this process, you will see the seamless integration of blockchain technology with real-world hardware, emphasizing the potential for secure, decentralized control in various applications. |
| 7 | + |
| 8 | +## Moonchain Info |
| 9 | + |
| 10 | +Contract proposals: [https://github.com/MXCzkEVM/MEPs](https://github.com/MXCzkEVM/MEPs) |
| 11 | + |
| 12 | +Deployed Contract addresses: |
| 13 | + |
| 14 | +- MEP801: 0x070B3e2229a27CDd34126E96B2Ce65c63BD1A5CE |
| 15 | +- MEP802: 0x28479D68cD3ef5661BDB7505EFD1712D5D0951F6 |
| 16 | +- MEP803: 0xBFc77Ee5959699eC4171891b625D6EccdC9e00cD |
| 17 | + |
| 18 | +The commands shown in this document use the wallet `0xa2d9E584F4cF0167d283dB6EB4922082269B6bB7` as an example. And you need MXC to pay the gas fee and other fees. |
| 19 | + |
| 20 | +Private key: |
| 21 | + |
| 22 | + 318dee0c207c20f4767e342a52e876b816379334a53277773c783b0e9348d368 |
| 23 | + |
| 24 | + |
| 25 | +## Change the X2E firmware |
| 26 | + |
| 27 | +If your X2E board is running another firmware, please follow the procedures below to change the firmware for this demonstration. |
| 28 | + |
| 29 | +Firmware Repository: [https://github.com/MXCzkEVM/Moonchain-Control-X2E](https://github.com/MXCzkEVM/Moonchain-Control-X2E) |
| 30 | + |
| 31 | +1. Download the mobile APP tool (Nordic DFU) for firmware update. |
| 32 | + - [Google Play Store](https://play.google.com/store/apps/details?id=no.nordicsemi.android.dfu&hl=en&gl=US) |
| 33 | + - [Apple App Store](https://apps.apple.com/tt/app/nrf-device-firmware-update/id1624454660) (require iOS 16) |
| 34 | + |
| 35 | +2. Copy the firmware binary file `demo_controls_dfu_ism2400.zip` to your mobile phone. |
| 36 | + - (Important: Place the file in the download folder, otherwise it may not be recognized correctly) |
| 37 | + |
| 38 | +3. Start the DFU App and select the firmware binary file. |
| 39 | +  |
| 40 | + |
| 41 | +4. Tap the Device's "Select" button to start scanning for BLE devices. |
| 42 | + |
| 43 | +5. Press and hold the "USER" button of the X2E board for 5s to start the DFU routine. The LED will become fast blinking when DFU started and it will shows up on the App. |
| 44 | +  |
| 45 | + |
| 46 | +6. Select the X2E board on the list as the target device. |
| 47 | +  |
| 48 | + |
| 49 | +7. Tap the "Start" button to start the firmware upgrade. |
| 50 | +  |
| 51 | + |
| 52 | +8. Wait until the upgrade process completes. |
| 53 | + |
| 54 | +## Connection of X2E |
| 55 | + |
| 56 | +The simplest way to demonstrate the effect is by controlling an LED. Below is an example of the connection. |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | +## Purchase a Provision ID (PID) |
| 61 | + |
| 62 | +Find a temporary email service provider to get the email address for receiving the PID. As the email address will be on the Moonchain, using a temporary email address can prevent your private email address from showing to the public on the chain. |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | +Check the device profile (from MEP803) that we will be using. It needs to match the firmware of the X2E board. We will be using an existing ISM2400 profile, with the index set to 3. |
| 67 | + |
0 commit comments