Support
Wiki Documentation
Support Forum
Mobile
- andRoc Android
- Rocweb Browser
- WIO-Control ESP32
- Rocview Tablet
- RC-Cab Android
DIY
User
Wiki writer
Legal
Support
Wiki Documentation
Support Forum
Mobile
DIY
User
Wiki writer
Legal
The RASCII protocol uses HEXA for all fields except the prefix and remark text.
Prefix | Length | Command | Data | Example |
---|---|---|---|---|
@ | 00…FF | 00…FF | 0…n | @040101 |
Prefix | Length | Command | Data | Example |
---|---|---|---|---|
& | 00…FF | 00…FF | 0…n |
Prefix | Length | Event | Data | Example |
---|---|---|---|---|
$ | 00…FF | 00…FF | 0…n | $100200010102030405 |
Prefix | Length | Text | Example |
---|---|---|---|
# | 00…FF | 0…n | #0CRocDino V0.1 |
The info text may not contain any of the prefixes. This will make the message invalid and will be rejected.
Serial monitor input is a way to provide easy setting up a unit, for example the WiFi settings.
The input should be read until a linefeed has been detected, and do not have a length field.
Prefix | Remark |
---|---|
? | Should show help regarding monitor commands. |
Prefix | Example | Remark |
---|---|---|
* | *ssid=myhome | The help function should list up all possible settings. |
HEXA is the Hexadecimal-ASCII representation of a binary number.
A decimal value of 47, for example, is represented in HEXA as "2F".
Paratemers:
Returns: The byte value
byte HexA2Byte( const char* s ) { byte h, l, val; if( s[0] >= 'A' ) h = s[0] - 55; else h = s[0] -48; if( s[1] >= 'A' ) l = s[1] - 55; else l = s[1] -48; val = l + (h << 4); return val; }
Paratemers:
Returns: The pointer to the HEXA string buffer
const char* Byte2HexA(byte b, char* s) { static char cHex[] = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; s[0] = cHex[(b&0xF0)>>4]; s[1] = cHex[ b&0x0F ]; s[2] = '\0'; return s; }
Board # FF is broadcast.
Code | Board | Description | Parameters | Reply |
---|---|---|---|---|
0 | # | Get information | none | A remark with version information. |
1 | # | Start | none | A remark. |
2 | # | Stop | none | A remark. |
3 | # | Get config | none | The board configuration response. |
4 | # | Set config | The board configuration. | |
5 | # | Reset config | none | |
6 | # | Get CV | CV-High, CV-Low | A CV number and value response. |
7 | # | Set CV | CV-High, CV-Low, value | A remark. |
10 | # | Digital output | Address, port, on/off | - |
11 | # | Analog output | Address, Port, value | Value can be brightness, followed by three bytes RGB. |
12 | # | Accessory | Address, Port, aspect1) | - |
13 | # | Mobile speed | Address-High, Address-Low, direction/speed2) | - |
14 | # | Mobile function | Address-High, Address-Low, function, value, lights, fx | Lights and FX(32bit) are for information only and optional. |
37 | # | PT ON | none | A remark. |
38 | # | PT OFF | none | A remark. |
39 | # | Accessory CV get | Address-High, Address-Low, CV-High, CV-Low | A CV number and value response. |
40 | # | Accessory CV set | Address-High, Address-Low, CV-High, CV-Low, value | A remark. |
Board # FF is broadcast.
Code | Board | Description | Parameters | Remark |
---|---|---|---|---|
1 | # | Occupancy | Port, Status on/off | |
2 | # | RFID | Port, RFID bytes | All RFID bytes may be set zero to signal depart. Sending a one byte zero ID will also be evaluated as departed. |
3 | # | Digital input | Port, on/off | |
4 | # | Analog input | Port, value H/L |
Events maybe acknowledged by the host program.
Some Windows configurations will crash at Rocrail server startup if the Arduino is connected by USB and the following option is not set: