StarDot Newsletter
Enter E-mail:

Developer Information

If you're interested in adding support for one or more of StarDot's products to your custom application, DVR/NVR software, etc., check out the Developer API.

All of StarDot's network based products are built around the open source uClinux operating system. This means that these products are powerful customizable computers that can be made to perform many other tasks, in addition to or in conjunction with the tasks that are already built-in (i.e. imaging, http, FTP, etc.).

Built-in features like shell scripting, awk, sendmail, smb, and crontab allow for customization of StarDot's products. This document covers the basics of customizing StarDot's server-based products but assumes you have a working knowledge of Linux/UNIX and shell scripting.

WARNING: StarDot is not responsible for file or programming changes made to StarDot server products (NetCam, Express, etc.). If you are not familiar with the Linux environment, shell scripting, etc., it is possible to render the product inoperable. Customer assumes all responsibility for changes made to StarDot products. StarDot does not offer technical support for customizing its products.

 

Accessing a StarDot Server

The most common way of programming within a StarDot server is to telnet in. You can also use the included null serial cable with a terminal program (38400 8/N/1). Both methods provide you with shell access within the server.

 

The File System

StarDot servers boot the OS from flash memory and create a virtual hard drive that resides in DRAM. Unless files are saved to flash memory, changes made to files are lost when the server is rebooted. Only one directory in StarDot servers is flash writable (/etc/config). To save files to flash memory, use the command config save.

 

Editing Files

There are three ways in which you can create/edit files in StarDot network products:
  • Built-in web editor - A web browser can be used to create/edit files in /etc/config. To access the web editor, enter http://<stardot-server-ip>/edit.cgi?filename as the web address. After editing the file, clicking the Save button saves it to DRAM only. To save it permanently, enter http://<stardot-server-ip>/config.cgi?save as the web address.
  • VI text editor - The popular vi text editor is built into all StarDot servers. To use vi to edit a file from a telnet session, type vi filename. Newbies may not wish to use vi as it's rather cryptic compared to modern software like Word. Here is a Quick VI Tutorial
  • Your own text editor - You can create and edit files outside of the StarDot server environment. Use FTP to get the files back into the StarDot server. The StarDot products do not have an FTP server, only an FTP client. To fetch files, telnet into the FTP server and use the FTP client to "get" files from your FTP server.

Shell Scripts

Shell scripts are very powerful tools. They can be used to do read and write to the serial ports as well as the general purpose I/O port. They support common programming commands such as looping and conditional statements. As an example of how powerful the shell scripts are, the trigger-ftp and trigger-email functionality of the Express Video Server is handled all by shell scripts (the actual trigger detection is handled by an Awk program, see below). It should be noted that StarDot products run an embedded version of Linux called uClinux and shell scripting functionality is not 100% compatible with shell scripting functionality on other shells and flavors of Linux, however most functionality is supported.

To make a shell script executable, type chmod +x <filename>.

 

Awk Text Processing Language

Even more powerful than shell scripts is the Awk text processing language, which StarDot servers also support. It should be noted that StarDot products run an embedded version of Linux called uClinux and Awk is not 100% compatible with Awk on other shells and flavors of Linux, however most functionality is supported.

 

General I/O

Most StarDot servers have four general I/O ports and a relay output. This document describes how to set and read the I/O lines and provides some basic shell script examples.

 

Sample Scripts and White Papers

Below is a list of white papers and shell scripts that can be used in most StarDot server products. Some scripts may not work in all versions of the firmware and some may be untested. StarDot strongly recommends that only users with UNIX/Linux and shell scripting experience attempt to implement any of these scripts. StarDot does not accept responsibility for the content of any of these scripts.

Note: These scripts may have windows carriage return characters -- be sure the lines terminate only with linefeed characters in the server's linux environment, otherwise they may not run properly.

Sample Scripts

mail-image-generic.sh - shell script for emailing an image from NetCam

sync-time.sh - shell script for syncing with time server

ftp-test.txt - shell script for showing FTP script results in browser

Sample White Papers

sensatronics-temperature-monitor.txt - white paper for interfacing to Sensatronics temperature sensor (Model F)

smb-example.txt - how to mount a windows drive from a StarDot server

 

StarDot and Open Source

StarDot products are a combination of open source technology (like the uCinux OS) and in-house custom software/firmware. StarDot Technologies is an avid supporter of open source software. StarDot firmware source code has always been available at ftp://ftp.stardot.com subject to the StarDot software license and GNU General Public License among other licenses. See StarDot's Open Source Statement.