-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding support for iSpindel #5
Comments
Hi Sam, These two can be done easily and quickly.
I would suggest to use TCP:80, the web interface. iSpindle can already post to an URL. We just need to create a format. It can be done in minutes, literally.
This will take longer because we need:
I am not good at UI design. Should you have any idea, please shed some light. |
Hi @vitotai
I've implemented a bunch of protocols already. Sure I can write against every port and URI you wanna have. We can start with the HTTP Post to get it flying, but eventually I am in favor of using a plain TCP socket because of runtime costs. Plainly the on-time drops without the HTTP overhead which by the end of the day results in a quite dramatic battery lifetime improvement.
Currently I'm still working on a clean implementation of the conversion to gravity in firmware, this would extend the json definition. So our plan could be like this:
Your comments! How do you want to split the work up? |
If overhead of HTTP is concerned, maybe UDP would be better than TCP. By using broadcast UDP, no setup will be necessary of iSpidel. By using a make-up and predefined HTTP header instead of using HTTP client libary, I think it should take less overhead. But, let's start with HTTP for easy and simple debugging. I have a few questions:
This is easy, but "using them" is more complicated. What are we going to use them?
It's easy if we just want to display it. I don't think it's a good idea to use the senor as an "input" to temperature management.
Easy or not. A new UI? What to do if it happens?
The code and and the structure is already there. Just adding some more lines of code, it will be done.
This will be a complicated one. Should we start from User cases? |
Sorry for late answer, I was brewing and setting up the iRelay to demonstrate like this: http://hobbybrauer.de/forum/viewtopic.php?p=195277#p195277
Yes, I'm workin on it, ETA not too far.
Not necessarily, but to display and forward to Ubidots
Just referring to the backend to connect from the iSpindel.
That's the critical important point we have to agree on. Thats why I set up and please take a look at the very live running fermentation control of an iSpindel sending the temp to the iRelay which controls based on it. It is outside so I'm heating instead of cooling, but this doesnt matter.
Lesson I learned:
BTW. this is altogether 2 weeks of runtime, now the 4. day of real brew.
Fully agree, this is elegant. We might think of optional substitue Nx with gravity, then your logic could stay unchanged. But this is thoughts for future ideas, I dont think this is critical for now. |
How often does iSpindle report temperature? The core of BrewPiLess is BrewPi, which runs the temperature control algorithm. I don't think the temperature reported form iSpindle serves a good source for BrewPi's algorithm which requires more frequent updating of temperature readings, like very few seconds. It seems to me that you are asking for a new way of temperature control based on the iSpindle sensor. I see that you have a good temperature control program. Then, people have a choice other than BrewPi(Less) if they want. IMO, the temperature control algorithm of BrewPi is the most valuable part of BrewPiLess. Removing that part makes BrewPiLess Useless. |
The interval is configurable, but of course not every second. Nevertheless this is not needed at all for this kind of super slow PID of controlling required here. Did you analyze the demonstration I created for you? As you see No I dont think it makes it useless at all. It just means using a different source of truth, a pretty trivial impact. |
How about the battery life for this setting? That seems to doable, but I think the PID parameters should be tuned for that. Considering the situation of falling back to connected sensor, some options for better control, and hacking of BrewPi algorithm ( I just traced the code I need to change.), it needs more time than gravity-based temperature schedule. I would put it on the list after gravity based schedule. BTW, I already created a "preview" branch which logs gravity and "auxiliary" temperature. The only thing missing is the input of iSpindle. Should we finalize the format of reporting format? |
With currently insane interval of 15s I have a runtime of about 14days. I'm convinced we can go up to 1min or more without a doubt, the battery life scales pretty exactly reziprok with the interval freq. Some testing to be done.
I'm okay to take care of it.
I'm focusing hard to provide the gravity calculation from firmware in recent time. Yes we can finalize the format:
Important point, regarding to the proxy functionality, the BPless has to open an AP where the iSpindel can connect. Is that available already? |
I am using "/gravity" as URI. One problem here is that users have to figure out the IP of BrewPiLess. BrewPiLess does support mDNS, but involving mDNS might increase power consumption of iSpindle. (Maybe we should consider broadcast UDP seriously.) The unit of temperature is always Celsius, right? BrewPiLess can be configured to update to IOT services. I already added a few fields to the report.
Please check the detail here: |
I solved it this way that your controller opens an AP Okay so you want to introduce a new protocol. |
Using softAP seems to be a very good idea. Let me test how it works. Another question: should we use some kind of low pass filter on the gravity reading? I think the reading might be affected by unexpected movement of fermenters. It's OK if the data is displayed and read by human. It might be an issue if the gravity reading is used to decide the fermentation temperature setting. |
Good point, makes sense. I think you could really average over an hour or even more, from the practical point of view. |
Specific gravity, like 1.012. |
Is it possible for you to give me some gravity data? I would like to check the effectivity of the filter. |
A problem of moving average is memory usage. We need to decide the value of "b". How do you think? I almost finish the gravity based schedule. Do you have iSpindel code ready for me to test? |
The data from the iSpindel is very stable and almost no noise, I wonder if a filtering is needed at all. Probably a filtering over an hour would be sufficient and a running average could be sufficient and takes no memory:
Will have a sample code in a short time. |
That's what I am thinking. I've finished the gravity based schedule and now I am conducting stability test. My ESP8266 is not stable in STA_AP mode. I am not sure what went wrong and have decided to upgrade ESP8266/Arduino environment and ESPAsyncWebServer libraries. I am testing it under STATION mode only now for cross verification. (BTW, I found that closing HTTP connection without calling "end()" of HttpClient can crash ESPAsyncWebServer quickly.) |
end() is not always sufficient since it leaves the TCP connection orphaned. There are some MR regarding this open, I tested it and it helps. Indeed I can confirm that sometimes it crashes still. Thats where I bother currently with. It must be possible since the meshing works the same way. The temperature control over the input from the iSpindel is not optional for me, once you are running the setup you will understand why. But the interval is adjustable of course. It has to be evaluated where the sweet spot is. |
What is MR? A delay of 100ms before turning off WiFi works for me. To reduce the memory usage and MIPS requirement to process the logs, a simple binary log format is used. Sparsely changed data is recorded in a different way from that of continuously changing data. If the data is logged every minute, it should be treated as continuously changing data. I have to figure out a way of balance among simplicity, efficiency, and functionality. |
Struggling on AP+Station mode. It works fine if SoftAP is not created and the ESP8266 is in station only mode. Do you have any idea? |
Hi Guys, Great to see the collaboration between the two projects! It would be ideal for me if both devices could continue to join the same Wifi network in station mode as well as having the iSpindel post data updates to BrewPiLess. From my point of view the solution would be compromised if BrewPiLess had to be left isolated in AP mode. This would stop NTP sync, external data source integration (thingspeak etc) and remote access, these are all desirable capabilities to me. I don't think it's a big deal for an end user to figure out what the IP address of the BrewPiLess module is and put that into the iSpindel config. However a solution which supported both options would be ideal i.e both AP mode and station mode. |
|
So I can operate BrewPiLess in station mode and use NTP, run beer profile + get browser access via my local Wifi and also get iSpindel to connect to the BrewPiLess IP also via the same home Wifi network ? Or does iSPindel connect to a Wifi access point created by BrewPiLess ? From the comments above I thought you were having problems with stability operating in this mode.` |
Yes. I googled and found that might be an issue of my router. |
Hi Guys, Any update on the interface between iSpindel and BrewPiLess ? Specifically on how the gravity can be calculated from the tilt angle output by iSpindel ? Or is the intention for iSpindel to perform the gravity calculation and output it in Plato and/or degrees in it's JSON payload ? |
I just finish the calibration and plan to give it a try. |
Great! Are you calculating the specific gravity in degrees too (I don't use Plato). |
I don't use plato, neither. |
I´m trying to connect my ispindel (v5.12) to bpl (v.2) but can´t get it to work.. I´ve setup the BPL with softAP and the ispindel seems to connect, but i can´t get any data reading.. Last service type i tried was TCP with hostname brewpiless and port 80. Could you please give the steps to make it work? |
You need a http based service type, can't remember which one off the top of my head. Tried the CraftBeerPi or Univeral HTTP types ? Basically you need one where can can supply the server IP, port and URL (which needs to be /gravity ). |
Dear @vitotai, @universam1, Big fan of both of your work. Great that you are working together on this one... |
Excellent so far with Brewpiless and the iSpindle, however I've been trying for a few days to pair them together with no success. It seems that iSpindel connects to BrewPIless however the iSpindel status and SG are not shown in the BrewPiLess webpage. -IDE 1.8.2 FW 5.1.2 parsed json a: 822 12514 10100 absTilt: 50.95 T: 29.90 V: 4.07 owT: 30.06 Gravity: 4.21 calling DTHTTP {"name":"iSpindel000","ID":"16729250","angle":50.946877,"temperature":30.0625,"battery":4.065,"gravity":4.21135} I also tried to connect to BrewPiLess as AP most of the time seems to connect but not always, but the SG does not show up un the BrewPiLess webpage: FW 5.1.2 parsed json a: 3724 15162 4028 absTilt: 71.84 T: 32.37 V: 4.06 owT: 31.50 Gravity: 20.88 calling DTHTTP {"name":"iSpindel000","ID":"16729250","angle":71.842896,"temperature":31.5,"battery":4.06,"gravity":20.877611} |
You might try a IP sniffer, like wireshark. BTW, |
Vito, can you summarise the changes in the latest update ? |
nice job done @vitotai ! With the new Firmware since 5.x the iSpindel calculates gravity by itself, so you can drop that conversion from your firmware. Greetings! |
hi universam1, You have done a great job. The using of tinyexpr is a brilliant idea. Regards |
allthepies, check here: http://vito.tw/?p=720 |
Thanks Vito. I'm running it on my test rig, will see how it goes before upgrading the "prod" BPL ;) |
Hi Vito. It's working now and I am not sure what was the issue. I was using a laptop with debian, which crashed. Reinstalled everything from scratch on both iSpindel and BrewPiLess uising a windows machine and it's all good now. I like your new updates. Brewing party tomorrow and I can't wait to put these toys to work. You have a happy 4-th! |
Hi zandoga, |
@vitotai From my iSpindel firmware I made the dramatic discovery that only the latest git version of ESP8266/Arduino framework runs reliable. Even worse if you did not upgrade it lately. The SDK moved from 1.5.3 (terrible) to 1.5.4 (better and now to 2.x |
@universam1 and @vitotai both a fantastic job working together. This platform is pretty amazing! I had a similar problem as @zandoga but uploading the iSpindle Platform IO branch plus, adding the delay(50); line in iSpindle.ino fixed it for me. @universam1 Are you planning to add the extra line (delay(50); as per readme) in your code as well? I didn't have that in there initially and found the BrewPiLess very unstable. |
Thanks @pronkster for bringing up attention, the workaround is now permanently added to the iSpindel firmware with 5.2.1 |
@vitotai I find the gravity calculation calibrationSG.htm very helpfull, may I use it please in my repo as well? |
@universam1 |
So the workaround to fix iSpindel to work under brewpiless is to install newest Arduino IDE and start from start again? |
@universam1 I gave up on Arduino IDE once I tried PlatformIO with brewpiless and other applications, however I can not run iSpindel with PlatformIO. I get the following error: |
Darn! It worked before but now after I updated both BrewPiLess & iSpindel it seems that they do not communicate anymore. FW 5.2.3 parsed json a: 648 10138 12848 absTilt: 38.30 T: 31.40 V: 4.24 owT: 30.69 Gravity: 6.83 calling DTHTTP {"name":"iSpindel00","ID":"16729250","angle":38.30349,"temperature":30.6875,"battery":4.244004,"gravity":6.826229} |
I could not install Install Espressif 8266 (Stage) development platform so I uninstalled PlatformIO with VisCode and reinstalled with Atom. This time it worked, I was able to update iSpindel and it it able to upload measurements to BrewPiLess. Worker run! Spl 2: 54.88 |
The issue @zandoga described above is exactly the same issue I have @universam1 . I had it working but the latest fix broke the communication (see post of 5 July above). I used the latest bin file and I can see through the serial monitor that the information is being send but not picked up by BrewPiLess... I can also ping the iSpindle when it is awake so network connectivity is working. I will try the PlatformIO trick and report back.. |
![weird](https://user-images.githubusercontent.com/29188252/30106632-166e7808-92ca-11e7-88b9-66a848842671.JPG)
@pronkster and @universam1 BrewPiLess stop showing the gravity. It was
working and it just stopped. I reinstalled again for both, using Platform
IO and I tried all the combinations of the last two releasses, no luck. I
see in the serial monitor that they connect but no confirmation comes back
from BrewPiLess. iSpindel uploads just fine to Ubidots. After they stopped
communicating I restarted BrewPiLess and the time travel shown in the
attachment took place. I'm out of ideas on what else I can try... I'm just
going to use them separately for now and try again with a new release.
…On Sep 6, 2017 12:49 AM, "pronkster" ***@***.***> wrote:
The issue @zandoga <https://github.com/zandoga> described above is
exactly the same issue I have @universam1 <https://github.com/universam1>
. I had it working but the latest fix broke the communication (see post of
5 July above). I used the latest bin file and I can see through the serial
monitor that the information is being send but not picked up by
BrewPiLess... I can also ping the iSpindle when it is awake so network
connectivity is working. I will try the PlatformIO trick and report back..
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Ab1gnFUjeT97BG1x7Y7zsmb0Z2D7mJqQks5sfiRRgaJpZM4MJskp>
.
|
@zandoga |
@vitotai |
@zandoga |
@vitotai |
good I have installed brewpiless in wemos but what are the steps to start an ispindel in said brewpiless? |
It's all in the docs 😄 Basically just connect your ispindel to the BrewPiLess AP. https://github.com/vitotai/BrewPiLess/blob/master/doc/iSpindelSupport.md |
I'm the owner of the project https://github.com/universam1/iSpindel that is a electronic Hydrometer which measures the fermentation of the wort. I'm working on creating a fermentation temperature controller called iRelay based on that development that makes use of the data coming from the iSpindel that is floating inside which is in particular
I realize that you've created already a very nice project and I wonder if you would like to collaborate in this regard instead of creating something new. I've received already some requests for this universam1/iSpindel#7 (comment)
That would include
The above functionality is already coded by me.
Let me know if you are interested.
Sam
The text was updated successfully, but these errors were encountered: