Skip to content

castmill.conf ​

castmill.conf configures a device without a keyboard: Wi-Fi, proxy, time servers and time zone. It's a TOML file that you put on the device's boot partition before it boots.

How it's applied ​

  1. Put castmill.conf in the root of the boot partition (the FAT partition your computer shows after flashing), or on a USB stick plugged into the device.
  2. At boot, castmill-provision applies it before the network and the agent start.
  3. The file is then moved to /data and deleted from the boot partition, so Wi-Fi passwords don't stay there in plain text.

It works on every boot, not just the first: to change the Wi-Fi of a device in the field, put a new castmill.conf on its boot partition or on a USB stick and reboot.

Typos stop the file

Unknown keys are rejected so a typo can't leave a device silently unconfigured. If the file has an error, nothing in it is applied, it stays on the boot partition so you can fix it, and the error is logged by castmill-provision.

Example ​

toml
[network.wifi]
ssid = "Store-Signage"
psk = "your-wifi-password"

[network.proxy]
https = "http://proxy.example.com:3128"
no_proxy = "localhost,127.0.0.1,.example.com"
ca_cert_file = "proxy-ca.pem"      # next to castmill.conf

[time]
ntp = ["ntp1.example.com", "ntp2.example.com"]
timezone = "Europe/Madrid"

Reference ​

Wi-Fi ​

Section [network.wifi].

KeyTypeDescription
ssidstring, requiredNetwork name
pskstringWPA/WPA2 passphrase. Leave it out for open networks.
hiddenbooleantrue if the network doesn't broadcast its name

The device creates a NetworkManager connection that's tried automatically. Ethernet keeps working and needs no configuration.

Proxy ​

Section [network.proxy].

KeyTypeDescription
httpURLProxy for http://
httpsURLProxy for https://, which is what Castmill uses
no_proxystringComma-separated hosts and domains that bypass the proxy
ca_cert_filepathPEM certificate of a TLS-inspecting proxy, relative to castmill.conf

The agent and the players use the proxy.

Time ​

Section [time].

KeyTypeDescription
ntplist of stringsNTP servers to use instead of the defaults
timezonestringIANA time zone, such as Europe/Madrid or America/New_York. Used for schedules and the maintenance window.

When NTP is blocked, the device sets its clock from the Date header of Castmill's HTTPS responses.

Backend (development images only) ​

Section [backend].

KeyTypeDescription
urlURLCastmill server to use instead of https://castmill.net
ca_cert_filepathPEM certificate of a private CA for that server

Production images ignore this section and log a warning.

Enrollment (reserved) ​

Section [enrollment].

org_token, group and name_template are accepted for zero-touch bulk enrollment, which needs support in Castmill and doesn't work yet. Pair devices with the pincode for now.

Where things end up ​

PathContents
/data/castmill/config/castmill.conf.appliedCopy of the last applied file (readable by root only)
/data/castmill/config/network/The Wi-Fi connection
/data/castmill/config/proxy.envProxy settings for the agent and the players
/data/castmill/config/timesyncd.confNTP servers

A factory reset erases all of it.

Documentation licensed under CC BY 4.0. Code under MIT and Apache-2.0.