Reefbot Help (Re-coding to cut the cloud)

  • Thread starter Thread starter Inamo
  • Start date Start date
  • Tagged users Tagged users None
Only needs maybe a 2gb card. Whole repository is <1gb, and it's that big because a lot of the old RK code is still in there and hasn't got cleaned up yet. If you want to run some tests to provide the color data points, I'd appreciate the help. Just let me know your github username or email in an DM and I'll add you to the repo.
 
I captured the test sequence, so the test is in there, but RK never did much with them. I did eventually want to work with them and see if I could get it working. A long time ago I tried to help Hady by doing manual tests with them and trying to get a starting point for them, but it took a lot of reagent to make any changes. I don't believe they ever purchased any to do their own chemistry. As the Trident and original ABC manufacture is closed holed on all of it. I think when I tried it in the Lab when they first added it as beta it was way off. I suspect they haven't done anything with it since.

I think the difference is the Lab adds more water than the trident. I believe the trident pulls much less tank water when it does the test. They advertise ~7.9ml per test, but I'd suspect less. If I get a chance after the rest of my tank maintenance, I'll try it with 1 and 2ml of water to see what happens.
I was also testing the ABCs for Hady and it felt like we were getting closer but then just stopped. ABCs are still being made and sold, I believe now through coralvue.
 
Only needs maybe a 2gb card. Whole repository is <1gb, and it's that big because a lot of the old RK code is still in there and hasn't got cleaned up yet. If you want to run some tests to provide the color data points, I'd appreciate the help. Just let me know your github username or email in an DM and I'll add you to the repo.
Also, misspoke, need an 8gb or larger SD card. Totally forgot about the OS.
 
I ordered 6 kits yesterday. Once I get those in I'll working on getting those knocked out.

API Calcium - This one works and coincides with my Hanna, but my kit is old.
Red Sea Pro - Mag, Alk and PO4
Salifert - PH and Mag
Fauna Marin - NO2/NO3. (Believe Tropic Marin is exactly the same. Need to verify with the Test Sequence.)
 
I was also testing the ABCs for Hady and it felt like we were getting closer but then just stopped. ABCs are still being made and sold, I believe now through coralvue.
I don't think Hady works with RK anymore. I seen his name popup somewhere and it didn't say he was affiliated with them anymore.
 
I don't think Hady works with RK anymore. I seen his name popup somewhere and it didn't say he was affiliated with them anymore.
Yeah I spoke to him recently. He helped me get my bot back up and running. He's def. not working for them anymore. He was the one who answered everyone on the socials, so him not being there is a huge loss for them and for us.
 
Yeah I spoke to him recently. He helped me get my bot back up and running. He's def. not working for them anymore. He was the one who answered everyone on the socials, so him not being there is a huge loss for them and for us.
He was the only one I ever saw interacting with the community. He came on this forum for a while, but the RK account was someone else. I tried to get them to understand that this is one of the, if not the, largest online communities for this hobby. There was a lot of market for them potentially if they would interact and listen to the consumer base. I tried to help them by soliciting and giving ideas for ways to improve upon their platform, but they were apprehensive and just failed to follow through on anything. So, I just. gave up trying. Wasn't worth the effort. Plus, they didn't seem to understand the concept of forums and felt more comfortable with Facebook. I still had some bitterness because BeanAnimal and I were both told the API was implemented and working. Wee got our Bots about the same time, only to never be given access and then after a few months, it was supposedly scrapped after that. I was told that they would need to rewrite it all. Despite it all, I think the Lab could jump in and take over the market with the right price point and some tweaks with their software and hardware. Really nothing is proprietary with the exception of the code and design itself. No reagent or consumable dependency, which doesn't bode well long term for a company, but can be countered by continuing to innovate the Bot and in other ways. Which they have not done at all, except for their. Beta Dashboard. It has a lot of potential, but not sure how many will pay to get past the paywall.
 
Have you also had Claude reverse-engineer the official RK mobile app and its API calls? I'm wondering if there are additional test definitions, calibration parameters, or reagent metadata exposed through the API that could help with reconstructing the backend and color interpretation logic.
 
Also, I had an idea to help with establishing the color interpretations. I added in a card with some buttons to execute single actions. They have to be submitted like mini tests because of how it all works. What I did was made a button to take an RGB reading which it already displays below the comm viewer (shows the serial comms between Pi and the Arduino) during tests. Also, a button to empty Test chamber and another to fill & empty.

Since I can't afford to buy kits for every test in the Bot. I will use any color cards I have from old tests or any high-quality versions I can find online. I'll use them along with some food coloring to make a matching color references. Then take multiple RGB samples with bot. That way I can take our perception of the color matches then get a RGB value how the bot sees it. I might need to tweak any downloaded cards to ensure the RGB channels are as close as possible. I have already found some bad images. Luckily, that isn't hard, just time consuming, as this whole process will be. I will also have to print them out to see the colors accurately since monitors will skew the colors.

Going to start with a couple that I have kits coming for. Once they arrive, I can test to see how well this method works. 🤞
 
Have you also had Claude reverse-engineer the official RK mobile app and its API calls? I'm wondering if there are additional test definitions, calibration parameters, or reagent metadata exposed through the API that could help with reconstructing the backend and color interpretation logic.
I have not. All the interpretations are done in the cloud. Once a test runs through all of its sequence it will send the color (for color match tests) or all colors (titration) to the cloud with and "all done" code. Then the clouds will interpret the color and match it or see what "drop" number it was and assign a value. You could run a test with bot connected normally and use that info from the test card to get a close value but still wouldn't give THE value. RKs interpretations can return values to blank and random colors sometimes so I'm not sure I want their process.

Once this done, it will have API for reading results, pushing tests, management, create/edit schedule etc.
 
I have not. All the interpretations are done in the cloud. Once a test runs through all of its sequence it will send the color (for color match tests) or all colors (titration) to the cloud with and "all done" code. Then the clouds will interpret the color and match it or see what "drop" number it was and assign a value. You could run a test with bot connected normally and use that info from the test card to get a close value but still wouldn't give THE value. RKs interpretations can return values to blank and random colors sometimes so I'm not sure I want their process.

Once this done, it will have API for reading results, pushing tests, management, create/edit schedule etc.

Couldn't you send synthetic color codes to the backend to have it interpret the result and doing so repeatedly with different shades and colors eventually build the database of it? I know their systems were sort of whacky too, so I agree, might not be best to mimic what they do have....

Another way would be to know the color ranges of each test (and I think this is how they did it) and then apply a reading based on where it lands between them. So for example, use known values/calibration fluids for those tests (cheaper, usually) and send those up to see what the result is - if you know the range you can interpolate the inbetween.
 
I also feel like if they were a little more focused and leaned on us they could have got this thing working perfect and blown everything else out of the water. Mine, while usually wrong was VERY consistent. If I was able to tweak the readings up or down via some sort of offset then it would have been amazing.
 
Couldn't you send synthetic color codes to the backend to have it interpret the result and doing so repeatedly with different shades and colors eventually build the database of it? I know their systems were sort of whacky too, so I agree, might not be best to mimic what they do have....

Another way would be to know the color ranges of each test (and I think this is how they did it) and then apply a reading based on where it lands between them. So for example, use known values/calibration fluids for those tests (cheaper, usually) and send those up to see what the result is - if you know the range you can interpolate the inbetween.
**Sorry this turned into a wall of text**

I could, but the issue is not so much getting it to determine and assign it to a setpoint color or find the endpoint. It's more of how does it look from the RGB sensor. Theoretically, it should be the same, but I don't want to risk an inconsistency. I will be doing something similar, but with rodi and food coloring.

To help combat errors (bot or reagent) I am going to add in a "Calibration" for each reagent. (myself, @BeanAnimal and a couple others asked for from RK)

API Calcium.png


So if you count and see it is saying drop 25, but you think is actually drop 27 that is the end point and the bot is constantly missing the mark you will be able to +2 and it will automatically make the correction for you going forward. This will also work for a reagent issues, so if the bot is hitting the right color, but manual tests are saying it is off, then you can make the adjustment too.

Nitrate.png

Tonight was the first attempt with a color match, and it was a off because raw colors and brightness. So, an adjustment was made to match hue instead of raw color and ignore brightness. Will need more test to verify it works better. The API Cal which is a titration test uses the RGB values to determine when certain channels hit certain points. Current API Cal calibration is for the blue channel to pass the red by more than 5 points. Before the reagent got old and stale, I was within 1 or maybe 2 points of my Hanna tester on multiple tests.

What I'm going to attempt for every color card I have, high-quality images I can find on the internet, or any people can scan and provide I will use food dye to make color samples that match the colors for values or end points. Have Claude take the cards to create interpretations and bounce them off the dyes to see how RGB vs our perceived colors line up. If they do, then I might be able to use good color card scans to fill up the interpreter. In theory this should at least get it pretty close, as long as my colors match the cards colors.

I have been able to decipher almost the whole test sequence now. So I can see as to what each command in the full test sequence does and what the modifiers control. Since the source for the Arduino isn't out there, it could potentially lead to streamlining tests, creating more, etc. API Nitrate does waste 0.2ml of reagent EVERY test. it pulls 0.3 from A and 0.5 from B, drops 0.3 in the test chamber of both, then flushes 0.2ml down the RO chamber during the rinse. Not sure if there was a reason, but I'm not sure what it would be.

For example,
#,50,5 = a 5.0 s wait, so #,50 counts in seconds.
#,4,X = rinse of the large syringe (X=1 for dosing syringe, X=2 for large syringe)
#,9,5000 = draw 5ml(5000 value) in large syringe
#,38, 300 = draw 0.3ml (300 value) in dosing syringe.
I used this and made small "tests" as single commands just fail to execute.

Comm Panel.png


From this page I can add a sample, get multiple RGB reads to ensure consistency. Then drain and rinse the test chamber a few times, add new color and repeat. In the above picture I had API Cal running again so part of the traffic was captured when I took the picture. It shows all the messages and will take any colors and put them on the bar below it. Can mouse over to see RGB and what "drop" number it is. So, you can follow all the serial traffic between the Pi (yellow) and Arduino (green) in real time. Used this a lot during the beginning development stages when trying to get the two to talk after cutting the cloud out.


What I made for people who want to help but can't help with the coding side is once a test is run there is a label icon.
API Cal Label Test.png
API Nitrate Upload.png

That has cards that look like this. The person can submit tests and label what they see. So with the API Calcium I select the transition color as I would call see it. They can add manual results and a note for any import info. This could give me multiple data points to help establish accuracy.

The Nitrate card shows the color the bot got (old API reagent ignore the results), then you pick which you feel is closest representation. For color match cards, the manual test results will be vital to helping ensure the bot will interpret the colors correctly. For this the colors follow a "path" from yellow to red. Some transition tests like Alk don't, like when it transitions from dark green to light blue.


I have some test kits coming. Once I get them working consistently, I am going to clean up the file structure, and then open Repo up for people to hopefully test and submit more data points.
 

DO YOU NAME THE ANIMALS IN YOUR REEF?

  • Every fish has a name

    Votes: 11 32.4%
  • Only the favorites or rascals get names

    Votes: 7 20.6%
  • My family names them

    Votes: 3 8.8%
  • They have nicknames, but I can’t promise they stick

    Votes: 3 8.8%
  • I use their species names, not personal names

    Votes: 4 11.8%
  • I tried, but I can’t keep track of the names

    Votes: 0 0.0%
  • Nothing in my reef has a name

    Votes: 4 11.8%
  • Other (Post in the comments)

    Votes: 2 5.9%
Back
Top
Home
Post thread…
Market
What's new