AVR assembly ingest

Push DS18B20 readings from an ATmega328P in GNU AVR assembly with a W5100 Ethernet shield. No Arduino C: avr-gcc, avrdude, and the same LAN HTTPS relay as the Uno Ethernet sketch.

Close-up of white Cat-5e Ethernet cables with RJ45 connectors
Probe JSON usually leaves the LAN over Ethernet or a nearby relay, not the public internet directly. Photo: DiscDepotDundee.co.uk. CC BY-SA 4.0

Almost no Ethernet freeze probe requires assembly. PADAUK, PIC10F, and ATtiny10 are assembly-first (or assembly-only in practice), but they do not have a TCP stack or the RAM to POST JSON. The path we can actually support is GNU AVR assembly on an Arduino Uno / ATmega328P plus a W5100 Ethernet shield: the same garage hardware as Uno Ethernet, without Arduino C.

W5100 cannot TLS. This sample uses the same LAN HTTP→HTTPS relay as Uno C, STM32 Zephyr, and CH32V WCHNET.

Parts

Parts for an AVR assembly freeze probe
Part Why Buy
Arduino Uno (ATmega328P) 16 MHz AVR. Programmed with avr-gcc / avrdude, not the Arduino IDE. Adafruit Uno · Amazon
W5100 Ethernet shield SPI socket chip. Same shield as the Arduino Ethernet DHT22 sample. Adafruit Ethernet · Amazon
Waterproof DS18B20 Data on D7. Do not use D4: the shield uses D4 as SD chip-select. Adafruit DS18B20 · Amazon
4.7kΩ resistor Pull-up from DS18B20 data to 5V (Uno is a 5V board). Amazon 4.7k

Wiring

  • DS18B20 VDD → Uno 5V
  • DS18B20 GND → GND
  • DS18B20 data → D7 (PD7), 4.7k to 5V
  • Ethernet shield seated on the Uno. RJ45 → LAN. USB for flash and 115200 serial.

Build and flash

  1. Open Dashboard → Devices and download AVR main.S (ingest path filled in), or copy the ingest_path snippet from the ingest callout.
  2. On a LAN host:
    python3 sketches/relay/push_https_forward.py --listen 0.0.0.0:8080 \
      --upstream https://thermaltrace.dev
  3. Set ingest_ip / ingest_port and the Host header string to that machine. Static Uno IP is 192.168.1.177 in net_cfg.
  4. cd sketches/avr/atmega328_w5100_ds18b20
    make flash PORT=/dev/ttyACM0
    Or assemble the downloaded main.S with the same avr-gcc -mmcu=atmega328p -nostartfiles -nostdlib flags.
  5. Serial 115200: link ok, then POST 200. Sensor key temp1 imports on first POST (integer °F).

Repo listing: sketches/avr/atmega328_w5100_ds18b20/ (main.S, Makefile).

What we are not adding

  • PADAUK / PIC10F / ATtiny4–10: assembly-first, but no Ethernet and too little RAM for HTTP.
  • Parallax Propeller PASM / PASM2: real assembly culture, but Ethernet add-ons vary and there is no one garage shield.
  • PIC18F67J60: onboard Ethernet, but Microchip’s TCP stack is C, not MPASM.
  • nRF / TI Wi‑Fi in Thumb asm: the SDKs are C. Hand-written TLS in assembly is not a freeze-kit path.

Related

Amazon buy links may include an Associates tag. Adafruit and other vendor links are direct (Adafruit does not run an affiliate program). ThermalTrace may earn a commission from qualifying Amazon purchases at no extra cost to you.

FAQ

Do any ThermalTrace boards require assembly language?
No Ethernet freeze probe requires assembly. PADAUK and PIC10F are assembly-first but cannot POST HTTP. The supported assembly path is GNU AVR on an Uno + W5100: avr-gcc, no Arduino C, DS18B20 on D7, HTTP to the LAN TLS relay. Guide: thermaltrace.dev/about/avr-asm-ingest.

Why not put the DS18B20 on D4 like the ESP32 sample?
The W5100 Ethernet shield uses D4 as SD card chip-select. This firmware holds D4 high and reads the probe on D7.

Can I keep using the Arduino Ethernet C sketch instead?
Yes. sketches/arduino/ethernet_dht22_ingest is the C path on the same shield (DHT22 on A4/A5). Use assembly only if you want to program the 328P without Arduino C.