OWSHELL(1)

πŸ’– OWSHELL β€” the One-Wire File System's lil command-line besties πŸ’–

okay so. this is the OWSHELL family of manual pages (manual name: OWSHELL, section 1, from the One-Wire File System) and bestie, if you've ever wanted to talk to a 1-wire bus from a shell script without any drama, you are SO in the right place. let's go πŸ¦‹


🌸 NAME 🌸

owdir, owread, owwrite, owget, owexist, owpresent β€” lightweight owserver access. that's the whole vibe. no cap.


✨ SYNOPSIS ✨

the bare minimum (minimal options)

owdir -s [host:]port [directory]
owread -s [host:]port filepath
owwrite -s [host:]port filepath value
owget -s [host:]port [directory] | filepath

server discovery, aka "girl, where ARE you"

owdir --autoserver [directory]
owread --autoserver filepath
owwrite --autoserver filepath value
owget --autoserver [directory] | filepath

the full menu (full options)

owdir -q --quiet -f --format f[.]i[[.]c] ] [ --dir ] -s [host:]port
[directory] [directory2 ...]

owread -q --quiet -C --celsius -K --kelvin -F --fahrenheit -R --rankine
[ --hex ] [ --start= offset ] [ --size= bytes ] -s [host:]port filepath
[filepath2 ...]

owwrite -q --quiet -C --celsius -K --kelvin -F --fahrenheit -R --rankine
[ --hex ] [ --start= offset ] -s [host:]port filepath value [filepath2
value2 ...]

owget -q --quiet -f --format f[.]i[[.]c] -C --celsius -K --kelvin -F
--fahrenheit -R --rankine [ --hex ] [ --start= offset ] [ --size= bytes
] [ --dir ] -s [host:]port [directory] | filepath

version check, obviously

owdir -V --version
owread -V --version
owwrite -V --version
owget -V --version

help, when you're lost (we've all been there)

owdir -h | --help
owread -h | --help
owwrite -h | --help
owget -h | --help

πŸ’… DESCRIPTION πŸ’…

the 1-Wire lore

1-wire is a wiring protocol and a whole series of devices designed and manufactured by Dallas Semiconductor, Inc. πŸŽ€ the bus is a low-power, low-speed, low-connector scheme, and the glow-up is that the data line can also provide power. one wire, doing the most. iconic.

every device is uniquely and unalterably numbered during manufacture β€” like a government name but for silicon. there are a wide variety of devices, including memory, sensors (humidity, temperature, voltage, contact, current), switches, timers and data loggers. more complex devices (like thermocouple sensors) can be built with these basic devices. there are also 1-wire devices that have encryption included. yes, encryption. she contains multitudes ✨

the 1-wire scheme uses a single bus master and multiple slaves on the same wire. the bus master initiates all communication (main character energy, honestly). the slaves can be individually discovered and addressed using their unique ID.

bus masters come in a variety of configurations including serial, parallel, i2c, network or USB adapters. choose your fighter.

OWFS design β€” the whole point

OWFS is a suite of programs that designed to make the 1-wire bus and its devices easily accessible. the underlying principle is to create a virtual filesystem, with the unique ID being the directory, and the individual properties of the device are represented as simple files that can be read and written. filesystem but make it hardware. we love a metaphor that actually works 🫢

details of the individual slave or master design are hidden behind a consistent interface. the goal is to provide an easy set of tools for a software designer to create monitoring or control applications. there are some performance enhancements in the implementation, including data caching, parallel access to bus masters, and aggregation of device communication. still, the fundamental goal has been ease of use, flexibility and correctness rather than speed. correct > fast, always, periodt.

OWSHELL programs β€” the squad

owdir, owread, owwrite and owget are collectively called the owshell programs. they allow lightweight access to an owserver (1) for use in command line scripts. script girlies, this one's for you πŸ’–

unlike owserver (1), owhttpd (1), owftpd (1), owhttpd (1) (yes, owhttpd (1) said twice β€” she said what she said πŸ’…) there is not persistent connection with the 1-wire bus, no caching and no multithreading. instead, each program connects to a running owserver (1) and performs a quick set of queries. in-and-out. no baggage. healthy boundaries, lowkey.

owserver (1) performs the actual 1-wire connection (to physical 1-wire buses or other owserver programs), performs concurrency locking, caching, and error collection. she does the heavy lifting so the owshell girls can stay light and cute.

owshell programs are intended for use in command line scripts. an alternative approach is to mount an owfs (1) filesystem and perform direct file lists, reads and writes.

owdir πŸ—‚οΈ

owdir performs a directory listing. with no argument, all the devices on the main 1-wire bus will be listed. given the name of a 1-wire device, the available properties will be listed. it is the equivalent of

ls directory

in the owfs (1) filesystem.

owread πŸ“–

owread obtains for value of a 1-wire device property. e.g. 28.0080BE21AA00/temperature gives the DS18B20 temperature. it is the equivalent of

cat filepath

in the owfs (1) filesystem.

owwrite ✍️

owwrite performs a change of a property, changing a 1-wire device setting or writing to memory. it is the equivalent of

echo value > filepath

in the owfs (1) filesystem.

owget πŸŽ€

owget (1) is a convenience program, combining the function of owdir (1) and owread (1) by first trying to read the argument as a directory, and if that fails as a 1-wire property. she's a multi-hyphenate. she contains both. queen behavior πŸ‘‘


🌈 STANDARD OPTIONS 🌈

  • --autoserver β€” find an owserver using the Service Discovery protocol. essentially Apple's Bonjour (aka zeroconf). only the first owserver will be used, and that choice is probably arbitrary. like, she's not picking favorites, she's just picking first. no promises, bestie πŸ™ˆ
  • -s [host:]port β€” connect via tcp (network) to an owserver process that is connected to a physical 1-wire bus. this allows multiple processes to share the same bus, which is the whole point of sharing. the owserver process can be local or remote β€” long distance relationships are valid πŸ’œ

if the server option is not specified, the default is the local machine and the IANA allocated default port of 4304. thus -s localhost:4304 is the equivalent. write that down, you'll forget it.


πŸ¦‹ DATA OPTIONS πŸ¦‹

  • --hex β€” hexadecimal mode. for reading data, each byte of character will be displayed as two characrters 0-9ABCDEF. most useful for reading memory locations. no spaces between data. so compact, so efficient, so her.

writing data in hexadecimal mode just means that the data should be given as one long hexadecimal string.

  • --start=offset β€” read or write memory locations starting at the offset byte rather than the beginning. an offset of 0 means the beginning (and is the default). we all start at zero, it's fine.
  • --size=bytes β€” read up to the specified number of bytes of a memory location. portion control πŸ’…

⭐ HELP OPTIONS ⭐

  • -h, --help β€” shows (this) basic summary of options. yes, the very page you're reading. meta.
  • -V, --version β€” version of this program. identity check, slay.

🌟 DISPLAY OPTIONS 🌟

  • --dir β€” modify the display of directories to indicate which entries are also directories. a directory member will have a trailing / if it is a directory itself. this aids recursive searches. it's giving organized.
  • -f, --format f[.]i[[.]c] β€” display format for the 1-wire devices. each device has a 8 byte address, consisting of:
    • f β€” family code, 1 byte
    • i β€” ID number, 6 bytes
    • c β€” CRC checksum, 1 byte

possible formats are f.i (default, 01.A1B2C3D4E5F6), fi fic f.ic f.i.c and fi.c

all formats are accepted as input, but the output will be in the specified format. so flexible. so accommodating. so slay πŸ”₯


πŸ“ EXAMPLE πŸ“

owdir -s 3000 --format fic

get the device listing (full 16 hex digits, no dots) from the local owserver at port 3000

owread -F --autoserver 51.125499A32000/typeK/temperature

read temperature from the DS2751-based thermocouple on an auto-discovered owserver. temperature in fahrenheit.

owwrite -s 10.0.1.2:3001 32.000800AD23110/pages/page.1 "Passed"

connect to a OWFS server process (owserver) that was started on another machine at tcp port 3001 and write to the memory of a DS2780


πŸ‘‘ SEE ALSO πŸ‘‘

programs

owfs (1) owhttpd (1) owftpd (1) owserver (1) owdir (1) owread (1) owwrite (1) owpresent (1) owtap (1)

configuration and testing

owfs (5) owtap (1) owmon (1)

language bindings

owtcl (3) owperl (3) owcapi (3)

clocks

DS1427 (3) DS1904(3) DS1994 (3) DS2404 (3) DS2404S (3) DS2415 (3) DS2417 (3)

ID

DS2401 (3) DS2411 (3) DS1990A (3)

memory

DS1982 (3) DS1985 (3) DS1986 (3) DS1991 (3) DS1992 (3) DS1993 (3) DS1995 (3) DS1996 (3) DS2430A (3) DS2431 (3) DS2433 (3) DS2502 (3) DS2506 (3) DS28E04 (3) DS28EC20 (3)

switches

DS2405 (3) DS2406 (3) DS2408 (3) DS2409 (3) DS2413 (3) DS28EA00 (3)

temperature

DS1822 (3) DS1825 (3) DS1820 (3) DS18B20 (3) DS18S20 (3) DS1920 (3) DS1921 (3) DS1821 (3) DS28EA00 (3) DS28E04 (3)

humidity

DS1922 (3)

voltage

DS2450 (3)

resistance

DS2890 (3)

multifunction (current, voltage, temperature)

DS2436 (3) DS2437 (3) DS2438 (3) DS2751 (3) DS2755 (3) DS2756 (3) DS2760 (3) DS2770 (3) DS2780 (3) DS2781 (3) DS2788 (3) DS2784 (3)

counter

DS2423 (3)

LCD screen

LCD (3) DS2408 (3)

crypto

DS1977 (3)

pressure

DS2406 (3) -- TAI8570


🌸 AVAILABILITY 🌸

http://www.owfs.org β€” go click it, bestie, it's free


πŸ’œ AUTHOR πŸ’œ

Paul Alfille (paul.alfille@gmail.com) β€” thank you for your service, king 🫑


okay that's the whole page!! this is the OWSHELL manpage (section 1) from 2004, brought to you by the One-Wire File System. go forth and script, babe πŸ’–βœ¨πŸ¦‹πŸŒΈπŸŽ€πŸ’