Home AMX User Forum AMXForums Archive Threads AMX Applications and Solutions

iButton code?

Has anyone written the code to interface with iButtons (http://www.ibutton.com/)? I have a DS9097U serial adapter here and would like to get it working with my AMX system. iButtons are dirt cheap and would make one heck of a great key... imagine one built into a ring. Just tap your ring on a sensor and your front door unlocks. Completely waterproof, virtually indestructible.

Anyway, I'm getting ready to write the code myself, and thought I might save myself the trouble if it's already been done.

Comments

  • Re: iButton code?
    Originally posted by amxhobbyist
    Has anyone written the code to interface with iButtons (http://www.ibutton.com/)? I have a DS9097U serial adapter here and would like to get it working with my AMX system. iButtons are dirt cheap and would make one heck of a great key... imagine one built into a ring. Just tap your ring on a sensor and your front door unlocks. Completely waterproof, virtually indestructible.

    Anyway, I'm getting ready to write the code myself, and thought I might save myself the trouble if it's already been done.

    Hi
    I would be very interested in using this for security for touch panel login.If you dont mind keeping me up to date with your progress .

    Many Thanks
    Cameron Davidson
  • Hi Cameron,

    I'll certainly post a message on this forum if I finish it. I've done some minor research into the protocol but have not had time to sit down and write it yet. I did manage to get a basic initialization response out of the interface, but got sucked into some other projects and haven't done any more on that. I plan to do so, however, and will certainly share my code with the community when it's done.
  • rnoblernoble Posts: 2
    Hi Cameron,

    I'll certainly post a message on this forum if I finish it. I've done some minor research into the protocol but have not had time to sit down and write it yet. I did manage to get a basic initialization response out of the interface, but got sucked into some other projects and haven't done any more on that. I plan to do so, however, and will certainly share my code with the community when it's done.


    What was the outcome of your iButton development?
  • What was the outcome of your iButton development?
    I found myself engaged in other projects with very little code written. I'd still like to finish it some day, but just haven't been able to find the time.
  • joelwjoelw Posts: 175
    Has anyone written the code to interface with iButtons (http://www.ibutton.com/)? I have a DS9097U serial adapter here and would like to get it working with my AMX system. iButtons are dirt cheap and would make one heck of a great key... imagine one built into a ring. Just tap your ring on a sensor and your front door unlocks. Completely waterproof, virtually indestructible.

    Anyway, I'm getting ready to write the code myself, and thought I might save myself the trouble if it's already been done.

    Yes. I have done a great deal of work with iButtons. What devices are you interested in implementing?
  • amxhobbyistamxhobbyist Posts: 90
    Joel,

    Hey, how cool! I was just thinking about doing something with this the other day.

    I'm interested in two devices, actually:

    1. Temperature sensors.

    2. Standard ID buttons - I'd like to fashion one into a ring and use it to unlock my front door. The logistics are simple enough - receive a known ID, activate a relay. Unfortunately the actual Netlinx code implementation to drive the RS232 interface, while not extremely difficult, was time consuming enough that I moved on and never finished what I'd started.

    Also, I know there are other standalone solutions for #2 above, but I want Netlinx to handle it. Makes it much easier to update & change things globally rather than going to half a dozen standalone units to enable or disable a given ID.
  • joelwjoelw Posts: 175
    List out the 1-Wire devices you're looking for support on.

    I'm out of town until the 15th, but I'll look into it when I get back.

    I've had it running on the competitions software for over two years now.
  • amxhobbyistamxhobbyist Posts: 90
    Hi Joel,

    Primarily:

    DS18S20 thermometers
    DS1990A basic ID

    I assumed interface would be via a DS9097 RS232 interface. That seemed the easiest to me, anyway.
  • joelwjoelw Posts: 175
    Example Search program

    This program attached prints out all 1-Wire devices attached to DS9097U via debug message.

    Be sure to tie RTS and or DTR high. I tied to +12V pin.

    1. Load program
    2. Establish telnet session with Netlinx controller
    3. type 'msg on'
    4. type 'send c dvTest,'search'
    Welcome to NetLinx v2.31.137 Copyright AMX Corp. 1999-2004
    >msg on
    Extended diagnostic information messages turned on.
    >send c dvTest,'search'
    >(0000069683) by Joel Winarske
    (0000069683) www.indyelectronics.com
    (0000069684) Find All 1-Wire Devices
    (0000070756) /---------------------------------------------
    (0000070757) -------------------- Start of search
    (0000071194) (1) 2700080040401B10
    (0000071636) (2) 6E00000013C69A28
    (0000072088) (3) 1A00000013E57F28
    (0000072523) (4) DA000000091D5926
    (0000072957) (5) B600000157DD5E09
    (0000073399) (6) B90000000012D829
    (0000073834) (7) 4700000003098733
    (0000073836) -------------------- End of search
    

    Independent Electronics can provide software solutions for Dallas/Maxim 1-Wire networks of any type or size.
  • joelwjoelw Posts: 175
    This ow.tko adds two commands in addition to the previous search:
    1. 'temp' - displays temperatures for up to ten DS1920/DS18S20 devices
    2. 'tempb' - displays temperatures from up to ten DS18B20 devices

    Just replace ow.tko with attached.

    This has been tested on an NXI, with an older master. So newer hardware should have no trouble.

    Give me some ideas of how you would like API for use in an application.

    When I have more time I'll add support for the DS2438 (used for humidity) and the DS2408 (used on a number of low cost relay boards, and character LCD displays).
    Welcome to NetLinx v2.31.137 Copyright AMX Corp. 1999-2004
    >msg on
    Extended diagnostic information messages turned on.
    >send c dvTest,'temp'
    >(0000029493) Joel Winarske
    (0000029493) www.indyelectronics.com
    (0000029494) ---------------------------------------------
    (0000029495)   Temperature application DS1920/DS1820 - Version 1.00
    (0000029496)   The following is a test to excersize a DS1920/DS1820.
    (0000029497)   Temperature Find and Read from a:
    (0000029498)   DS1920/DS1820 (at least 1)
    (0000029498)   Output [Serial Number(s) ........ Temp1(F)]
    (0000033771) Device(s) Found:
    (0000033777) 2700080040401B10
    (0000036546) 2700080040401B10   29.875 Celcius   85.775 Fahrenheit
    send c dvTest,'tempb'
    >(0000046936) Joel Winarske
    (0000046937) www.indyelectronics.com
    (0000046938) ---------------------------------------------
    (0000046938)   Temperature application DS1820 - Version 1.00
    (0000046939)   The following is a test to excersize a DS18B20.
    (0000046940)   Temperature Find and Read from a:
    (0000046941)   DS18B20 (at least 1)
    (0000046942)   Output [Serial Number(s) ........ Temp1(F)]
    (0000051207) Device(s) Found:
    (0000051213) 6E00000013C69A28
    (0000051219) 1A00000013E57F28
    (0000053995) 6E00000013C69A28   23.500 Celcius   74.300 Fahrenheit
    (0000056778) 1A00000013E57F28   22.500 Celcius   72.500 Fahrenheit
    send c dvTest,'search'
    >(0000081379) Joel Winarske
    (0000081380) www.indyelectronics.com
    (0000081381) Find All 1-Wire Devices
    (0000082491) /---------------------------------------------
    (0000082492) -------------------- Start of search
    (0000082923) (1) 2700080040401B10
    (0000083371) (2) 6E00000013C69A28
    (0000083821) (3) 1A00000013E57F28
    (0000084258) (4) DA000000091D5926
    (0000084694) (5) B600000157DD5E09
    (0000085140) (6) B90000000012D829
    (0000085575) (7) 4700000003098733
    (0000085577) -------------------- End of search
    
  • joelwjoelw Posts: 175
    This tko adds command 'humid'
    Welcome to NetLinx v2.31.137 Copyright AMX Corp. 1999-2004
    >msg on
    Extended diagnostic information messages turned on.
    >send c dvTest,'humid'
    >(0000180845) Joel Winarske
    (0000180845) www.indyelectronics.com
    (0000180846)
    (0000180847) ---------------------------------------------
    (0000180848)   Humidity application DS2438 - Version 1.00
    (0000180848)
    (0000185080) Device(s) Found:
    (0000185086) DA000000091D5926
    (0000185092) 7B00000009063B26
    (0000185093)
    (0000188382) (1) DA000000091D5926
    (0000188383)
    (0000188385)          humidity:  58.4457%
    (0000188387)       temperature:  25.00 Celcius
    (0000188388)                     77.00 Fahrenheit
    (0000188390)    voltage supply:  4.65
    (0000188392)    voltage output:  2.43
    (0000188392)
    (0000191678) (2) 7B00000009063B26
    (0000191679)
    (0000191681)          humidity:  55.3684%
    (0000191683)       temperature:  26.81 Celcius
    (0000191684)                     80.26 Fahrenheit
    (0000191686)    voltage supply:  4.66
    (0000191688)    voltage output:  2.34
    (0000191688)
    

    Tested with two AAG electronica TAI8540D 1-Wire Humidity Modules:
    www.aag.com.mx

    I'm interested in what people would find useful for an API.
    ow.zip 37.5K
  • patriot_stvpatriot_stv Posts: 26
    Good day!

    does anyone have the code ready for the 1-wire bus.
    or module to work with ds9097 and DS18S20?

    I would be grateful for any help

    in the datasheet says:

    "A master reset cycle can also be generated by means of software. This may be necessary if the host for any reason has lost synchronization with the device. The DS2480B will perform a master reset cycle equivalent to the power-on reset if it detects start polarity in place of the stop bit. The host has several options to generate this condition. These include making the UART generate a break signal, sending a NULL character at a data rate of 4800bps and sending any character with parity enabled and selecting space polarity for the parity bit. As with the power-on reset, the DS2480B requires a 1-Wire reset
    command sent by the host at a data rate of 9600bps for calibration."

    how to implement it on AMX?
  • DHawthorneDHawthorne Posts: 4,584
    Good day!

    does anyone have the code ready for the 1-wire bus.
    or module to work with ds9097 and DS18S20?

    I would be grateful for any help

    in the datasheet says:

    "A master reset cycle can also be generated by means of software. This may be necessary if the host for any reason has lost synchronization with the device. The DS2480B will perform a master reset cycle equivalent to the power-on reset if it detects start polarity in place of the stop bit. The host has several options to generate this condition. These include making the UART generate a break signal, sending a NULL character at a data rate of 4800bps and sending any character with parity enabled and selecting space polarity for the parity bit. As with the power-on reset, the DS2480B requires a 1-Wire reset
    command sent by the host at a data rate of 9600bps for calibration."

    how to implement it on AMX?

    Here's a 1-wire module I made for a client that wanted a temperature probe in his lake. You can probably take off with it from there.

  • patriot_stvpatriot_stv Posts: 26
    DHawthorne wrote: »
    Here's a 1-wire module I made for a client that wanted a temperature probe in his lake. You can probably take off with it from there.


    Thank you very much!

    I looked at the code and can not find it in the part that is responsible for working with 1-wire bus and temperature readings from the sensor. Or I do not understand something?
  • patriot_stvpatriot_stv Posts: 26
    Correct me if I'm wrong:

    1. To start working with 1-wire, I need to perform "master reset cycle".

    "These include making the UART generate a break signal, sending a NULL character at a data rate of 4800bps and sending any character with parity enabled and selecting space polarity for the parity bit."
    (datasheet for DS2480B)

    how to do it on the NetLinx?

    2. Switching to command mode
    send_string dvOW, $E3

    2. Send to 1-wire reset command.
    send_string dvOW, $C5 (11000101 bitwise)

    Get in return $CD ....
    According to the datasheet, it is a normal response. But it does not change when you disconnect from DS9097 all sensors. In theory, should be changed ...

    3. Switching to data mode
    send_string dvOW, $E1

    4. Send to 1-wire Read ROM command
    send_string dvOW, $33

    Then, just send eight send_string dvOW, $FF and get in return 8 0 0 2 8A 64 0 0. it must be 64-bit ROM code ))
    How to encode it into an understandable form do not know yet!
    If I do send_string dvOW, $FF more than eight times, In response I receive only "FF" .....

    While all right?

    5. Send to 1-wire CONVERT T command
    send_string dvOW, $44

    6. Send to 1-wire READ SCRATCHPAD command
    send_string dvOW, $BE

    To read data send send_string dvOW, $FF ....... but, In response I receive only "FF" ....


    what am I doing wrong?
  • Jim JohnsonJim Johnson Posts: 27
    If you are using the Maxim DS9097U-S09# Adapter the protocol is pretty cumbersome. I had 20 temprature sensors in my old house with a NI-2000 running the furnace. Getting it to work took many many many Hours to make work ( bet I put 200 hours into the entire "Thermostat" program).
    A simpler way is get this adaptor instead of the DS9097U-S09#:

    http://www.ibuttonlink.com/products/linkth

    It uses a much simpler ascii interface, and has a more robust line drivers for the one wire buss. I use these all the time for projector enclosure temprature sensors.

    ...Jim...
Sign In or Register to comment.