---json { "name": "Test & tune" } --- ====== Testing and tuning devices ====== Use the Test & tune tab to see what Axiom finds on its I²C bus, check which profile claimed each device, watch live readings, try polling settings temporarily and send test commands. {{ :axiom:device_library:devlib-selected-device.png?nolink&800 |}} Connect Axiom and open the **Test & tune** tab. Nothing on this tab changes your library, and temporary settings are lost when Axiom restarts. Some controls do talk to the real hardware, and those are marked below. ===== The bus ===== Click **Scan bus** to list every device Axiom can see. The summary says how many addresses were found and how many are claimed. {{ :axiom:device_library:devlib-scan-claimed.png?nolink&800 |}} ^ Column ^ Meaning ^ | **Addr** | The device's I²C address. ''direct'' means one of Axiom's internal devices (LEDs, power), which aren't on the I²C bus. | | **Device** | The device's name, its role (e.g. ''system'' for Axiom's own parts) and Axiom's ID for it. | | **Resolved type** | The profile that identified it. | | **Origin** | ''built-in'' or ''yours''. | | **Status** | ''claimed'' (a profile recognised it), ''unclaimed'' (something answered but no profile recognised it) or ''no profile reported''. | | **Latest reading** | The most recent values, once readings are started. | Scan again after connecting or disconnecting a sensor, or after restarting Axiom. Always switch Axiom off before changing sensor wiring. ==== Finding profiles for unknown devices ==== If any addresses are unclaimed, click **Find catalogue candidates**. For each unclaimed address you'll see the catalogue profiles that use it, with **Try** and **Add to draft** buttons. A matching address is a hint, not proof: many chips share addresses. See [[axiom:device_library:add_a_sensor|Adding a new sensor]]. ==== Live readings ==== Click **Start readings** to show the latest decoded values from each device in the **Latest reading** column, updated about once a second. Click **Stop readings** when you've finished. * This is a live view, not a recording. To record experiments, use the Axiom app. * Stop readings (or disconnect) before switching to another app. A running stream can take data other apps are waiting for. ==== Raw bus state ==== Open **Raw bus state** to see exactly what Axiom reports about the bus, without interpretation. It's mainly useful when asking for help. ===== The selected device ===== Click a row in the bus table to select that device. **Selected device** shows its name, ID and bus speed, plus the controls below. Axiom's internal (''direct'') devices show readings but have no bus controls. ==== Temporary settings ==== * **Polling interval (ms)**: how often Axiom reads the device, from 1 to 60,000 ms. For example, 500 ms means twice a second. * **Retained samples**: how many recent readings Axiom keeps for the device between deliveries, from 1 to 16. Click **Apply temporarily** to change them on Axiom straight away, and **Back to descriptor** to return to the values in the device's running profile. These settings are **not saved**. A restart returns the device to the values in its profile, and another app (such as the Axiom app) can change them too. To keep a value, customise the profile and change ''pollInfo.i'' (interval) or ''pollInfo.s'' (samples), then install it. See [[axiom:device_library:customise_and_disable|Customising and disabling built-in devices]]. ==Polling isn't the same as sensor rate== Three different rates are involved. The **polling interval** is how often Axiom reads the device. Some sensors also measure on their own internal schedule. Live readings on this page refresh about once a second whatever the polling interval. Polling faster than the sensor measures just returns repeated values. ==== Try a detection command ==== This asks the selected device a profile's identification question and shows whether the answer matches. Type a ''detectionValues'' command, e.g. ''0x0f=0x69,0x6a,0x6c'' (write ''0x0f'' and expect one of those values back), and click **Try it**. It sends real I²C commands to the device, but nothing is installed or written to the library. Use it to check an identification rule before you put it in a profile. The syntax is explained in [[axiom:device_library:advanced_json|Writing device profiles]]. ==== Send a write ==== This writes raw bytes, in hex, to the selected device, e.g. to exercise an actuator. Type the bytes (e.g. ''0xac3300'') and click **Send to selected device**, then confirm. ==This drives real hardware== The write happens as soon as you confirm, and nothing is read back. Judge the result by what the hardware does. Check the device's datasheet first, and don't send writes to Axiom's own devices.