Differences between revisions 7 and 15 (spanning 8 versions)
Revision 7 as of 2010-08-31 00:46:21
Size: 2660
Editor: BobAdamson
Comment:
Revision 15 as of 2013-06-27 11:57:24
Size: 2263
Editor: 203-59-251-65
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
== Fixing the door sensors == == The Door Lock ==
=== 2013-06-19: Door Relay was upgraded to a KMtronic Two Channel USB Relay Controller. ===
Relay interface uses a baud rate of 9600. Valid commands include (in hex, without spaces):
 *"FF 01 00": Turn relay 01 OFF
 *"FF 01 01": Turn relay 01 ON
 *"FF 01 03": Retrieve relay 01 state. Returns "FF 01 00" for off, "FF 01 01" for on.
 *"FF 02 XX": Same as above, but for relay 02.
Commands can be sent from the command line via '''echo -e "\xff\x01\x01" > /dev/ttyUSB0'''.
The script '''merlo:/root/readrelay.sh''' retrieves and echoes the state of relay 01.
Full documentation is available on the [[http://www.kmtronic.com/|KMtronic]] site. See [[http://www.kmtronic.com/kmmanuals.html|Manuals]] and [[http://www.kmtronic.com/software-examples.html|Software Examples]] for more information. The manual for this relay controller and fully functional shell script examples are available at [[http://www.ucc.asn.au/~door/kmtronic/]]
=== The Depths of Time ===
{{{
Hi All,
Line 3: Line 15:
If the door sensors die: The modem has now been replaced with the arduino and the small 5v relay
board. It's working for now, but it's a hack and not even properly boxed
up. [TPG] has already modified dispense to suit it. If it breaks, I'll let
you keep the pieces.
Line 5: Line 20:
 * On Mussel, as root:
{{{
/etc/init.d/uccdoors stop
/etc/init.d/latd restart
/etc/init.d/uccdoors start
For posterity, here are the super-sekret settings and commands:

Serial over USB connected to merlo, 115200 8n1
Type "2;" and it will respond with "1,The UCC door is alive;"
Type "4;" and it will respond with "1,Opening door;" , keep the lock open
for ten seconds and then say "1,Locking door;". The command codes are
strange numbers because I hacked the CmdMessenger [1] library example to
do the job.

I've found using picocom to check it is easier than minicom. The following
command* will start picocom with the correct baud rate and a command
character of x: `picocom /dev/ttyUSB0 -e x -b 115200'

Bob

[1] http://arduino.cc/playground/Code/CmdMessenger
Line 12: Line 38:
 * On Madako, as root:
{{{
moprc -i eth0.2 janus
<enter password>
<enter username (UCC)>
set priv
<enter privilege password>
init del 0
}}}
== Fixing the door lock ==
Symptom: Cries of "The door's broken." Door relay doesn't activate from snack machine, dispense or serial from Merlo.<<BR>>
Cause: The seeduino program seems to hang.<<BR>>
Fix: Restart seeduino (unplug/replug), then restart vendserver.<<BR>>
 - [DTK]
Line 22: Line 44:
Not all these steps may be necessary - often, resetting the DECterm (second item above) will do the trick.

== Fixing the door lock ==
The door solenoid (ie the lock) is connected to the On-Hook relay of a modem, which is mounted on the wall in the machine room. This modem is connected via serial to Centipede, an old DECserver. When /usr/local/bin/opendoor is called from mussel, mussel connects to Centipede and sends an AT command to the modem to "pick up" causing the lock to open.

The first thing you will want to check is that the modem is properly connected to the DECserver:
 * From mussel:
  . {{{
llogin door -w-
}}}
  * Enter the password
  * From here you can send characters to the modem (they won't come up on the screen though)
  * Watch the lights on the front of the modem, one of them should turn on and flicker when you're sending data
  * To manually open the door over serial type ATH1F (case sensitive) and hit enter
'''OR'''
 * Connect directly to Centipede using the serial terminal in the machine room
  . {{{
connect door
}}}
  * Enter the password
  * From here you can send characters to the modem (they won't come up on the screen though)
  * Watch the lights on the front of the modem, one of them should turn on and flicker when you're sending data
'''OR'''
 * dispense door and watch the lights on the front of the modem. This method isn't as good for debugging because it relies on a number of other servers and connections.

If you have not found the problem by now you will want to test the following with a multimeter immediately after sending the open command:
 * The terminals at the join of the modem and the in wall wiring
 * The terminals of the door lock

Last thing to check is that the lock itself is working - unscrew it from the door frame and test it with a 12V DC supply

=== Handy to know ===
 * The door solenoid requires a fair bit of power, the huge power supply in the machine room is huge because it needs to be. Don't try and substitute it with a wall wart.
 * Similarly, the door solenoid struggles for power when you try and power it with only 2 of the 4 wires. Instead, connect 2 wires to each terminal.
 * The modem takes 12V, so does the solenoid - don't try giving it 9V, it doesn't like it

 

The Door Lock

2013-06-19: Door Relay was upgraded to a KMtronic Two Channel USB Relay Controller.

Relay interface uses a baud rate of 9600. Valid commands include (in hex, without spaces):

  • "FF 01 00": Turn relay 01 OFF
  • "FF 01 01": Turn relay 01 ON
  • "FF 01 03": Retrieve relay 01 state. Returns "FF 01 00" for off, "FF 01 01" for on.
  • "FF 02 XX": Same as above, but for relay 02.

Commands can be sent from the command line via echo -e "\xff\x01\x01" > /dev/ttyUSB0. The script merlo:/root/readrelay.sh retrieves and echoes the state of relay 01. Full documentation is available on the KMtronic site. See Manuals and Software Examples for more information. The manual for this relay controller and fully functional shell script examples are available at http://www.ucc.asn.au/~door/kmtronic/

The Depths of Time

Hi All,

The modem has now been replaced with the arduino and the small 5v relay 
board. It's working for now, but it's a hack and not even properly boxed 
up. [TPG] has already modified dispense to suit it. If it breaks, I'll let 
you keep the pieces.

For posterity, here are the super-sekret settings and commands: 

Serial over USB connected to merlo, 115200 8n1
Type "2;" and it will respond with "1,The UCC door is alive;"
Type "4;" and it will respond with "1,Opening door;" , keep the lock open 
for ten seconds and then say "1,Locking door;". The command codes are 
strange numbers because I hacked the CmdMessenger [1] library example to 
do the job.

I've found using picocom to check it is easier than minicom. The following 
command* will start picocom with the correct baud rate and a command 
character of x: `picocom /dev/ttyUSB0 -e x -b 115200'

Bob

[1] http://arduino.cc/playground/Code/CmdMessenger

Fixing the door lock

Symptom: Cries of "The door's broken." Door relay doesn't activate from snack machine, dispense or serial from Merlo.
Cause: The seeduino program seems to hang.
Fix: Restart seeduino (unplug/replug), then restart vendserver.

  • - [DTK]


CategorySystemAdministration