goHACK.me Slave Mode
This example demonstrates how to use the WiConnect goHACK.me API in slave mode with a PC terminal acting as the host (instead of a microprocessor).
By the time you have completed this demonstration, you will be able to ...
- Connect your ACKme device with goHACK.me (and setup a goHACK.me account if you don't already have one)
- Send samples of data streams to goHACK.me for device monitoring
- Receive control parameters from goHACK.me for device control
- Send messages between your device and goHACK.me for messaging
To get started, let's factory reset your board to ensure that any existing configuration does not get in the way of the demo. Use the commands shown below as a guide to factory reset the board now.
If your board is already activated with goHACK.me, we need to deactivate in order to setup a new caps file. Sign in to goHACK.me and deactivate it now. If this is your first time connecting a board to goHACK.me, don't worry, we'll soon have you setup and ready to go.
Connect to Wi-Fi
Connect your board to your Wi-Fi network using the network_up command as shown below.
Create a Caps File
Create a demo caps file by copy and pasting the following text into the terminal. This is a simple caps file that only has 1 stream and 1 control, and sets up message boxes to enable messaging with goHACK.me.
Set the Caps File
Use the ghm_capabilities command to set the caps file for use with goHACK.me as shown below.
If you do not already have an account on the goHACK.me website, go to goHACK.me and create a free account. Activate the board with goHACK.me by using the ghm_activate command.
Open a web browser and connect to goHACK.me, and login. Select the Device tab in the vertical column at the left of the webpage and your device appears.
Write Streams & Read Controls
Now for some fun! Enter the following commands one-by-one, taking note of the instructions in the right-hand column.
Send a message to goHACK.me
Read a message from goHACK.me
To read messages from goHACK.me, you first have to use goHACK.me to send a message. Setup a message entry board on goHACK.me as follows ...
- Select a dashboard
- Click the + in the top right corner
- Select "gHm Slave Demo"
- Select "Messages" | "To Device"
- Select "Enter Message"
- Enter a name for the message panel (or use the default)
- Select "Done" In the message panel that appears, enter a text message and click "send". Use the following commands to read the message. The WiConnect stream API is used to actually read text from the message.
For completeness, the following text provides an example session log of reading a message from goHACK.me.
|WiConnect Session Log - Reading a Message|