Round 3 - Capn Style - Automated

We're heading to the same destination, just different approaches I guess. I'll be eager to look at your code for the water sensors to familiarize myself with the process. Wait, are you using Rpi for your controller or Arduino?

I have both, looking at the newer versions of each. Rpi 3b+ has some compelling hardware features over the mega or uno's and with more default gpio.

Edit - What are you using for your network?

Wireless where possible. Is that what you're asking or did I miss something? With the amount of sensor data I could get by with BLE, but the camera(s) might need the higher bandwidth wifi.
 
To my knowledge, Rpi uses 3.3v logic which has less hardware available for it, or the hardware is more difficult to find. Like relays, to my knowledge usually requires 5V to function. That was the tipping point for me anyways. When I asked about networking, I meant will you be running your own server on the Rpi, or are you using a service like Blynk or something else?
 
To my knowledge, Rpi uses 3.3v logic which has less hardware available for it, or the hardware is more difficult to find. Like relays, to my knowledge usually requires 5V to function. That was the tipping point for me anyways.

The SparkFun Logic Level Converter - Bi-Directional addresses the 3.3v to 5v back and forth nicely enough, but I am still doing my reading. As far as sensors and hardware, the items I am wanting to utilize are pretty set and are (or can be easily) compatible with either platform.

When I asked about networking, I meant will you be running your own server on the Rpi, or are you using a service like Blynk or something else?

I've looked in to Blynk, I do like that it is easy to use and good for rapid prototyping. Just not sure if I want to be tied to their platform with handcuffs yet.
 
I like Blynk b/c it's free. There is a fee if u want to purchase a lot of functionality, but it's a one time fee of $10. Using their server is completely free tho.
 
Well the mega, shield, breadboard, and 3 x temp sensors have arrived.

Played a bit today with getting libraries installed.

I'm on a week road trip so hopefully I can buckle down when I get back.

Nice! Waiting on my latest purchase myself. Which sensors did you end up choosing?
 
I got code for DHT11s and DHT22s so ya can hit the ground running.
 
I took a sample branch today on the first day of her 9th week. I am so proud of myself for holding off on sampling until this far in. When I looked at the trics 2 days ago, I estimate that I see 80% milky/cloudy and 20% clear. I didn't see any amber trics, but I know they're out there somewhere. I was really hoping she would swell up more in these late days, but it doesn't seem like she's packing on any more weight. If I had to guess, I estimate that I see about 10-12 ounces dried, but I'm hoping for 16, but I just don't see that happening with this girl this time.

PPM has climbed to the 950 range (@0.5conv), so I added a half gallon of RO to bring that down some. PH is sitting hard on 6.0. The strain review suggests that she's an 8-9 week finisher, but I'm prepared to give her 10 weeks including a week long flush and hopefully she'll make some gains.
 
Stopped over to see my Bubblelicious (27 days in 12/12) and feed everyone that's awake some Recharge. She is looking better and better every day. So tall and as wide as the room will let her be. With all of that branching, I was surprised to find little air flow resistance but this will probably change once the buds fatten up some more. I crawled around the tote and took off all the minimal side branching down low and larger fans I didn't remove last session. I prepped her with a generous serving of Recharge prior. These pics were taken just before the prune session. I also left 2 small branches that won't do much to be my samples when she's near. Also, funds are getting too thin and my grinder only has a few bowls left so I snatched a sample from the Bubble Gum this morning. Should be better than a gram or two when dried. I'm a very mild smoker. Two tokes if I'm feeling brave or am already thoroughly stoned, then one every hour or so.

I'm going to continue using mechanical timers till I figure out a better solution. My Ethermega functions, but every now and again it crashes. When changing Res A the other day, it shit the bed in the middle of pumping RO in. Luckily I glanced and saw the water very near the top which is almost twice what I dialed in for. Quick unplug the pump, reset the MCU and everything is right as rain. I had to drain off some RO, but then was able to nute up with the quasi accurate dosing pumps. The struggle is real, but will continue, just gotta hunker down and suck it up till funds are more plentiful.

