Hi all...long time lurker, first time contributor here. First, I want to thank Mats for all of his hard work on this project. I appreciate it more than I can ever repay you for your contributions.
For some time I've been working on a wireless logger for the STC-1000+, based on the communications firmware Mats wrote. I've been through a number of iterations on this going back almost a year now, and have something I'd finally like to share. It's based on the Adafruit Huzzah ESP-8266 package, which I find quite stable and love the 4M flash available. It also is cheap (about $10).
I've set up a Git repository with the code (written in / for the Arduino IDE) and additional details. The project also supports an OLED display to keep track of what's happening in real time. It gathers information from the running STC (setpoint, status of heating / cooling relays, current probe temp, run-mode (profile or thermostat), step (for profile), and duration hours. This data is streamed to an on-line datastream at Sparkfun (data.sparfun.com), or you can change this to a local Phant server if you prefer.
The repository includes a (crude) Fritzing diagram to show how I connected the components. When I started this, I was a noob working with electronics, soldering, using the Arduino, Github, Fritzing, etc., so please be kind in your criticisms / feedback.
There are a number of things that need to be edited in the code before compiling it, such as specifying your SSID, password, network IP info, NTP settings, timezone offset, Sparfun datastream keys, etc. These are all flagged in the code and detailed in the README. I hope to continue to enhance this by adding a web configurator in the future to handle these settings rather than having to edit the code directly, but it is what it is for now.
Good luck and please let me know if you get a chance to try it out how it works for you.
Here's the Github link:
https://github.com/fowlerk/STC1000Logger.git
Very cool
I don't know if you have followed this thread, but I actually played around with the ESP myself. I used a framework called
Sming, which has Arduino support + a lot of other cool things. But I never got it working reliably. So, I kind of lost faith in it for a while.
Turns out though, that there was a bug in the JSON library that Sming uses (memory leak), that recently got fixed. Tried it out a few days ago, and it seems to work a lot better now, so I'm kind of in the mood to get started with it again.
I had a PoC going that starts an AP (WiFi access point) when not configured. Connect to it and configure your network (or simply use the AP if you want to). It can do all the COM stuff via simple REST interface AND you can FTP a HEX file and update the STC-1000+ firmware.
It needs some polishing, I'd like to get a modified version of the profile editor running, so you can simply edit your profile, upload and run it directly. Some logging (either to flash or cloud) would be cool as well. Waddaya think?
I don't mean to steal you thunder, on the contrary, that is a very cool project! Kudos! (Maybe I should have lead with that...)
But I don't have a lot of spare time on my hands, and if I can get others interested in contributing, that would make it a lot more likely to happen. I can share what I got right now, but I'd probably need to clean it up a bit first. So far it is mainly based on the Sming examples + the COM and picprog sketches. It is still very crude... But it shows potential. It would be cool to combine the cheap but reliable STC, with the cheap (but somewhat less reliable) WiFi capabilities of the ESP to make something really great.
Well here is some testing results from the new com.ino
I tested both reads and writes. Looks like the only things I can find wrong are a few of the variables need to be divided by 10, hy, tc & SA (not a very big deal at all!)
rn parameter had me confused based on the comments next to them in the code. I could not write 0-6, but I can write th or Pr0... So I guess this works as intended. All other parameters I have tried writing to work just like they should.
Reading St and dh would not work until I had used a profile for a moment, then even after being back in th mode, I could read these parameters. Make sense now.
It kinda would be nice to see more info than just Ok after a write, like echo back what the parameter and value written was, but on the other hand from a script confirmation, this is all that is needed.
Thanks for the quick fix.
Lee
Ok, I buckled down and broke out an STC that I could use for COM stuff and think I've fixed the remaining issue.
Reading/writing St and dh should be doable, even without first running a profile.
Yes, rn accepts "th", "Pr0"-"Pr5" (just as it shows them that way).
It can't really do more than write "Ok" as, all it knows is that the communication worked. You really need to read the same value again, if you want to verify that it really was written correctly.
So my thinking was this, please correct me if I'm miss understanding your com.ino It is always waiting for a request and simply carries out orders when it gets a new command, then goes back to waiting for the next command.
My concept is after waiting for 5 seconds, Arduino would query to STC for current SP, Temp, Cooling/Heating status (Maybe checking rn and if running a profile, report back the St and dh) These questions would be asked one at a time with 10+ms between them, compact the results into a single string (coma separated) and then print to serial. Something like "80.0,79.9,off,on,PR0,1,48" this would then take say 80-100ms to collect and print. Then go back to monitoring for the next command for another 5 seconds.
Next step after getting this to work is a GUI or virtual control panel where I can see my STC1000+, being updated every 5 seconds, and maybe make the buttons function just like I was really at the STC. Depending on what you select, the equivalent command would be sent to the STC and GUI would update. I would build my 5 STCs into a single interface and I could manipulate as desired from anywhere I can VPN and VNC to my RPi 2. (Want to go real crazy, make an iPhone/andriod app and interface / trend results from anywhere)
I come from an instrumentation/ advanced controls and analyzer background, 18yrs in pulp and paper and now 3yrs in oil. I have been programming Emerson DeltaV DCS for 8 years now, Metso DNA before that. I'm used to multi million dollar control systems and multi billion dollar plants. I now do controls consulting and configuration for a big oil company. I'm dreaming of having the same control over my fermentation at home as I do every day over massive advanced processes!
Cheers
Ok, first off. It wouldn't be that hard to change the loop function in the com.ino sketch to every 5 seconds fart out the stuff you want over serial. That would be a very good beginning exercise.
Next, if you modify the sketch, I don't see a problem in communicating with 5 STC's with one Arduino. You really only need one data pin per STC. But you'd need to write some code to address them. You could add an arduino per STC as well. If you're gonna write a GUI, then you can't have it blurt out stuff every 5 secs, so you'd need to go back and just have the GUI poll the stuff it needs over serial. But I guess that is a given.
From experience, I know serial can be a bit tricky, so you'd need some decent error handling. And for the GUI, I'd suggest you use absolute addressing (i.e. "r 125" and "w125 0" for example) instead of the mnemonics. That is why the absolute addressing is there, to make it easier to interface with a computer. The mnemonics is easier on a human
Good luck!