LinuxMCE Forums
General => Developers => Topic started by: wooly 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 (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 (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
-
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
-
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
-
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>;
-
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..
-
this is untested but could work: http://svn.linuxmce.org/trac.cgi/changeset/27136
-
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
-
you can revert the local changes in the sqlcvs section of the web admin
-
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
-
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
-
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
-
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.
-
he said thank you :-)
-
I can now report success Grin (adapter registered)
did any sensors show up?
-
Techstyle,
Yes just plug sensor in on parasitic reboot and there it was/is as child of 1wire ;D
-
Perhaps I should reboot then, it has been months since I rebooted!
-
I rebooted, 9 hours ago. still no sensor. I checked the sensor was connected properly earlier using the maxim graphing tool.
-
Techstyle,
This is what I did pulled updates & upgrade(after hari's changes).
Delete exiting 1wire child if have one, create new 1wire child (used wizard).
Went into template and changed: 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
installing new software message.......wait to finished message
Click restart.
check 1wire says registered.
Plugged in sensor......new software message........finished install message
Restart
back to web-admin child sensor of 1 wire created and showing temp
selected what room sensor is in + gave it a individual name
now shows under climate-floorplan.
-
I had already done all the things you suggest. I did a couple of reboots after due to some other reasons then all of a sudden the sensor showed up. not sure I understand it but it is working. See below
-
Yes, it is cold in my basement!!
I was trying to set up an event that warns me if the temp drops below 9 deg C but that will be another thread.....
-
The Device Template was updated, submitted and approved with the two changes in this thread. The DS9490R should work now with the stock template