IMG_20170611_203114981_HDR.jpg
IMG_20170611_203100400_HDR.jpg
IMG_20170611_203221270_HDR.jpg
IMG_20170611_203202545_HDR.jpg
 
Let me preface that when I was building, in the process of routing my pins through the DB9 cables, I'm near certain that I was sending 5V at a GND of the relay module and vice-a-versa and I'm convinced I damaged something on the MCU. When it crashes, it remains powered up, but it gets overloaded or something and locks the pins in their current position at the time of the crash as happened when filling RO. I called for 10 gallons which to the MCU was 10*330000 (33secs per gal from my pump). While giving me that dose, the MCU locked up and the relay never decoupled which almost overflowed the site res.

Edit - What causes them to run out of memory? I also partially suspect this b/c I've been in a situation where I can force a crash by trying to execute a few different commands at the same time like pumping multiple nutrient, or a nute and RO at the same time.
 
Edit - What causes them to run out of memory? I also partially suspect this b/c I've been in a situation where I can force a crash by trying to execute a few different commands at the same time like pumping multiple nutrient, or a nute and RO at the same time.

Had to read back a bit to find your github link. So the first thing to change is in your void setup():

void setup()
{
Serial.begin(9600);
Blynk.begin(auth);
while (Blynk.connect() == false) {}
timer.setInterval(200L, dosingPumps); //5 readings per second to achieve 1/4ml accuracy
for (int p = 0; p <= 7; p++)
{
pinMode(pumpPin[p], OUTPUT);
}
Blynk.virtualWrite(V0, 0);
Blynk.virtualWrite(V1, 0);
Blynk.virtualWrite(V2, 0);
Blynk.virtualWrite(V3, 0);
}

Change that line to:
Blynk.config(auth);

Changing this will forego the initial connection attempt until the Blynk.connect() on the next line.

And then add this to the top, directly above (as the first #define statement) "#define BLYNK_PRINT Serial"
#define BLYNK_DEBUG

Enabling debug will absolutely cause some slow-down, but you should be able to get an idea of the last thing it was doing when it locked up. I suspect you are running out of heap memory. Open Serial Monitor and you'll see the debug prints.

You should also be using BlynkTimer instead of SimpleTimer, simply rename the variable declaration and remove the "#include <SimpleTimer.h>" completely.
 
Oh shit, that's only a sketch for the dosing pumps, I have a master sketch that has that and everything else I have running. I'll add that to my GitHub when I get home and share the link. For debugging, I converted all Serial.print calls into terminal.print, but of course they only print when the MCU isn't locked up.
 
Looking at that, the same change for SimpleTimer should be made before doing anything else. I would still recommend doing the other two, none of the rest of your code is raising any "Hey, there it is!" concerns with me.
 
What do you mean about simple.timer? Your first suggestions didn't mention ST

Edit - Scratch that. For some reason, I wasn't able to see the rest of your post in my 420 phone app. I see it now on PC.
 
Also, while I'm chewing on that, regarding
#define BLYNK_PRINT Serial
, I should clarify that my grow is at a different location, and the computer there has Windows 10 and for the life of me, I can't get it to connect to my Ethermega, despite installing the EM driver. That said, it's impractical for me to always bring my laptop when I go there. Knowing this, I opted to send all my Serial prints to Blynk with terminal.print. Would this satisfy BLYNK_DEBUG and BLYNK_PRINT Serial functions?
 
Also, while I'm chewing on that, regarding , I should clarify that my grow is at a different location, and the computer there has Windows 10 and for the life of me, I can't get it to connect to my Ethermega, despite installing the EM driver.

Can you at least get the Ethermega to obtain an IP address from the same router your Windows 10 Box is connected to?

That said, it's impractical for me to always bring my laptop when I go there. Knowing this, I opted to send all my Serial prints to Blynk with terminal.print. Would this satisfy BLYNK_DEBUG and BLYNK_PRINT Serial functions?

Not many options if your Ethernet/wifi won't connect. An alternative could be logging to file a on the local SD card like they do here:

Arduino - Datalogger
 
Back
Top Bottom