SIOT Logs
Blinking only drives an output on a timer. Button-to-LED also has to read an input, so the program has to react to the outside world: configure a pin as input, give it a defined idle level, and decide when to check it.
The blink program only ever writes: set the pin high, wait, s...
Q GET must never change a resource. Why does that rule matter, and what goes wrong if an IoT server op...
GET is defined as safe: clients, browsers, proxies and crawlers may send it at any time, repeat it, prefetch it or cache it, assuming nothing happens. A door that opens on GET can be opened by a link preview, a prefetch or a retry, and the command is trivial to trigger and repeat...
Q When flashing a binary without its project, why use minicom -b 115200 -D /dev/ttyUSB0 as the serial...
idf.py monitor expects an ESP-IDF project and uses its ELF file to decode crash addresses. With only a .bin there is no project and no ELF. Any plain serial terminal works instead, as long as it uses the firmware's baud rate, 115200 by default.
idf.py monitor is a serial terminal...
Q The button is wired between IO4 and GND, with nothing connected to 3.3 V. How does the ESP32 read a...
Enable the internal pull-up on IO4. Released, the resistor pulls the pin up to 3.3 V and it reads 1. Pressed, the button connects the pin to GND and it reads 0. The button is active low.
* The pull-up gives the pin a level when the switch is open; the switch only ever pulls it d...
Q What is Wireshark, and what does it show about the traffic it captures?
A free, open-source packet analyser. It captures every packet entering or leaving a network interface (through the pcap library) and decodes each one layer by layer: addresses, ports, protocol fields and, for unencrypted traffic, the payload itself.
Wireshark runs on Linux, macOS...
Q An attacker has physical access to an ESP32-based device. What can they do through its USB serial po...
Read the whole flash (firmware, Wi-Fi credentials, server addresses, keys) and write their own firmware. Flash encryption makes the dump unreadable, and secure boot makes the chip refuse unsigned firmware.
The same tool that flashes a board also reads it. esptool read-flash 0 0x4...
Q What happens if a button input has no pull-up or pull-down resistor at all?
While the button is open, the pin is floating: connected to nothing, so it picks up noise and reads random 0s and 1s. The LED flickers, or turns on when you only touch the wire.
A digital input draws almost no current. That is what makes it good at sensing a voltage, and also wha...
Q How do tcpdump and Wireshark divide the work in sudo tcpdump -w capture.pcap -i wlp4s0, followed by...
tcpdump is the lightweight command-line capturer: it records raw packets from the interface (-i wlp4s0, the Wi-Fi card) into a pcap file (-w capture.pcap). Wireshark is the graphical analyser that opens that file to filter and decode it. Both need root because capturing reads raw...
Q The "open" button is wired between GPIO0 and GND. Why does holding it while the board resets stop th...
GPIO0 is a strapping pin. If it is low at reset, the ESP32 enters its serial bootloader (download mode) instead of running the app. A button from GPIO0 to GND held during reset does exactly that, which is also how the board's own BOOT button works.
At reset the ESP32 samples a fe...
Q Why can one press of a push button register as several presses, and how is that fixed?
The metal contacts bounce: for a few milliseconds the switch opens and closes rapidly before it settles, so the pin sees several edges. Debouncing accepts a new state only after it has been stable for a while, typically 10-50 ms.
* The chip is fast enough to see every bounce as...