DIY Raspberry PI Tank Monitor Project

Discussion in 'Equipment / DIY / Reviews' started by Rob, Jun 5, 2012.

  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Users Viewing Thread (Users: 0, Guests: 0)

  1. onkel.paul

    onkel.paul Member

    Messages:
    16
    Ratings:
    +0
    Country:
    Germany
    State:
    NRW
    Hi @Rob,
    Thanks for the info rrdtool create !
  2. macca_75

    macca_75 Member

    Messages:
    2,277
    Ratings:
    +1,200
    Country:
    Australia
    State:
    Vic
    Sorry - he has it (the card) now.
  3. onkel.paul

    onkel.paul Member

    Messages:
    16
    Ratings:
    +0
    Country:
    Germany
    State:
    NRW
    Hi @macca_75,
    I've seen your Pi. again running a bit!!!

    "It works!
    This is the default web page for this server.

    The web server software is running but no content has been added, yet."


    I have the following times for the html. hicharts JS tried:

    Code:
    ### Write data to a tendency file.txt ###
    echo -n "$ sec," >> / media / log data / 24h_daten / 24_achse_zeit.txt
    echo -n "$ TeichPH, 0" >> / media / log data / 24h_daten / 24_achse_ph.txt
    echo -n "$ TeichRedox, 0" >> / media / log data / 24h_daten / 24_achse_orp.txt
    and so on.
    But is not so good!:(

    Wish you have a nice evening!
  4. macca_75

    macca_75 Member

    Messages:
    2,277
    Ratings:
    +1,200
    Country:
    Australia
    State:
    Vic
    Correct - apache is loaded but I haven't restored data yet. Still also need to get 1wire, I2C working, etc
  5. onkel.paul

    onkel.paul Member

    Messages:
    16
    Ratings:
    +0
    Country:
    Germany
    State:
    NRW
    Hi @macca_75,
    what you have to work on the ICĀ² on?
  6. macca_75

    macca_75 Member

    Messages:
    2,277
    Ratings:
    +1,200
    Country:
    Australia
    State:
    Vic
    Sorry - I thought I was waiting on a reply from you @onkel.paul

    I use the I2C for some Atlas Probes (pH, ORP).

    I use the 1Wire for 3 x Temp probes.

    I have access to all my old scripts so let me know what you need/want specifically.

    I've also started using mjpeg_stream to control my web cam - works really well.

    http://macca.myreef.info:8080/javascript_simple.html
  7. onkel.paul

    onkel.paul Member

    Messages:
    16
    Ratings:
    +0
    Country:
    Germany
    State:
    NRW
    Hi @macca_75 ,

    the SKRIBT I'd like to read back from. * RRD to eg "24_average_heater.txt"> daily.html "> weekly.html> monthly.html> myreef.info/yearly.html for hicharts JS!

    The SKRIBT to read Atlas Probes (pH, redox) via I2C me I would be interested in've only script for URAT but my new probes can also I2C.

    You have my E.mail address in your Private Message!

    What you control even with the Pi to your REEF?

    OK.?
    Thanks in advance!
    Last edited: Jan 20, 2015
  8. Clownfishy

    Clownfishy Member

    Messages:
    98
    Ratings:
    +16
    Country:
    United Kingdom
    State:
    Gloucestershire
  9. Clownfishy

    Clownfishy Member

    Messages:
    98
    Ratings:
    +16
    Country:
    United Kingdom
    State:
    Gloucestershire
    Is anyone still interested in progressing the Aqua Pi or is this now dead?
  10. Poelie

    Poelie Member

    Messages:
    1
    Ratings:
    +0
    Country:
    Other
    State:
    Nederland
    @Clownfishy I hope the project s'not dead. I started this week with the project for my koi pound. software already running and waiting for the probes. currently running the web gui of rob but I like to make a more fancy interface with webcam support.
  11. macca_75

    macca_75 Member

    Messages:
    2,277
    Ratings:
    +1,200
    Country:
    Australia
    State:
    Vic
    @Poelie
    If you want to stream webcam from a PI, check out mjpg-streamer

    I am using it with a Logitech C510 (not all camera work the same)

    Here is the default landing page
    http://macca.myreef.info:8080/

    And the one I use most (works in every browser tested to date)
    http://macca.myreef.info:8080/javascript_simple.html

    (NOTE: You may not see much as it is live, depending on the time of day)

    takes about 1% CPU and not a lot of memory. I have slowed stream down to 1fps as that's all my bandwidth out can handle. easily 720p@30fps (about 5% CPU from memory) and is very smooth on local network.
    • Love It! Love It! x 1
  12. Rob

    Rob Member

    Messages:
    875
    Ratings:
    +703
    Country:
    Australia
    State:
    Victoria
    Macca You must of cleaned the glass before posting your link haha.. Its crystal clear.

    Project itself... Its not dead however Im not progressing any further myself as I have the data, can trend it and since I created the overlay buttons where you can overlay last weeks data ontop of this weeks to compare the trend it now does everything I wanted. Although in saying that I do run a profilux to do all the control. The Pi has been very reliable and if you wanted to expand this to turn on/off non critical devices I would not hesitate.

    Camera: If you use your iphone, you can create a link (home screen bookmark/icon thing !) direct to your camera feed. Doing this you end up with a full screen (i.e. no safari menu bars) from an icon, it kind of looks like an app. I did play with the widthxhieght of the camera setup so it fills the creen nicely. I have also now placed the ph orp and temp reading as a text overlay on the camera feed. So when its displayed on the phone you see the camera feed and the parameters. You just need to google on how to overlay text. its generally used to overlay date and time, you simply use the bash script where your collecting the data and update the camera feed text command.
    Last edited: Apr 3, 2015
  13. leaky john

    leaky john Member

    Messages:
    8
    Ratings:
    +2
    Country:
    United Kingdom
    State:
    london
    I am also working on the ph probe kit with raspberrypi using i2c

    so far I have got it all wired up and its seem to be flashing correctly and its returning an whole bunch of values

    the next step for me is where i am bit stuck on is what these ouput values means and reading it in human friendly format

    i appreciate any pointer or snippet code for i2c via ph kit probe.

    I can post some really basic output if requested

    thanks
  14. Rob

    Rob Member

    Messages:
    875
    Ratings:
    +703
    Country:
    Australia
    State:
    Victoria
    Hi Sorry, Macca & I have only used the Serial Interface. Looking at the example I2C code on the Atlas Scientific web site (I2C for Arduino) it seems to provide the value simply in pH units. I2C should be a good option for multiple sensors alot better than having to multiplex the RPi serial port.
  15. leaky john

    leaky john Member

    Messages:
    8
    Ratings:
    +2
    Country:
    United Kingdom
    State:
    london
    @Rob I have reading on the all good work everyone been doing here

    hardware:-

    I2C enabled on PH stamp and directly connected to RPI 2 B+ GPIO I2C pins

    so here is the initial script (hope the format readable)

    #!/usr/bin/python
    import smbus
    import time

    bus = smbus.SMBus(1)

    #address of i2c ports
    ph = 0x63

    #probe i2c cmd
    cmd = 0x52 # R = read probe

    #playing with time delay
    delay = 1.5

    #main logic
    while True:
    try:
    print bus.read_i2c_block_data(ph, cmd, 48)
    time.sleep(delay)

    except IOError:
    pass

    And the output is (4 lines) :-

    [254, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 201, 118, 1, 82, 204, 118, 8, 0, 0, 0, 108, 20, 187, 126, 99]
    [254, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 201, 118, 1, 82, 204, 118, 8, 0, 0, 0, 108, 20, 187, 126, 99]
    [254, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 201, 118, 1, 82, 204, 118, 8, 0, 0, 0, 108, 20, 187, 126, 99]
    [254, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 201, 118, 1, 82, 204, 118, 8, 0, 0, 0, 108, 20, 187, 126, 99]

    If am correct in recalling various atlas documents that

    254 means "pending" ? 99 means address (ASCII/DEC for ph meter 0x63) ? apart from maybe bit more everything else is alien to me atm

    while messing about i have managed to return value of 1 (success) rather than the usual 254 (pending)

    for now not been able figure out on getting repeatability of the value of 1 even when i have played about with the timing.

    will pop back if i have more luck :)
  16. Rob

    Rob Member

    Messages:
    875
    Ratings:
    +703
    Country:
    Australia
    State:
    Victoria
    I realise its a silly question but, Do you have the probe connected and in water so it can generate a valid response ? I was hoping I could see an ascii value of 46 (.) somewhere in the string as a pointer to the actual value...
  17. leaky john

    leaky john Member

    Messages:
    8
    Ratings:
    +2
    Country:
    United Kingdom
    State:
    london
    I welcome any suggestions :)

    Yes the probe is connected and it is sitting in the storage solution at the moment which i believe has a value of 4.0 ph.

    Your are right i too was expecting some other recognizable set of ascii values such as numbers from 48 (0) to 57 (9) and couple others as well ..

    here another set of outputs from the same script i posted above sending the R command (Returns a single reading) :-

    [254, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 202, 118, 1, 82, 211, 118, 8, 0, 0, 0, 108, 212, 201, 126, 99]
    [254, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 202, 118, 1, 82, 211, 118, 8, 0, 0, 0, 108, 212, 201, 126, 99]
    [254, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 202, 118, 1, 82, 211, 118, 8, 0, 0, 0, 108, 212, 201, 126, 99]

    my conclusion so far :-

    i noticed the bold and 0 (zero/null) are always in the same position and values, the other values seem meaningless they do change but only when stop and re-start the script.

    [254, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 202, 118, 1, 82, 211, 118, 8, 0, 0, 0, 108, 212, 201, 126, 99]


    ascii > hex > (desc/symbol) ph commands
    254 > FE > (some icon) pending
    128 > 80 > (euro sign) seems meaningless
    0 > 00 > (null) termination and or transmission marker
    118 > 76 > (lowercase v) seems meaningless
    1 > 01 > (SOH) Start of Heading ? seems meaningless
    82 > 52 > (uppercase R) Returns a single reading from probe
    8 > 08 > (backspace) seems meaningless
    108 > 6C > (lowercase l) seems meaningless
    126 > 7E > (~ an tilde) seems meaningless
    99 > 66 > (lowercase v) seems meaningless

    reference for ascii-code.com

    Other things i have checked is that i am reading 48 bytes (for troubleshooting purposes), I really should be reading 7(8?) bytes which also includes the 5 bytes of the PH value.

    [254, 128, 0, 0, 0, 0, 0, 0]

    The 254 is the pending command so I guess it might be timing issue i have tried various delays setting ranging from 0.3 sec to 1.3s to 5 secs and all pretty much the same results "pending".

    Thank you for your time
    Last edited: Apr 9, 2015
  18. Rob

    Rob Member

    Messages:
    875
    Ratings:
    +703
    Country:
    Australia
    State:
    Victoria
    I would send the output to Atlas, I emailed them a number of times and they have always been very helpful...

    The other things come to mind...

    you are powering from 3.3V
    I understand the RPi has the I2C pullup resisters on the board, so no need for external pullup resistors.

    If all else fails for I2C you can always go back to serial :)
  19. leaky john

    leaky john Member

    Messages:
    8
    Ratings:
    +2
    Country:
    United Kingdom
    State:
    london
    thank for the fast reply

    Yes i am on 3.3V and i can confirm I have not added any additional pullup resisters either.

    I could fallback to serial which i not tested yet.

    Will try an email atlas later like you suggested it would be nice to get the I2C working so i can add other planned sensors

    thanks again
  20. saltychris

    saltychris Member

    Messages:
    1
    Ratings:
    +0
    Country:
    Australia
    State:
    nsw
    The pending message suggests that maybe you need to write to it first.
    Maybe something like:

    bus.write_byte(address, R)
    time.sleep(1)
    print bus.read_i2c_block_data(address ,7)

Share This Page