|
|
|
tschak909
|
 |
« 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
|
|
|
|
|
Logged
|
|
|
|
|
mkbrown69
|
 |
« 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
|
|
|
|
|
Logged
|
|
|
|
|
hari
|
 |
« 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#sect8As 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#L7872 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>;
|
|
|
|
|
Logged
|
|
|
|
|
hari
|
 |
« 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): 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..
|
|
|
|
|
Logged
|
|
|
|
|
hari
|
 |
« Reply #5 on: January 30, 2013, 10:50:16 am » |
|
|
|
|
|
|
Logged
|
|
|
|
|
wooly
|
 |
« 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  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
|
|
|
|
|
Logged
|
1004 dvd install from snapshot (regular update/upgrade) Core/Hybrid: P4 ATI DS9490R 1wire (1off DS18B20 working)
|
|
|
|
hari
|
 |
« Reply #7 on: January 30, 2013, 01:50:52 pm » |
|
you can revert the local changes in the sqlcvs section of the web admin
|
|
|
|
|
Logged
|
|
|
|
|
wooly
|
 |
« Reply #8 on: January 30, 2013, 09:38:12 pm » |
|
I can now report success  (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  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 »
|
Logged
|
1004 dvd install from snapshot (regular update/upgrade) Core/Hybrid: P4 ATI DS9490R 1wire (1off DS18B20 working)
|
|
|
|
posde
|
 |
« 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
|
|
|
|
|
Logged
|
|
|
|
|
wooly
|
 |
« 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
|
|
|
|
|
Logged
|
1004 dvd install from snapshot (regular update/upgrade) Core/Hybrid: P4 ATI DS9490R 1wire (1off DS18B20 working)
|
|
|
|
posde
|
 |
« 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.
|
|
|
|
|
Logged
|
|
|
|
|
hari
|
 |
« Reply #12 on: January 31, 2013, 10:21:00 pm » |
|
he said thank you :-)
|
|
|
|
|
Logged
|
|
|
|
|
Techstyle
|
 |
« Reply #13 on: February 01, 2013, 04:22:03 am » |
|
I can now report success Grin (adapter registered) did any sensors show up?
|
|
|
|
|
Logged
|
|
|
|
|
wooly
|
 |
« 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 
|
|
|
|
|
Logged
|
1004 dvd install from snapshot (regular update/upgrade) Core/Hybrid: P4 ATI DS9490R 1wire (1off DS18B20 working)
|
|
|
|