Skip to content

Commit 4a8f35e

Browse files
committed
feat: drop HTTPS / SSL
Chrome allows unecrypted connections to localhost from secure origins, so this can work over HTTP without all the complexity that SSL adds.
1 parent 56670de commit 4a8f35e

File tree

4 files changed

+14
-65
lines changed

4 files changed

+14
-65
lines changed

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,29 @@
1111

1212
## Connecting from the Wokwi Simulator
1313

14-
1. Open https://localhost:2442 and confirm the untrusted localhost SSL certificate (if you don't want to do this every time, [please follow these instructions](https://stackoverflow.com/questions/21397809/create-a-trusted-self-signed-ssl-cert-for-localhost-for-use-with-express-node)).
15-
2. Open any Arduino project on [wokwi.com](wokwi.com), e.g. [blink](https://wokwi.com/arduino/libraries/demo/blink), and start the simulation.
16-
3. In the code editor, press "F1" and select "Open Debug Web Socket".
17-
4. You'll see a prompt asking for a URL to connect to. Confirm the default URL.
14+
1. Open any Arduino project on [wokwi.com](wokwi.com), e.g. [blink](https://wokwi.com/arduino/libraries/demo/blink), and start the simulation.
15+
2. In the code editor, press "F1" and select "Open Debug Web Socket".
16+
3. You'll see a prompt asking for a URL to connect to. Confirm the default URL.
1817

1918
## Connecting from GDB
2019

21-
1. Install avr-gdb (`apt install gdb-avr` on Ubuntu). You can find a pre-built Windows binary inside [this package](http://downloads.arduino.cc/tools/avr-gcc-7.3.0-atmel3.6.1-arduino5-i686-w64-mingw32.zip).
22-
2. Run `avr-gdb`
23-
3. Write: `target remote localhost:3555`
20+
You'll need to use a GDB build that works with the architecture you are debugging. For instance, debugging Arduino requires avr-gdb (`apt install gdb-avr` on Ubuntu). You can find a pre-built Windows binary inside [this package](http://downloads.arduino.cc/tools/avr-gcc-7.3.0-atmel3.6.1-arduino5-i686-w64-mingw32.zip).
2421

25-
That's it! You can now debug the simulated AVR code using GDB. Here are some quick commands to get you started:
22+
1. Start gdb
23+
2. Write: `target remote localhost:3555`
24+
25+
That's it! You can now debug the simulated code using GDB. Here are some quick commands to get you started:
2626

2727
- `stepi` - Execute the next instruction
2828
- `c` - Continue running the program (press Ctrl+C to break)
2929
- `print $sp` - Prints the value of the Stack Pointer (SP)
3030
- `where` - Show stack trace
31-
- `set $r10 = 5` - Change the value of the R10 registers
31+
- `set $r10 = 5` - Change the value of the R10 register
3232
- `disas $pc, $pc+16` - Disassemble the next few instructions
3333
- `info registers` - Dump all registers (r0-r31, SREG, SP, pc)
3434

35+
For more useful commands, check the [AVR GDB Cheatsheet](https://blog.wokwi.com/gdb-avr-arduino-cheatsheet/)
36+
3537
## Debugging with Symbols
3638

3739
If you want source-level debugging (with symbols and everything), first

gdbserver.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66

77
const { createServer } = require('net');
88
const WebSocket = require('ws');
9-
const https = require('https');
10-
const fs = require('fs');
9+
const http = require('http');
1110

1211
const WS_PORT = 2442;
1312
const GDB_PORT = 3555;
@@ -16,13 +15,8 @@ const DEBUG = false;
1615
const gdbserver = createServer();
1716
gdbserver.listen(GDB_PORT);
1817

19-
const options = {
20-
key: fs.readFileSync('ssl/key.pem'),
21-
cert: fs.readFileSync('ssl/cert.pem'),
22-
};
23-
24-
const server = https
25-
.createServer(options, function (req, res) {
18+
const server = http
19+
.createServer(function (req, res) {
2620
res.writeHead(200);
2721
res.end(`Wokwi gdbserver listening on local port ${GDB_PORT}.\n`);
2822
})

ssl/cert.pem

Lines changed: 0 additions & 20 deletions
This file was deleted.

ssl/key.pem

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)