Created
August 4, 2024 14:23
-
-
Save maxpromer/db33022aed77228253b6f2ee59359d10 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "OThreadCLI.h" | |
void setup() { | |
Serial.begin(115200); | |
OThreadCLI.begin(false); // No AutoStart - fresh start | |
// Start Console | |
Serial.println("OpenThread CLI started - type 'help' for a list of commands."); | |
OThreadCLI.startConsole(Serial); | |
// Send Command | |
OThreadCLI.println("dataset init new"); | |
OThreadCLI.println("dataset networkkey 573f031c08ef326c288f3f33f791c401"); | |
OThreadCLI.println("dataset networkname OpenThread"); | |
OThreadCLI.println("dataset panid 0x550c"); | |
OThreadCLI.println("dataset extpanid fa283d35a4c0cf9d"); | |
OThreadCLI.println("dataset meshlocalprefix fdff:e519:cd12:ec6::"); | |
OThreadCLI.println("dataset channel 12"); | |
OThreadCLI.println("dataset commit active"); | |
OThreadCLI.println("ifconfig up"); | |
OThreadCLI.println("thread start"); | |
OThreadCLI.println("ipmaddr add ff05::abcd"); | |
OThreadCLI.println("udp open"); | |
OThreadCLI.println("udp bind :: 20617"); | |
} | |
void loop() { | |
String line = OThreadCLI.readStringUntil('\n'); | |
if (line.length() > 0) { | |
Serial.println(line); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment