PiDome Forum

PiDome platform forum.

You are not logged in.

#1 2015-11-30 13:06:50

paulot
Member
Registered: 2015-11-30
Posts: 13

PiDome UniPi DS18B20 sensor over 1-wire

Hi

Got the UniPi board connected to RPi2, with PiDome server installed, all devices are working ok (have tested relays and digital inputs) except for a DS18B20 sensor that is connected over 1-wire.

If I try to list all devices with http://your.unipi.ip.address/rest/all/, I get the info of the DS18B20 sensor, but the sensor is not showing on the devices of the UniPI board over the server web interface. Do I have to create a custom device to read the temperature sensor?


Any help would be appreciated, thanks

Offline

#2 2015-11-30 13:54:10

John
PiDome Dev
From: Netherland
Registered: 2015-01-07
Posts: 604
Website

Re: PiDome UniPi DS18B20 sensor over 1-wire

Yes this is correct, a custom device has to be created. If you have multiple sensors a custom device only has to be created once.

after creation add the device using "Add devices". If you have multiple of these sensors you can add the custom device multiple times with each it's different address.

Offline

#3 2015-12-01 11:08:15

paulot
Member
Registered: 2015-11-30
Posts: 13

Re: PiDome UniPi DS18B20 sensor over 1-wire

John wrote:

Yes this is correct, a custom device has to be created. If you have multiple sensors a custom device only has to be created once.

after creation add the device using "Add devices". If you have multiple of these sensors you can add the custom device multiple times with each it's different address.

Hi John, thanks for the reply.

I've tried to create one custom device that could be used multiple times, but I couldn't get it to work.

I've followed this manual http://pidome.org/support/manual/device … oards.html, and I've added a custom device with a data field (float) having the one-wire address (circuit) of an one-wire sensor as a controlID and the dev type as the groupID. Added a new device based in the custom device I've created with the adress (circuit) of the one-wire sensor. It works OK. But to read the second sensor I need to add it to the Custom device, inside the same group and with the one-wire address (circuit) of an one-wire sensor as a controlID. So this way I have a single device with both the sensors.

Thanks for the help.

Offline

#4 2015-12-02 00:57:13

John
PiDome Dev
From: Netherland
Registered: 2015-01-07
Posts: 604
Website

Re: PiDome UniPi DS18B20 sensor over 1-wire

You could add the second sensor in a new custom device with the exact same setup but with only the control id different. It is possible to create one big massive device.

My apologies for this sentence: "If you have multiple sensors a custom device only has to be created once". I was busy with z-wave devices at the moment of writing, which are address agnostic where the UniPi addressing is not.

I could have done it different but then the freedom in creating devices according user situations was not possible. I have been thinking of a pure address based solution, but this would mean that every single button and sensors is treated as a separate device, 50 relays and 10 one wire sensors would mean 60 devices in the list. With the current solutions users have a choice on what to combine in a custom device. for example i have the first 4 relays in one custom device for the living room, 3 others in a custom device for the kitchen etc... (Well currently disconnected as the Raspberry Pi is currently abused for other purposes)

Offline

#5 2015-12-02 01:10:57

paulot
Member
Registered: 2015-11-30
Posts: 13

Re: PiDome UniPi DS18B20 sensor over 1-wire

It's a good solution, either way. If I want to separate them I just create another custom device, but getting them grouped works out even better for my logical structure.

Two small questions:
I've noticed that the reading of the sensors are not equally timed, at least for what is being displayed in the web interface, sometimes I get about 10 seconds (more or less) of no data, and sometimes the temperature is read once a second. Is this only for the information of the web interface, or if I create an Automation rule for reading the sensor ever x seconds and do some action with it, will it work every x seconds?

Second how can I access the data externally, is it stored in a database?

Last edited by paulot (2015-12-02 01:14:44)

Offline

#6 2015-12-02 01:28:18

John
PiDome Dev
From: Netherland
Registered: 2015-01-07
Posts: 604
Website

Re: PiDome UniPi DS18B20 sensor over 1-wire

I agree with you about grouping, and also give the user the choice..

The sensor data is being read from a websocket connected to the evok engine. sensor data is (if the browser supports websockets) updated in real time. the send and receive times currently are not updated unless the device is re-opened. This will be added in later implementations. So there is no need to implement automation rules to speed up or re-arrange any data updating regarding to sensors. Also button states are being updated via websocket os if another system updates PiDome will follow. Also to keep resource usages low, if data is exact between two readings the second reading is not published.

Yes data is stored in freely accessible sqlite databases as round robin fifo storage for minutes and hourly, daily data is preserved. because we are primarily focussing on the raspberry pi with an sd-card in mind we want to as less resources as possible in both storage and write actions. As the project grows more functionality will be added like the choice to disable round robin storage or use other storage plans.. But for now, we are focussing on a beta release when all minimal alpha planned functionalities are build in.

