1 Wire & my Devices
2194 Views - Created 02/02/2018
Any pointers would be gratfully received
I will have a dig through their API to see if it is possible to add our boards to their system but in the meantime, it may be worth posting a message on their forums to see if they have any plans to add support for the DS2482-100.
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 -
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
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 the UART bus on your Raspberry Pi you will first need to enable it and disable the console mode which is what Raspbian Linux 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/1035/serial-port-setup-in-raspberry-pi-os
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 Cayenne dashboard by clicking "Add new...", selecting Raspberry Pi and following 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:
If the script works correctly you should get a list of the available 1-Wire devices that 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.
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.