Author Topic: (NOW WORKING) 'DS9490R 1wire usb adapter' working!  (Read 20159 times)

wooly

  • Regular Poster
  • **
  • Posts: 16
    • View Profile
(NOW WORKING) 'DS9490R 1wire usb adapter' working!
« on: January 28, 2013, 11:28:15 pm »
Problem with the DS9490R with LMCE.  Take a look at:

http://forum.linuxmce.org/index.php/topic,11328.150.html

And my chat with Techstyle: http://forum.linuxmce.org/index.php/topic,13040.msg94271.html#msg94271

I know RULE#1......12 months+?
Should I just bin it in parts bin and buy something else? ???

Regards
Wooly
« Last Edit: February 01, 2013, 11:11:34 pm by wooly »
1004 dvd install from snapshot (regular update/upgrade)
Core/Hybrid:
P4
ATI
DS9490R 1wire (1off DS18B20 working)

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Magic Fingers wanted to get 'DS9490R 1wire usb adapter' working!
« Reply #1 on: January 29, 2013, 03:55:21 pm »
I do not have a 1-wire setup here, however, if somebody would send me a 9490R, and a couple of sensors, I could do the necessary work to debug the implementation.

-Thom

mkbrown69

  • Guru
  • ****
  • Posts: 213
    • View Profile
Re: Magic Fingers wanted to get 'DS9490R 1wire usb adapter' working!
« Reply #2 on: January 29, 2013, 10:40:03 pm »
Thom,

Actually, if you're able to make the C++ 1-wire device template more flexible, to accommodate more of the OWFS supported devices, that may solve the problem.  Right now it's hard-coded to expect a serial type device, which rules out all the network, i2c, and other types of OWFS bus masters <http://owfs.org/index.php?page=bus-masters>

In my case, I'd like to be able to use my Raspberry Pi as a networked OWFS control node.  I have some quick and dirty bash scripts running that do owreads into a variable, and then do a messagesend to a manually created device on the core.  Works well enough for proof-of-concept, and I can see the little Thermometer icon on the floor plans.

Just a thought...

Thanks!

