Plane radar relay
An ESP8266 SmallTV can no longer read adsb.fi or adsb.lol itself. Both feeds now send TLS records of up to 16 KB, and the chip does not have the memory to receive them (#140). The Status tab shows server needs 16 KB TLS records on the Radar line when this applies.
A relay fixes it. The relay fetches the feed over HTTPS and passes it to the SmallTV over plain HTTP, which needs almost no memory on the device. The ESP32 boards do not need one.
The relay does not work with 3.14.0 on the ESP8266: that release sends no radar request at all, so every poll ends in connect failed with http -2. The fix (#161) is in 3.14.1. Firmware up to 3.13.1 reaches the relay.
Pick the setup that matches what you already run. Each one is a single file in tools/radar-relay.
| You run | File | Reads the device’s position |
|---|---|---|
| n8n | n8n-smalltv-radar.json |
Yes |
| Home Assistant | home-assistant.yaml |
No, written into the file |
| nginx | nginx.conf |
Yes |
| Apache httpd 2.4 | apache.conf |
Yes |
| Nothing at home | worker.js on Cloudflare |
Yes |
Then, on the SmallTV, open the Radar tab, set the source to Custom webhook, enter the relay’s URL and save. The device adds ?lat=<lat>&lon=<lon>&dist=<km> to the URL on every poll. Within one poll interval the Radar line in the Status tab should read ok with an aircraft count.
How the relay is called
Section titled “How the relay is called”GET <relay URL>?lat=47.3769&lon=8.5417&dist=25dist is the radar range in kilometres. The feeds take nautical miles, so the relay divides by 1.852. The relay returns the feed’s JSON unchanged ({"ac":[...]}). The device must reach it over plain http://, because an HTTPS relay would bring back the problem it is there to solve.
- In n8n, open Workflows → Import from file and pick
n8n-smalltv-radar.json. - Publish the workflow (turn it on).
- Use the production webhook URL over plain HTTP on your LAN:
http://<n8n-host>:5678/webhook/smalltv-radar.
The workflow saves no data for successful runs, so a poll every 10 seconds does not fill n8n’s database. If n8n is only reachable through an HTTPS reverse proxy, point the SmallTV at n8n’s own port instead.
Home Assistant
Section titled “Home Assistant”Home Assistant’s Downloader integration fetches the feed on a timer and writes it to a file in the www folder. Home Assistant serves that folder at /local/ without a login. The SmallTV reads it at:
http://<home-assistant-host>:8123/local/smalltv-radar.jsonA file cannot read the SmallTV’s query, so you write the position and radius into the download URL. The steps are in the comments at the top of home-assistant.yaml, all in the UI: make sure /config/www exists, add the Downloader integration with www as its folder, and paste the automation. No YAML in configuration.yaml and no restart, unless you had to create the folder.
This only works if the SmallTV can reach Home Assistant over plain HTTP. If Home Assistant serves HTTPS itself, use another relay. A SmallTV on its own VLAN often can already, because it reaches the MQTT broker or Home Assistant for the Home Assistant screens.
Anything in www is served without a login to whoever can reach Home Assistant. If your Home Assistant is reachable from the internet, so is this file, and the aircraft around you show roughly where you live. Give the file a name nobody can guess, for example smalltv-radar-<32 random hex characters>.json, in both the automation and the SmallTV’s URL. If a reverse proxy publishes Home Assistant, also block the path there, for example in Apache:
<LocationMatch "^/local/smalltv-radar"> Require all denied</LocationMatch>The SmallTV reads Home Assistant directly on the LAN, so the block does not affect it.
Home Assistant serves /local/ files with a long cache lifetime. The SmallTV does not cache, but a browser you use to check the file may show an old copy: reload it without the cache.
nginx or Apache
Section titled “nginx or Apache”Paste the block into an existing site that listens on port 80 and reload the server. The URL is http://<host>/smalltv-radar.
Neither server can do arithmetic, so they ask the feed for a radius of dist nautical miles instead of converting. That is a circle 1.85 times the range. The device keeps the nearest 24 aircraft and draws the ones outside the ring as dots on its edge, so the screen looks the same.
Both configs accept only numbers in lat, lon and dist and answer anything else with 400.
Cloudflare Worker
Section titled “Cloudflare Worker”For a relay that runs outside your home, use a free Cloudflare Worker. The free plan allows 100,000 requests a day; one SmallTV polling every 10 seconds uses about 8,600.
- In the Cloudflare dashboard, go to Workers & Pages → Create → Worker, give it a neutral name and deploy.
- Edit code, replace the code with
worker.js, and deploy again. - Optional: under Settings → Variables and Secrets, add a secret named
KEYwith a random value. Requests without the right key then get a 403. - Use the
workers.devaddress withhttp://, nothttps://:http://<name>.<your-subdomain>.workers.dev/, plus?key=<value>if you set a key.
workers.dev addresses answer plain HTTP. A Worker on your own domain may not, if the domain has Always Use HTTPS turned on.
The Worker sees your coordinates on every request, and so does Cloudflare. They are the same coordinates the SmallTV would send to adsb.fi directly.
If it does not work
Section titled “If it does not work”connect failedon the Radar line: the SmallTV cannot reach the relay. Open the URL with the query (for example?lat=47.3&lon=8.5&dist=25) in a browser on the same network. A SmallTV on its own VLAN may need a firewall rule to reach the relay’s host and port.http errorwith 400: the relay refused the query. The device sendslat,lonanddistitself, so check that the URL you entered does not already contain them.http errorwith 502 or 500: the relay could not reach the feed. Check the relay’s own logs.parse failed: the relay returned something other than the feed’s JSON, such as an HTML login page from a reverse proxy.