Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
acab:setup [2013/07/05 12:05] – schneider | acab:setup [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== ACAB Setup Instructions ====== | ||
- | |||
- | The goal of this page is to gather all information needed to set up an ACAB installation from the ground up. | ||
- | |||
- | ===== Hardware ===== | ||
- | |||
- | The currently used hardware can be found at https:// | ||
- | |||
- | The board and schematic used for the ACAB installations are board/ | ||
- | |||
- | The hardware uses RS484 to signal data to the lamps and a 24 V to 28 V supply voltage. Both the RS484 signal and the supply voltage are carried on a single cable. To keep the cost down standard Cat 5 network cables are used. | ||
- | |||
- | To communicate with the host computer, the RS484 interface has to be adapted to another interface. The device described by board/ | ||
- | |||
- | ==== Power Distribution ==== | ||
- | With standard 2 m long Cat. 5 cables, up to 8 lamps can be put into series. With more lamps or longer cables, the power loss in the cables is to large and the system starts to get unreliable. With shorter cables (e.g. 0.5 m), it should be possible to put more lamps into series. | ||
- | |||
- | For best utilization and robustness, power should not be injected from one side of a string. It should rather be injected from the middle of a string. This technique cancels out the voltage drops on the ground line (which helps the RS485 bus to stay in its operational limits) and gives better utilization of a single power supply. | ||
- | |||
- | Power can be injected by using the same circuit boards as the lamps. Only the two jacks, the jumper and the two screw terminals need to be populated. The board can now be used to inject power into the system. When using multiple power supplies in a single line, the jumper, bridging the 24 V power supply from one jack to the other, needs to be removed to decouple the power supplies. | ||
- | |||
- | |||
- | RS485 Bridge <-> Lamp 1 <-> ... <-> Lamp 8 < | ||
- | \ / | ||
- | | ||
- | 24 V Power Supply | ||
- | |||
- | ==== Installation ==== | ||
- | Each installation poses its own difficulties and tasks. The following general rules should give some guidance: | ||
- | |||
- | - Test all parts of the system before going to an installation | ||
- | - It takes longer to set up the installation as expected. | ||
- | - During the installation, | ||
- | - Think about people (unintentionally) running into your installation. Will they get hurt? Will your installation survive? | ||
- | |||
- | When using translucent plastic boxes from IKEA the following special steps apply: | ||
- | |||
- | http:// | ||
- | |||
- | ===== Software ===== | ||
- | ==== RS485 Bridge ==== | ||
- | The software for the RS485 bridge can be found inside the rs485bridge/ | ||
- | the RS485 bus used by the system. When used with the device mentioned above, it can be used to connect an ACAB installation to a PC. | ||
- | |||
- | To program the RS485 bridge: | ||
- | cd rs485bridge | ||
- | make | ||
- | make fuse | ||
- | make program | ||
- | ==== Bootloader ==== | ||
- | |||
- | The bootloader for the boards can be found at https:// | ||
- | |||
- | The bootloader is used to update the firmware of the lamps while they are inside an installation and therefore inaccessible. | ||
- | It consists of a small bootloader program, running on the lamps, and a set of Python and bash scripts to upload new firmware to the lamps. | ||
- | |||
- | The bootloader can upload new firmware to a lamp and program arbitrary parts of the EEPROM. To single out a lamp on the bus and only program a single one, | ||
- | the bootloader can be used to compare an arbitrary section of the EEPROM to data transmitted via the bus. | ||
- | |||
- | The scripts use this feature to select a single lamp after all lamps performed a power on reset. | ||
- | |||
- | To flash lamps which have not yet a unique EEPROM content, the bootloader can be forced to consider the lamp selected. | ||
- | |||
- | === Scripts === | ||
- | ./ | ||
- | Starts to send the select command to the bus. If a lamp with a bootloader reboots and has the corresponding id programmed, | ||
- | it will get selected. If no id is supplied any lamp on the bus will get selected. After a lamp got selected, the scripts returns. | ||
- | If a lamp got selected, it turns green. If a lamp is not selected it stays red. | ||
- | |||
- | < | ||
- | multicast addressing. Example: ./ | ||
- | |||
- | ./set-m644p < | ||
- | Sets the address of the selected lamp to < | ||
- | |||
- | ./ | ||
- | Loads the binary at < | ||
- | |||
- | ./ | ||
- | Starts the program inside the selected lamp. This command always return with a timeout. | ||
- | |||
- | === Usage === | ||
- | == If a new lamp needs to be configured and flashed == | ||
- | Flash the bootloader to the lamp: | ||
- | cd ubloader | ||
- | make | ||
- | make fuse | ||
- | make program | ||
- | | ||
- | Compile the moodlamp firmware: | ||
- | cd moodlamp-bus | ||
- | make | ||
- | |||
- | Connect the RS485 bridge with the lamp and apply 24V power to the lamp. The lamp starts to light up red. | ||
- | cd ubloader | ||
- | ./ | ||
- | ./set-m644p < | ||
- | ./ | ||
- | ./ | ||
- | |||
- | == If a single lamp needs to be flashed with new firmware == | ||
- | Compile the moodlamp firmware: | ||
- | cd moodlamp-bus | ||
- | make | ||
- | |||
- | Start to select any lamp: | ||
- | cd ubloader | ||
- | ./ | ||
- | | ||
- | Connect the RS485 bridge to the lamp and apply 24V power to the lamp. The lamp turns green. | ||
- | ./ | ||
- | ./ | ||
- | |||
- | The lamps should now boot the new firmware. | ||
- | |||
- | == If a lamp is inside an installation and needs new firmware == | ||
- | Compile the moodlamp firmware: | ||
- | cd moodlamp-bus | ||
- | make | ||
- | |||
- | Start to select the specific lamp | ||
- | cd ubloader | ||
- | ./ | ||
- | |||
- | Toggle the power of all lamps, The specified lamp turns green and the script returns. | ||
- | |||
- | Flash the new firmare: | ||
- | ./ | ||
- | ./ | ||
- | |||
- | ==== ACAB daemon ==== | ||
- | |||
- | The ACAB daemon receives a stream of animation data via UDP and forwards it to the ACAB installation. It can control multiple RS485 bridges, connected to multiple sets of ACAB lamps. | ||
- | |||
- | The daemon can be found at https:// | ||
- | |||
- | It is located inside the server/ directory. There are two submodules: The acabslserver and the acabslrouter. | ||
- | |||
- | === Animation Streams === | ||
- | TODO: explain the UDP packet format | ||
- | |||
- | === acabslrouter === | ||
- | |||
- | The acabslrouter accepts a stream of animation data and forwards the data to an acabslserver instance which controls a particular part of the installation. This makes it possible | ||
- | to control an installation with more than one wall of lamps. The acabslrouter also supports different priorities and timeouts for different streams. This can be used to display an idle animation when | ||
- | no other animation is active or overlay an active animation with some interactive game. | ||
- | |||
- | == Configuration == | ||
- | Currently, the acabslrouter is configured directly inside its source code. | ||
- | |||
- | The configuration consists of a list of entries like the following: | ||
- | {' | ||
- | |||
- | Each of these entries specifies the properties of a single wall. It contains the following fields: | ||
- | - host | ||
- | - The host where the acabslserver for this wall can be reached. | ||
- | - port | ||
- | - The port on which the acabslserver is listening | ||
- | - simhost | ||
- | - The host where the data stream should be redirected if the system is simulated | ||
- | - simhost | ||
- | - The port where the simulator is listening | ||
- | - startx | ||
- | - The logical start of the matrix in the data stream. Set this to 0 if you only have a single matrix. Set this to a multiple of the horizontal size of the used matrices. | ||
- | - starty | ||
- | - Similar to the startx fiels, but for the vertical direction. | ||
- | - sizex | ||
- | - The physical size of the matrix in the horizontal direction | ||
- | - sizey | ||
- | - The physical size of the matrix in the vertial direction | ||
- | |||
- | The configuration also accepts a list of ports where incoming streams are accepted as well as a priority and timeout for each port. | ||
- | |||
- | If a port did not receive data for longer than the timeout, the acabslrouter switched to a data stream on a port with a lower priority | ||
- | |||
- | The acabslrouter always chooses the data stream on the port with the highest priority which did not experience a timeout. A timeout occurs when a port does not receive a valid telegram for longer then the period specified in the timeout field: | ||
- | |||
- | | ||
- | - port | ||
- | - The port to listen on. | ||
- | - priority | ||
- | - The priority of this port. Higher values have higher priority. | ||
- | - timeout | ||
- | - The timeout in seconds of this port. | ||
- | |||
- | To start the server, you can specify one of the following options: ' | ||
- | |||
- | Example: | ||
- | python acabslrouter.py nosimulation | ||
- | |||
- | - nosimulation: | ||
- | - Do not send the stream data to a simulation server. Use this setting to drive a real matrix without also displaying its contents on a monitoring simulation server, | ||
- | - simulation: | ||
- | - Do not send the stream to a real matrix. Use this setting if you just want to test the router without hardware. | ||
- | |||
- | If you do not specify any of these options, the data will be sent to a real matrix as well as to a simulator. | ||
- | === acabslserver === | ||
- | The server accepts a stream of animation data via UDP. If the stream modifies the state of a pixel which is controlled by the acabslserver, | ||
- | |||
- | == Configuration == | ||
- | The acabslserver accepts a configuration file which defines the location of the different lamps in the matrix controlled by the server as well as the configuration of the RS484 bridges. | ||
- | |||
- | To generate this configuration file, a tool is available: acabsl-config-generator.py | ||
- | |||
- | python acabsl-config-generator.py your-config.py | ||
- | |||
- | It automatically detects all connected RS484 bridges and starts to locate the different lamps in the matrix. It does this by first determining | ||
- | to which interface a specific lamp is connected and then locating the the specific lamp on this bridge. | ||
- | |||
- | The script first asks a few questions: The size of the matrix as well as the range of the used addresses. | ||
- | As addresses below 10 are reserved for special purposes it is set as the default value for the lower range of the address space. | ||
- | If you know what the highest address of the used lamps is, you can enter this as the upper limit of the address space, to reduce the time needed to find a specific lamp. | ||
- | |||
- | The scripts will ask you to specify a coordinate. It will then try to determine the address of the lamp at this location. It does this by blinking the different lamps in different colors. It will then ask you what the lamp at the specified location is doing. After some time it will find the correct address and only blink the found lamp with a white color. | ||
- | |||
- | Every time, a new lamp is found, the configuration file is written. You can abort the script at any time. You can also always start the process for an already configured location if you made a mistake. | ||
- | |||
- | After every lamp has been found, you can terminate the script. It will have written a configuration file to the filename specified as its argument. | ||
- | |||
- | The configuration file will contain the following line: | ||
- | UDP_PORT = 5004 | ||
- | |||
- | This is the port on which the acabslserver will listen. Please change this port if you have multiple servers running on the same machine or if your acabslrouter configuration | ||
- | expects a different port. | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | ==== Animation Scheduler ==== | ||
- | |||
- | |||
- | ==== Animation Scripts ==== | ||
- | === Static === | ||
- | === Sound controlled === | ||
- | === Interactive === | ||
- | |||
- | |||