├── .vscode ├── launch.json └── settings.json ├── README.md └── index.html /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "chrome", 9 | "request": "launch", 10 | "name": "Launch Chrome against localhost", 11 | "webRoot": "${workspaceFolder}", 12 | "file": "${workspaceFolder}/index.html", 13 | "disableNetworkCache": true 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "debug.allowBreakpointsEverywhere": true 3 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Cyber Robot [Web Interface](https://rogalmic.github.io/cyber-robot-web-if/) 2 | [Clementoni Cyber Robot](https://www.google.pl/search?q=Clementoni+cyber+robot&source=lnms&tbm=isch) web access via Google Chrome 3 | 4 | Chrome's Web Bluetooth "experimental web platform" feature in `chrome://flags/#enable-experimental-web-platform-features` (this needs to be done separately for Chrome-vscode debugging process, since different user folder is used). `Debugger for Chrome` extension needs to be installed to debug via VS Code launch configuration. [Link](https://rogalmic.github.io/cyber-robot-web-if/) to working sample after enabling BT. 5 | 6 | Some info about protocol - [CyberRobotBrain java project](https://github.com/prof18/CyberRobotBrain/tree/master/app/src/main/java/com/clemgmelc/cyberrobotbrain) 7 | 8 | 9 | # Bluetooth specific details 10 | 11 | Some bluetooth Gatt info about the device: 12 | 13 | ``` 14 | BTHLEDevice\{00001800-0000-1000-8000-00805f9b34fb}_Dev_VID&0100c0_PID&0000_REV&0000_1b7e9706073d\9&8c643bc&0&0001 15 | BTHLEDevice\{00001801-0000-1000-8000-00805f9b34fb}_Dev_VID&0100c0_PID&0000_REV&0000_1b7e9706073d\9&8c643bc&0&000c 16 | BTHLEDevice\{0000180a-0000-1000-8000-00805f9b34fb}_Dev_VID&0100c0_PID&0000_REV&0000_1b7e9706073d\9&8c643bc&0&0010 17 | BTHLEDevice\{0000feba-0000-1000-8000-00805f9b34fb}_Dev_VID&0100c0_PID&0000_REV&0000_1b7e9706073d\9&8c643bc&0&0027 18 | BTHLEDevice\{0000fff0-0000-1000-8000-00805f9b34fb}_Dev_VID&0100c0_PID&0000_REV&0000_1b7e9706073d\9&8c643bc&0&0047 19 | BTHLEDevice\{0000fff3-0000-1000-8000-00805f9b34fb}_Dev_VID&0100c0_PID&0000_REV&0000_1b7e9706073d\9&8c643bc&0&0051 20 | ``` 21 | 22 | ``` 23 | Requesting any Bluetooth Device... 24 | Connecting to GATT Server... 25 | Getting Services... 26 | Getting Characteristics... 27 | > Service: 00001800-0000-1000-8000-00805f9b34fb 28 | >> Characteristic: 00002a00-0000-1000-8000-00805f9b34fb [READ] 29 | >> Characteristic: 00002a01-0000-1000-8000-00805f9b34fb [READ] 30 | >> Characteristic: 00002a02-0000-1000-8000-00805f9b34fb [READ] 31 | >> Characteristic: 00002a04-0000-1000-8000-00805f9b34fb [READ] 32 | > Service: 00001801-0000-1000-8000-00805f9b34fb 33 | >> Characteristic: 00002a05-0000-1000-8000-00805f9b34fb [READ, INDICATE] 34 | > Service: 0000180a-0000-1000-8000-00805f9b34fb 35 | >> Characteristic: 00002a24-0000-1000-8000-00805f9b34fb [READ] 36 | >> Characteristic: 00002a29-0000-1000-8000-00805f9b34fb [READ] 37 | >> Characteristic: 00002a23-0000-1000-8000-00805f9b34fb [READ] 38 | >> Characteristic: 00002a26-0000-1000-8000-00805f9b34fb [READ] 39 | >> Characteristic: 00002a27-0000-1000-8000-00805f9b34fb [READ] 40 | >> Characteristic: 00002a28-0000-1000-8000-00805f9b34fb [READ] 41 | >> Characteristic: 00002a50-0000-1000-8000-00805f9b34fb [READ] 42 | > Service: 0000feba-0000-1000-8000-00805f9b34fb 43 | >> Characteristic: 0000fa12-0000-1000-8000-00805f9b34fb [READ] 44 | >> Characteristic: 0000fa10-0000-1000-8000-00805f9b34fb [WRITEWITHOUTRESPONSE, NOTIFY] 45 | >> Characteristic: 0000fa11-0000-1000-8000-00805f9b34fb [WRITE, INDICATE] 46 | > Service: 0000fff3-0000-1000-8000-00805f9b34fb 47 | >> Characteristic: 0000fff4-0000-1000-8000-00805f9b34fb [NOTIFY] 48 | >> Characteristic: 0000fff5-0000-1000-8000-00805f9b34fb [WRITEWITHOUTRESPONSE] // MOVEMENT CHARACTERISTICS HERE 49 | > Service: 0000fff0-0000-1000-8000-00805f9b34fb 50 | >> Characteristic: 0000fff1-0000-1000-8000-00805f9b34fb [NOTIFY] 51 | >> Characteristic: 0000fff6-0000-1000-8000-00805f9b34fb [NOTIFY] 52 | >> Characteristic: 0000fff2-0000-1000-8000-00805f9b34fb [WRITE, NOTIFY] 53 | ``` 54 | 55 | ``` 56 | Requesting any Bluetooth Device... 57 | Connecting to GATT Server... 58 | Getting Device Information Service... 59 | Getting Device Information Characteristics... 60 | > Manufacturer Name String: AMICCOM Elec. 61 | > Model Number String: MD7107 62 | > System ID: 63 | > Manufacturer Identifier: 55AA55AA55 64 | > Organizationally Unique Identifier: AA55AA 65 | > Manufacturer Name String: AMICCOM Elec. 66 | > Firmware Revision String: 01.1 67 | > System ID: 68 | > Manufacturer Identifier: 55AA55AA55 69 | > Organizationally Unique Identifier: AA55AA 70 | > Hardware Revision String: U01 71 | > Firmware Revision String: 01.1 72 | > Software Revision String: 0093 73 | > Hardware Revision String: U01 74 | > PnP ID: 75 | > Vendor ID Source: Bluetooth 76 | > Vendor ID: 192 77 | > Product ID: 0 78 | > Product Version: 0 79 | > Software Revision String: 0093 80 | > PnP ID: 81 | > Vendor ID Source: Bluetooth 82 | > Vendor ID: 192 83 | > Product ID: 0 84 | > Product Version: 0 85 | ``` 86 | 87 | # Cyber Robot Sample Javascript Communication 88 | 89 | Kindof-working communication sample (after enabling experimental feature in chrome): 90 | ``` 91 | navigator.bluetooth.requestDevice({ filters: [{ services: ['0000fff3-0000-1000-8000-00805f9b34fb'] }] }) 92 | .then(device => device.gatt.connect()) 93 | .then(server => server.getPrimaryService('0000fff3-0000-1000-8000-00805f9b34fb')) 94 | .then(service => service.getCharacteristic('0000fff5-0000-1000-8000-00805f9b34fb')) 95 | .then(characteristic => { 96 | var forwardCommand = Uint8Array.of(0x31, 0x32, 0x44, 0x30, 0x53, 0x2d, 0x31); 97 | return characteristic.writeValue(forwardCommand); 98 | }) 99 | .then(_ => { 100 | console.log('Command sent.'); 101 | }) 102 | .catch(error => { console.log(error); }); 103 | ``` 104 | 105 | # Cyber Robot Protocol 106 | 107 | Single messages (full ASCII): 108 | ``` 109 | move = `12D${p1}S${p2}` 110 | sound = `56${p1}E` 111 | led = `78${p1}` 112 | stop = `99SP` 113 | ``` 114 | Sequence messages: 115 | ``` 116 | binary_sequence[20] = `34(0x11, ..., 0x34)` 117 | 118 | binarystart = 51 , 52 (`34`) 119 | binaryforward = 0-3 120 | binaryback = 4-7 121 | binaryleft = 8-11 122 | binaryright = 12-15 123 | binarystop = 17 124 | binaryled = 18 - ? 125 | binaryvoice = 22 - ? 126 | binaryendsequence = 52 127 | ``` 128 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Cyber Robot Chrome controller 7 | 159 | 160 | 208 | 209 | 210 | 211 |
212 | 218 | 219 | 220 | 221 | 222 | 223 |
224 | 225 | 226 | 227 | --------------------------------------------------------------------------------