A lightweight lora mesh network written in c++
- Arduino Mega Compatable
- Flooded mesh networking
- Routed mesh networking
- API for external programs
- Encryption
- More to come
To send a message to everyone open your serial and type
send 0xFFFFFFFF "hello world"
Gets a list of commands
help
Sends a messsage to the target address
send <address> <message>
Examples
sendex 0x01234567 "hello"
Sends a message to 0x01234567
sendex 0xFFFFFFFF "hello everyone"
Sends a message to everyone
Sends a message to the target address with some extra options
sendex <address> <message> <type> <service> <flags>
Examples
sendex 0x01234567 "hello" 0 0 0b00000000
Sends a message to 0x01234567 (same as 'send 0x01234567 "hello"')
sendex 0x01234567 "ping" 0 1 0b00000000
Sends a remote command to 0x01234567
sendex 0xFFFFFFFF "hello everyone" 0 0 0b00000000
Sends a message to everyone (same as 'send 0xFFFFFFFF "hello everyone"')
sendex 0xFFFFFFFF "hello neighbors" 0 0 0b10000000
Sends a message to neighboring nodes
Sends a message to the target address with some extra options and base64
send64 <address> <base64> <type> <service> <flags>
Example
send64 0x01234567 "aGVsbG8=" 0 0 0b00000000
Sends a message to 0x01234567 (this is sendex with base64)
To send a remote command you need to use sendx
sendex <address> "<command> <args>" 0 1 0b00000000
ping
Will return "pong"
uptime
Will return the nodes uptime in "HH:MM:SS"
In src/commands.cpp
create a function called rcmd_yourcommandname
void rcmd_yourcommandname(MyRemoteCommandParser::Argument *args, char *res) {
char* response = "hello world";
strlcpy(res, response, MyRemoteCommandParser::MAX_RESPONSE_SIZE);
}
Then add this at the bottom of void registerRemoteCommands() {}
remoteParser.registerCommand("yourcommandname", "", &rcmd_yourcommandname);
Lastly add this before #endif
in src/commands.h
void rcmd_yourcommandname(MyRemoteCommandParser::Argument *args, char *res);