News:

Rule #1 - Be Patient - Rule #2 - Don't ask when, if you don't contribute - Rule #3 - You have coding skills - LinuxMCE's small brother is available: http://www.agocontrol.com

Main Menu

(NOW WORKING) 'DS9490R 1wire usb adapter' working!

Started by wooly, January 28, 2013, 11:28:15 PM

Previous topic - Next topic

wooly

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
1004 dvd install from snapshot (regular update/upgrade)
Core/Hybrid:
P4
ATI
DS9490R 1wire (1off DS18B20 working)

tschak909

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

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

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

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 - [url="http://www.agocontrol.com"]http://www.agocontrol.com[/url] home automation

hari

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):


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 - [url="http://www.agocontrol.com"]http://www.agocontrol.com[/url] home automation

hari

rock your home - [url="http://www.agocontrol.com"]http://www.agocontrol.com[/url] home automation

wooly

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

you can revert the local changes in the sqlcvs section of the web admin
rock your home - [url="http://www.agocontrol.com"]http://www.agocontrol.com[/url] home automation

wooly

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
1004 dvd install from snapshot (regular update/upgrade)
Core/Hybrid:
P4
ATI
DS9490R 1wire (1off DS18B20 working)

Marie.O

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
If I helped you, feel free to buy me a coffee: [url="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2VKASZLTJH7ES"]https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2VKASZLTJH7ES[/url]

wooly

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

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.
If I helped you, feel free to buy me a coffee: [url="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2VKASZLTJH7ES"]https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2VKASZLTJH7ES[/url]

hari

rock your home - [url="http://www.agocontrol.com"]http://www.agocontrol.com[/url] home automation

Techstyle

QuoteI can now report success Grin (adapter registered)

did any sensors show up?
Techstyle UK Ltd
[url=http://www.techstyleuk.co.uk]http://www.techstyleuk.co.uk[/url]

Techstyle US Inc.
[url=http://www.techstyleus.com]http://www.techstyleus.com[/url]

wooly

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)