/Mike

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Magic Fingers wanted to get 'DS9490R 1wire usb adapter' working!
« Reply #3 on: January 30, 2013, 10:04:55 am »
Adding other adapter types is straightforward. The OneWire DCE device uses the OWCAPI (the C API from the OWFS project). The initialisation is done with the ow_init() call described here: http://owfs.org/uploads/owcapi.1.html#sect8
As you can see it takes the same device options as owfs(5), so besides serial devices it is also possible to specify a tcp connection to an owserver instance or usb devices (e.g. "usb"). ow_init() is called here: http://svn.linuxmce.org/trac.cgi/browser/branches/LinuxMCE-1004/src/OneWire/OneWire.cpp#L78
Code: [Select]
72         string port = TranslateSerialUSB(DATA_Get_COM_Port_on_PC());
[…]
78         if (OW_init(port.c_str())==0) {
[…]
the "port" string would need to be assigned with other owfs device options to achieve the wanted behaviour. So one could probably add a device parameter for a specific owfs init string. If that is set it would take precedence over COM_Port_on_PC.

A quick hack in the database to test if I'm right could look like this:
update Device_DeviceData set IK_DeviceData='usb'  where FK_DeviceData=37 and FK_Device=<id of your OneWire device>;
rock your home - http://www.agocontrol.com home automation

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Magic Fingers wanted to get 'DS9490R 1wire usb adapter' working!
« Reply #4 on: January 30, 2013, 10:08:29 am »
Another option would be to just set the port string to "usb" when the DATA_Get_COM_Port_on_PC() is empty (because no serial port was set in the web admin):

Code: [Select]
72         string port = TranslateSerialUSB(DATA_Get_COM_Port_on_PC());
73             if (port == "") port = "usb";

That would not allow people to use tcp or other connection methods, but it would at least fail back to USB when no serial port is set..
rock your home - http://www.agocontrol.com home automation

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Magic Fingers wanted to get 'DS9490R 1wire usb adapter' working!
« Reply #5 on: January 30, 2013, 10:50:16 am »
this is untested but could work: http://svn.linuxmce.org/trac.cgi/changeset/27136
rock your home - http://www.agocontrol.com home automation

wooly

  • Regular Poster
  • **
  • Posts: 16
    • View Profile
Re: Magic Fingers wanted to get 'DS9490R 1wire usb adapter' working!
« Reply #6 on: January 30, 2013, 12:11:38 pm »
Hari,
How do I test/get this? sqlCVS update and or apt-get update?
Sorry newbie question's :D
Also I may have broke the 1wire template 2161, By making changes to device data section!
Is there a way to get it back to original?

Many thanks for your help

Wooly

1004 dvd install from snapshot (regular update/upgrade)
Core/Hybrid:
P4
ATI
DS9490R 1wire (1off DS18B20 working)

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Magic Fingers wanted to get 'DS9490R 1wire usb adapter' working!
« Reply #7 on: January 30, 2013, 01:50:52 pm »
you can revert the local changes in the sqlcvs section of the web admin
rock your home - http://www.agocontrol.com home automation

wooly

  • Regular Poster
  • **
  • Posts: 16
    • View Profile
Re: Magic Fingers wanted to get 'DS9490R 1wire usb adapter' working!
« Reply #8 on: January 30, 2013, 09:38:12 pm »
I can now report success ;D (adapter registered)
THANK YOU Hari
I did need to make changes to my device template 2161 though to get it to work:
Comm Method was saying 'RS232' so changed to 'Please select'
Under Device data - 37 com port on pc (string) - Default value - was still saying 'dev/ttyS0' so just deleted value and saved template then reload.....Thats it, it just worked ;D

Sorry Thom was nearly ready to put DS9490R in post to you!

Wish I could code, tried programing a pic chip once in C+ gave up after 2weeks & used pic basic instead took 1day.

Respect,

Wooly
« Last Edit: January 30, 2013, 09:51:15 pm by wooly »
1004 dvd install from snapshot (regular update/upgrade)
Core/Hybrid:
P4
ATI
DS9490R 1wire (1off DS18B20 working)

Marie.O

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3676
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: Magic Fingers wanted to get 'DS9490R 1wire usb adapter' working!
« Reply #9 on: January 31, 2013, 06:41:46 am »
wooly,

why don't you put that DS9490R into the post to TSCHAK as a thank you for his work anyhow? Or visit http://www.linuxmce.org, and donate...

Just a thought

wooly

  • Regular Poster
  • **
  • Posts: 16
    • View Profile
Re: Magic Fingers wanted to get 'DS9490R 1wire usb adapter' working!
« Reply #10 on: January 31, 2013, 08:39:55 pm »
posde,

Was thinking I would make a donation as I don't have to buy a new 1wire adapter, although I am destitute at the moment that may change in the next few weeks, so watch this space...

As far as I know it was Hari that fixed 1wire....Thom just offered to if he got a DS9490R, so please read full topic thread.

Respect to all dev team.

Wooly
1004 dvd install from snapshot (regular update/upgrade)
Core/Hybrid:
P4
ATI
DS9490R 1wire (1off DS18B20 working)

Marie.O

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3676
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: Magic Fingers wanted to get 'DS9490R 1wire usb adapter' working!
« Reply #11 on: January 31, 2013, 09:05:10 pm »
I read the whole thread. hari and tschak both deserve as much "Thank you"s as you can offer. Without them, there would be no LinuxMCE.

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Magic Fingers wanted to get 'DS9490R 1wire usb adapter' working!
« Reply #12 on: January 31, 2013, 10:21:00 pm »
he said thank you :-)
rock your home - http://www.agocontrol.com home automation

Techstyle

  • Addicted
  • *
  • Posts: 674
    • View Profile
    • Techstyle UK Ltd.
Re: Magic Fingers wanted to get 'DS9490R 1wire usb adapter' working!
« Reply #13 on: February 01, 2013, 04:22:03 am »
Quote
I can now report success Grin (adapter registered)

did any sensors show up?

wooly

  • Regular Poster
  • **
  • Posts: 16
    • View Profile
Re: Magic Fingers wanted to get 'DS9490R 1wire usb adapter' working!
« Reply #14 on: February 01, 2013, 10:59:14 pm »
Techstyle,
Yes just plug sensor in on parasitic reboot and there it was/is as child of 1wire ;D
1004 dvd install from snapshot (regular update/upgrade)
Core/Hybrid:
P4
ATI
DS9490R 1wire (1off DS18B20 working)