About Us Knowledge Base Community Forum Electronics Toolbox FAQ Shipping & Delivery

Community Forum

Share your projects and post your questions

Search
Register or Sign In
Forum

1 Wire & my Devices

1043 Views - Created 02/02/2018

02/02/2018

Posted by:
Clownfishy

Users Avatar

Has anyone managed to get their 1 Wire Pi posting data into https://mydevices.com/cayenne/signin/.  They state that as long as the devices are using pin 4, they should just be recognised.  I am in no way an expert on GPIO and how just fumbling around with minimal knowledge using the PI but would really like to get the 1wire temperature sensors hanging off the 1 wire reporting into my Devices.  I have them all working locally using owfs and the fantastic documentation found on this site so I know everything works.

Any pointers would be gratfully received

02/02/2018

Posted by:
andrew

Users Avatar

Location:
United Kingdom

Users Twitter  Users Website  

After looking through the cayenne website it looks like the DS2482-100 chip used in the 1 Wire Pi isn't supported at the moment.  I found this forum post on their support forum from December 2016 where there is a mention of adding support for the DS2484 to their roadmap but I couldn't find any other mention of whether or not it has been added as a supported device.

I will have a dig through their API to see if it is possible to add our boards to their system but in the mean time it may be worth posting a message on their forums to see if they have any plans to add support for the DS2482-100.

AB Electronics UK Tech Support

02/02/2018

Posted by:
Clownfishy

Users Avatar

Wow, what a very fast response, thank you :-)  I have now logged a question on their message board so I will ask teh question. I really am a novice but thanks to your board, I have 4 temperature 1 wire sensors hanging off of it and was hoping I can push this data to Cayenne.  It would be awesome to see your board listed on there :-)  I started looking at their option to add an "app" but I am getting way beyond my knowledge of code writing.  My thought process was that if the board is not supported by Cayenne, maybe I could push the data from OWFS using curl or something but as I said, I am strugging to know where to start let alone learn how to do this!!! 

Thanks again for your help as I am trying to reserect the buiding of an aquarium monitor listed below and was hoping to use Cayenne to display the data -
https://thereefuge.com/threads/raspberry-pi-tank-monitor-project.3475/

On other question, can this same 1 Wire Pi board be used in some way to connect to the ph altas scientifc circuit -https://www.atlas-scientific.com/product_pages/circuits/ezo_ph.html

 

 

 

 

02/02/2018

Posted by:
Clownfishy

Users Avatar

Updating this thread with the thread on Cayenne's support forum asking when Cayenne will support DS2482-100

http://community.mydevices.com/t/ab-electronics-1-wire-pi/7553/2

02/02/2018

Posted by:
andrew

Last edited: 02/02/2018

Users Avatar

Location:
United Kingdom

Users Twitter  Users Website  

The Ezo PH board does not support 1 Wire so you can not connect it to the Raspberry Pi through the 1 Wire Pi but it does support I2C and UART so you can connect it directly to the GPIO header on your Raspberry Pi.

Atlas Scientific have some sample code on their website at https://www.atlas-scientific.com/_files/code/pi_sample_code.pdf

The easiest way to connect the board would be to use the UART bus which is pins 8 and 10 on the GPIO header.  You will need to connect the Vcc pin on the board to pin 1 or 3.3V on the Raspberry Pi GPIO, GND connects to pin 6 on the GPIO header,  RX goes to pin 8 and TX goes to pin 10.  You can find a list of the GPIO pins at https://pinout.xyz/

Just make sure you are powering the board from the 3.3V pin and not 5V otherwise you could damage the UART pins on the GPIO header.

To use use UART bus on your Raspberry Pi you will first need to enable it and disable the console mode which is what Raspbian linix is set to by default.  We have a tutorial for the Raspberry Pi 1, 2 and Zero at https://www.abelectronics.co.uk/kb/article/20/raspberry-pi-serial-port-usage and for the Raspberry Pi 3 and Zero W at https://www.abelectronics.co.uk/kb/article/1035/raspberry-pi-3-and-zero-w-serial-port-usage

AB Electronics UK Tech Support

03/02/2018

Posted by:
andrew

Users Avatar

Location:
United Kingdom

Users Twitter  Users Website  

I have had some success after playing with the mydevices.com system.  You can connect custom devices using the Python Cayenne MQTT client so I wrote a basic python script which connects to mydevices.com using the MQTT client and uploads the temperature for any connected 1-Wire devices every 10 seconds.

You can find the script at https://github.com/abelectronicsuk/testscripts/blob/master/cayenne_1wire_temperature.py

To get the script working you will first need to install the Cayenne system on your Raspberry Pi if you haven't done so already.  You can do this on the Catenne dashboard by clicking "Add new...", select Raspberry Pi and follow the instructions.

Next install the python MQTT library with the command below on your Raspberry Pi.

pip install cayenne-mqtt

To add the 1-Wire sensors click the "Add new..." button, select "Devices & Widgets" and then "Bring Your Own Thing".  A page will load with a list of SDKs on the left and the device details on the right.  You will need to copy the MQTT username, password and client ID into the python script I wrote, replacing the "USERNAME", "PASSWORD", and "CLIENT_ID" strings on lines 8, 9 and 10.  Now run the python script with:

python cayenne_1wire_temperature.py

If the script works correctly you should get a list of the available 1-Wire devices appear on the screen and then it will start uploading the temperatures from each sensor every 10 seconds.

Hopefully this will help you get your sensors onto the Cayenne system.

AB Electronics UK Tech Support

Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view, download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.