In the devices list you will see an id next to the device. This correspondents with the id of the data storage database (every device has it's own one.) and are stored in "databases/devices/" device 1 has database "databases/devices/1.data"

Offline

#7 2015-12-02 01:57:11

paulot
Member
Registered: 2015-11-30
Posts: 13

Re: PiDome UniPi DS18B20 sensor over 1-wire

I just have to say, awesome John.

It's more than more than enough for what I need. I've been having fun with piDome and the uniPi board.

Next step is to control dimming on a 5 channel LED. I'm using an i2c-controlled PWM driver board connected to the uniPi, to control a 5 channel LED. This should be a custom driver, right?

Offline

#8 2015-12-02 15:39:19

John
PiDome Dev
From: Netherland
Registered: 2015-01-07
Posts: 604
Website

Re: PiDome UniPi DS18B20 sensor over 1-wire

Thanks!

A driver is the software part that sits between the connected hardware and the devices on the server. In this case it is the unipi driver... This driver has not yet any i2c routines implemented. I will be busy with the UniPi board again next week. There is an i2c driver present in the server, but this would interfere with the UniPi i2c implementation.

I have a blinkm laying around at home, to be able to start with a minumum implementation for i2c to begin with, and extend this to your use case. As it is i2c it will be quite straight forward....

Is this 2c RGB driver using a single address with multiple memory addresses or multiple i2c addresses (i have seen these kind of implementations passing by)?

Is this i2c device also being controlled using the evok configuration or just added to the i2c pins and you need an own custom implementation?

Offline

#9 2015-12-02 16:12:13

paulot
Member
Registered: 2015-11-30
Posts: 13

Re: PiDome UniPi DS18B20 sensor over 1-wire

TThe board uses I2C 7-bit address between 0x60-0x80, selectable with jumpers. It will be connected to uniPi by the second I2C port. As I've read in the uniPi website it's possible to connect multiple i2c devices in this second i2c port.

The board I'm using: http://www.adafruit.com/products/815. The good thing is that this board has a built in clock so I don't need to keep updating the value of the PWM.

I'm using this to control a LED for an aquarium. The LED have 5 individual channels for different wave lengths, and I need to set then with a different value along the 24h cycle of day. I'm not sure how to store the values I need to send, they are not calculated with any kind of math formula, so I need to keep this values in a file, the data isn't going to change a lot of times, so I can create a file with the values along the day, and have a Automation rule that simply get the value from the file and sent it to the PWM channel. Those this make any sense or should I be going some other way?

Offline

#10 2015-12-02 17:17:04

John
PiDome Dev
From: Netherland
Registered: 2015-01-07
Posts: 604
Website

Re: PiDome UniPi DS18B20 sensor over 1-wire

To take a closer look into the correct way of approaching this with PiDome is for me to read the product sheet so i know how data is being expected, i hope it is a general approach like:
Channel one: 0x65 x010 [data]
Channel two: 0x65 x011 [data]
Channel three: 0x65 x012 [data]

When this is known i know how the device works. maybe a device needs to be programmed so it sends multiple values at once, it depends on the specs. When these things are known i can also tell a bit more about the automation rules setup or the current working on feature "data suppliers".

Data suppliers are little scripts running on the server which are able to supply data to devices. for example specific commands at timed intervals or based on time of day etc...


I can tell you more next week when i am able to do stuff with the UniPi again.

Offline

#11 2015-12-02 17:56:17

paulot
Member
Registered: 2015-11-30
Posts: 13

Re: PiDome UniPi DS18B20 sensor over 1-wire

OK John,

Is there a way to simple execute external programs written in other languages? Adafruit has a libray to access the board written in Pyhton. I could write a program in Pyhton that reads the time of the system, get the info from a file, and then execute the function of the Adafruit library to change the settings of the LED. This could be executed in an Automation rule ever each x minutes... As I don't need to control it over the web interface, I could run this as a background process isolated from the piDome server but this will limit future features that I could try to implement, as for example configuration on the values of the channels over time on the web interface.

Last edited by paulot (2015-12-02 18:11:45)

Offline

#12 2015-12-08 11:08:49

John
PiDome Dev
From: Netherland
Registered: 2015-01-07
Posts: 604
Website

Re: PiDome UniPi DS18B20 sensor over 1-wire

Hi Paulot,

no currently not yet, there is an open feature request to run scripts using command line. I'm still busy with investigating a correct implementation as this could introduce security threats and act like work around to access files which then are able to be manipulated... This is till in our investigation stage.

Cheers,
John.

Offline

#13 2017-07-24 10:42:00

DonaldDorce
Member
From: USA
Registered: 2017-07-24
Posts: 20
Website

Re: PiDome UniPi DS18B20 sensor over 1-wire

where can i buy cheap cialis
<a href="http://cialiswby.com/">tadalafil 20 mg</a>
buy cialis singapore
generic cialis 20 mg
can you order cialis


cialis buy over counter http://cialiswby.com/ how to cut a cialis pill in half

Offline

#14 2017-10-06 17:39:26

NoellEagan
Member
Registered: 2017-10-06
Posts: 1

Re: PiDome UniPi DS18B20 sensor over 1-wire

Hi...i am a new user here. As per my knowledge there is no need to implement automation rules to speed up or re-arrange any data updating regarding to sensors. Also button states are being updated via websocket os if another system updates PiDome will follow.

Offline

Board footer