Skip to content
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

Open
universam1 opened this issue Feb 23, 2017 · 77 comments
Open

adding support for iSpindel #5

universam1 opened this issue Feb 23, 2017 · 77 comments

Comments

@universam1
Copy link

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

  • temperature inside the fluid which is way higher accurate than measured outside with a sensor
  • making use of the SG / Plato to adjust the fermentation desired temperature. Therefore you can automatically rise the temp to cope with Diacetyl for instance.

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

  • receiving the incoming json data from the iSpindel as a new temp sensor on a specific TCP port, decoding it and displaying.
  • Forwarding this data to an IoT service, kind of proxy.
  • further replacing the time based planning with event based on the SG measured. For instance on 80% of fermentation go to temp X.

The above functionality is already coded by me.

Let me know if you are interested.
Sam

@vitotai
Copy link
Owner

vitotai commented Feb 23, 2017

Hi Sam,
I am happy to do that. In fact, I might do it even without your request.

These two can be done easily and quickly.

  • receiving the incoming json data from the iSpindel as a new temp sensor on a specific TCP port, decoding it and displaying.
  • Forwarding this data to an IoT service, kind of proxy.

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.

  • further replacing the time based planning with event based on the SG measured. For instance on 80% of fermentation go to temp X.

This will take longer because we need:

  • a new interface that can be used to specify the condition. The condition may be time, gravity, or combined of both.
  • considering the case that gravity report missed for a certain time.

I am not good at UI design. Should you have any idea, please shed some light.

@universam1
Copy link
Author

Hi @vitotai
This sounds really nice! Happy to work together and take your really nice developed project to further usecase! There are many requests for the iRelay functionality pending and I'm fine with shifting to your project!

I would suggest to use TCP:80, the web interface. iSpindle can already post to an URL. We just need to create a format.

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.
But okay lets start with HTTP Post. The request will look like this json string:

{"name": "iSpindel01", "id": "XXXXX-XXXXXX", "temperature": 20.5, "angle": 89.5, "battery": 3.87}

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:

  1. create a Post URI where to send the json data, parse the request
  2. add the iSpindel data as new temperature sensor input
  3. use the inbuilt DS18b20 as sanity checks if the iSpindel is not accessible (limit the diff to x°K)
  4. work as a relay / proxy - forward the data to Ubidots or another storage
  5. extend the UI to take gravity as optional condition

Your comments!

How do you want to split the work up?

@vitotai
Copy link
Owner

vitotai commented Feb 24, 2017

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:

  1. Is it possible to calculate gravity in iSpindel? The value of angel is not meaningful to user. I would bet that users prefer to know the gravity instead of angel. If the gravity is not calculated by iSpindel for power saving, it must be calculated somewhere else and the parameters to calculate should be provided.
  2. What is the "id": "XXXXX-XXXXXX" for? Are we going to support multiple iSpindle?

1.create a Post URI where to send the json data, parse the request

This is easy, but "using them" is more complicated. What are we going to use them?

2.add the iSpindel data as new temperature sensor input

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.

3.use the inbuilt DS18b20 as sanity checks if the iSpindel is not accessible (limit the diff to x°K)

Easy or not. A new UI? What to do if it happens?

4.work as a relay / proxy - forward the data to Ubidots or another storage

The code and and the structure is already there. Just adding some more lines of code, it will be done.

5.extend the UI to take gravity as optional condition

This will be a complicated one. Should we start from User cases?
Currently, the way to specify the temperature schedule in "Beer Profile" mode is by specifiying a list of "N'th day at temperature T". Given a time n, the temperature can be derived by finding N1 and N2 where N1 <= n < N2 and the desired temperature will be T1+(T2-T1)/(N2-N1)x(n-N1). IMO, it's a simple and elegant way. The best part of it is that user can specify the speed of temperature change while the program handles it in the same way. However, I don't think of a way to "extend" it.

@universam1
Copy link
Author

universam1 commented Mar 1, 2017

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

Is it possible to calculate gravity in iSpindel?

Yes, I'm workin on it, ETA not too far.

What is the "id": "XXXXX-XXXXXX" for? Are we going to support multiple iSpindle?

Not necessarily, but to display and forward to Ubidots

1.create a Post URI where to send the json data, parse the request
This is easy, but "using them" is more complicated. What are we going to use them?

Just referring to the backend to connect from the iSpindel.

2.add the iSpindel data as new temperature sensor input
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.

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.
https://app.ubidots.com/ubi/public/getdashboard/page/Q25QJuWDcPmc-Nh_lnMff_ed9V8

  • blue is the ambient temperature,
  • red the wort messured by iSpindel and
  • orange the temp of the kettle from outside - you can see the influence from the heater here.

Lesson I learned:

  • Here is the point, the kettle outside temp is really far away from the real wort temperature, and here is the big benefit of the iSpindel. For instance the yeast creates heat and the iSpindel floats just in the very center of yeast activity. Perfect to control better off-flavors.
  • It is perfectly possible to control the temp based on the data sent from the iSpindel

BTW. this is altogether 2 weeks of runtime, now the 4. day of real brew.

3.use the inbuilt DS18b20 as sanity checks if the iSpindel is not accessible (limit the diff to x°K)
Easy or not. A new UI? What to do if it happens?

if (desiredT > sensorT && kettleT < desiredT + HEATTOLERANCE) { heat() }
Thats all I do for now and the result you can see

Given a time n, the temperature can be derived by finding N1 and N2 where N1 <= n < N2 and the desired temperature will be T1+(T2-T1)/(N2-N1)x(n-N1). IMO, it's a simple and elegant way.

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.

@vitotai
Copy link
Owner

vitotai commented Mar 2, 2017

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.

@universam1
Copy link
Author

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 Tau is at 10min, 600s. For a proper PID control you need Tau >= 10x Ta. This case we have Ta of 15s so we are at 40x, which is more than sufficient.

No I dont think it makes it useless at all. It just means using a different source of truth, a pretty trivial impact.

@vitotai
Copy link
Owner

vitotai commented Mar 2, 2017

How about the battery life for this setting?
I thought it reported every hour.

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?

@universam1
Copy link
Author

How about the battery life for this setting?

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.

it needs more time than gravity-based temperature schedule. I would put it on the list after gravity based schedule.

I'm okay to take care of it.

Should we finalize the format of reporting format?

I'm focusing hard to provide the gravity calculation from firmware in recent time. Yes we can finalize the format:

  • HTTP Post
  • URL: up to you
  • format: json:
    {"name": "iSpindel01", "id": "XXXXX-XXXXXX", "temperature": 20.5, "angle": 89.5, "gravityP": 13.6, "battery": 3.87}
  • port: 80

Important point, regarding to the proxy functionality, the BPless has to open an AP where the iSpindel can connect. Is that available already?

@vitotai
Copy link
Owner

vitotai commented Mar 7, 2017

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.

Specifier output
%b Beer temperature
%B Beer setting
%f fridge temperature
%F fridge setting
%r room temperature
%g gravity
%a auxiliary temperature
%v external device voltage
%u UNIX timestamp of last gravity update

Please check the detail here:
https://github.com/vitotai/BrewPiLess/tree/preview#remote-temperature-logging

@universam1
Copy link
Author

I solved it this way that your controller opens an AP WiFi.mode(WIFI_AP_STA); with a specific SSID pattern String ssid = String("iRelay-") + String(ESP.getChipId()); WiFi.softAP(ssid.c_str(), IRELAYPASS) and a commonly known pass, so it can be discovered by the iSpindel. It also serves the proxy forwarding / wifi boost range extension idea.

Okay so you want to introduce a new protocol.

@vitotai
Copy link
Owner

vitotai commented Mar 8, 2017

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.

@universam1
Copy link
Author

Good point, makes sense. I think you could really average over an hour or even more, from the practical point of view.
What unit for gravity are you expecting? I'm used to Plato.

@vitotai
Copy link
Owner

vitotai commented Mar 9, 2017

Specific gravity, like 1.012.
There are formula to convert between SG and plato. However, I don't know if it is valid to convert SG values smaller than 1. I learned that some mead can have FG smaller than 1.

@vitotai
Copy link
Owner

vitotai commented Mar 11, 2017

Is it possible for you to give me some gravity data? I would like to check the effectivity of the filter.

@vitotai
Copy link
Owner

vitotai commented Mar 13, 2017

A problem of moving average is memory usage.
Can we use single pole IIR low-pass filter? It is simple as
y[n]=y[n−1]+b(x[n]−y[n−1])

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?

@universam1
Copy link
Author

universam1 commented Mar 14, 2017

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:

float alpha = 0.1; // could be 1/(60 / Interval in minutes)
value = alpha * measurement + (1-alpha) * value;

Will have a sample code in a short time.

@vitotai
Copy link
Owner

vitotai commented Mar 14, 2017

That's what I am thinking.
Are you going to report every minute or make it a configurable option? From my point of view, one minute period is overkill if the temperature is not used in the control algorithm. If the report period can be changed, maybe I need to make the value "alpha" configurable.

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.)

@universam1
Copy link
Author

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.

@vitotai
Copy link
Owner

vitotai commented Mar 15, 2017

What is MR? A delay of 100ms before turning off WiFi works for me.
At this point, I am open to using TCP directly as you previously proposed if that simple TCP is more robust. BrewPiLess servers as a web server, so the web interface is already there to be used. One benefit of using web interface is no extra TCP connection necessary. BrewPiLess uses ESPAsyncWebServer/ESPAsyncTCP to enable concurrent multiple connections. The maximum number of connections ESPAsyncTCP supports is 5. Memory resource is precious for ESP8266, and I think 5 is reasonable.

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.

@vitotai
Copy link
Owner

vitotai commented Mar 16, 2017

Struggling on AP+Station mode.
The station lost connection and reconnects every 5 minutes.(logs from serial.)
The lost of connection disappears when a browser establishes a connection to it.
The connection from the browser might fail if it happens at the time ESP8266 reconnecting.

It works fine if SoftAP is not created and the ESP8266 is in station only mode.

Do you have any idea?

@allthepies
Copy link

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.
Thanks.

@vitotai
Copy link
Owner

vitotai commented Apr 15, 2017

  1. BrewPiLess can run STA+SoftAP mode. Under that mode, it connects to an AP and creates a wireless network at the same time. BrewPiLess works as usual, and no function is missed.

  2. My current design is creating an option to enable AP mode. If AP mode is enabled, it will be in STA + SoftAP mode. No mater iSpindel connects to the same AP as BrewPiLess or to BrewPiLess directly, the gravity update request can be processed.

  3. My current issues seems to be an issue of my router.

@allthepies
Copy link

allthepies commented Apr 15, 2017

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.`

@vitotai
Copy link
Owner

vitotai commented Apr 15, 2017

Yes. I googled and found that might be an issue of my router.
It's not a deal breaker. Everything works, but sometimes I just have to wait for a few seconds or retry for several times to connect to BrewPiLess. Once the connection is established, there is no issue at all.
Therefore, I decide to make it an option. People who have good routers might have luck to run without any issues.

@allthepies
Copy link

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 ?

@vitotai
Copy link
Owner

vitotai commented Apr 25, 2017

I just finish the calibration and plan to give it a try.
You can check the calibration document to find the coefficients. The plato is just calculated by
a0 + a1 * x + a2 * x^2
where x = tilt
I use a third order formula, and an additional coefficient is derived and an additional term a3 * x3 is added.
It's easy to add a parameter to the genericHTTP. However, I found that the TCP connection is not closed correctly, which results in inaccessibility of the web server of BrewPiLess. I added a a delay(50) before going to deep sleep.
One issue I have is that the gravity reading drifts a little bit after I pull the sled out when trying pull off the USB connection. Maybe a correction parameter is necessary.

@allthepies
Copy link

Great! Are you calculating the specific gravity in degrees too (I don't use Plato).

@vitotai
Copy link
Owner

vitotai commented Apr 27, 2017

I don't use plato, neither.
The conversion is easy by this formula:
sg=1 + (plato / (258.6 -((plato/258.2)*227.1)));

@h44r3k
Copy link

h44r3k commented May 2, 2017

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?

@allthepies
Copy link

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 ).

@lekrom
Copy link

lekrom commented Jun 8, 2017

Dear @vitotai, @universam1,

Big fan of both of your work. Great that you are working together on this one...
I have recently started homebwrewing (my first batch is fermenting now). I have built my own single vessel system using a brewmaniac / bmesp8266 controller (which works pretty sweet). I have also built an iSpindel. Fortunately it is winter here in South Africa, and the temperature is spot on for fermenting ales at the moment. This will not be the case come summertime. Therefore, I am planning to build a fermentation chamber using a Brewpiless next. One question, is there any plans to enable using the iSpindel temperature measurement as the "Beer temp" measurement for Brewpiless? Would this be practical? I assume you would likely need to set the iSpindel to report a bit more frequently which would impact battery life.

@zandoga
Copy link

zandoga commented Jul 2, 2017

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.
I appreciate your feedback. Thank you.

-IDE 1.8.2
-BrewPiLess v2.0
-iSpindel 5.1.2
-followed iSpindel Support instructions from BrewPiLess readme, including the addition of delay(50) in iSpindel.ino
-both are connected to the same router

FW 5.1.2
2.0.0(656edbf)
Worker run!
Boot-Mode: 5
mounting FS... mounted!
reading config file
opened config file

parsed json
offsets not available
parsed config:
{"Name":"iSpindel000","Token":"dRKBpgNNdKVK8mt1R49BUXMdNpW2Hm","Sleep":150,"Server":"192.168.1.100","API":3,"Port":80,"URL":"/gravity","Vfact":200,"SSID":"XXXXXXXX","PSK":"XXXXXXX","POLY":"0.01636441875tilt^2-1.2118026tilt+23.47368037","aX":0,"aY":0,"aZ":0}
woken from deepsleep, normal mode
Spl 0: 50.91
Spl 1: 50.72
Spl 2: 51.00
Spl 3: 51.02
Spl 4: 50.83
Spl 5: 50.93
Spl 6: 51.08

a: 822 12514 10100 absTilt: 50.95 T: 29.90 V: 4.07 owT: 30.06 Gravity: 4.21
After waiting 0.00 s, result 3
192.168.1.101

calling DTHTTP
genericHTTP: posting
POST /gravity HTTP/1.1
Host: 192.168.1.100
User-Agent: iSpindel000
Connection: close
Content-Type: application/json
Content-Length: 112

{"name":"iSpindel000","ID":"16729250","angle":50.946877,"temperature":30.0625,"battery":4.065,"gravity":4.21135}
Final-sleep: 150s; RT:4967

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
2.0.0(656edbf)
Worker run!
Boot-Mode: 5
mounting FS... mounted!
reading config file
opened config file

parsed json
offsets not available
parsed config:
{"Name":"iSpindel000","Token":"dRKBpgNNdKVK8mt1R49BUXMdNpW2Hm","Sleep":150,"Server":"192.168.4.1","API":3,"Port":80,"URL":"/gravity","Vfact":200,"SSID":"brewpiless","PSK":"brewpiless","POLY":"0.01636441875tilt^2-1.2118026tilt+23.47368037","aX":0,"aY":0,"aZ":0}
woken from deepsleep, normal mode
Spl 0: 72.24
Spl 1: 72.07
Spl 2: 71.96
Spl 3: 71.74
Spl 4: 71.61
Spl 5: 71.82
Spl 6: 71.37

a: 3724 15162 4028 absTilt: 71.84 T: 32.37 V: 4.06 owT: 31.50 Gravity: 20.88
After waiting 0.00 s, result 3
192.168.4.2

calling DTHTTP
genericHTTP: posting
POST /gravity HTTP/1.1
Host: 192.168.4.1
User-Agent: iSpindel000
Connection: close
Content-Type: application/json
Content-Length: 110

{"name":"iSpindel000","ID":"16729250","angle":71.842896,"temperature":31.5,"battery":4.06,"gravity":20.877611}
Final-sleep: 150s; RT:4881

capture_1

capture_2

capture_3

capture_4

@vitotai
Copy link
Owner

vitotai commented Jul 2, 2017

I tried your data by using "curl" command to simulate iSpindel.
The data was shown, but wrong.

iss
brewpil

@zandoga
Copy link

zandoga commented Jul 2, 2017

I run the curl and it seems that it's working fine, but not from the iSpindel. I'll keep digging...

capture_6

@vitotai
Copy link
Owner

vitotai commented Jul 3, 2017

You might try a IP sniffer, like wireshark.
Or, you might need to turn on debug message output by recompile BrewPiLess. the debug message output option is in espconyfig.h

BTW,
I just pushed updated code.

@allthepies
Copy link

Vito, can you summarise the changes in the latest update ?

@universam1
Copy link
Author

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!

@vitotai
Copy link
Owner

vitotai commented Jul 3, 2017

hi universam1,

You have done a great job. The using of tinyexpr is a brilliant idea.
There is an option to using gravity data from iSpindel, so it's ok to keep the code there.

Regards

@vitotai
Copy link
Owner

vitotai commented Jul 3, 2017

allthepies,

check here: http://vito.tw/?p=720
the detail is in the readme@Github.

@allthepies
Copy link

Thanks Vito.

I'm running it on my test rig, will see how it goes before upgrading the "prod" BPL ;)

@zandoga
Copy link

zandoga commented Jul 4, 2017

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!

@vitotai
Copy link
Owner

vitotai commented Jul 4, 2017

Hi zandoga,
Some reported that he couldn't make it work until he installed a new installation of Arduino IDE. It might has something to do with the libraries.
I am hopping to migrate to PlatformIO. Arduino IDE starts to make me sick.

@universam1
Copy link
Author

@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
Therefore I switched to PlatformIO for building and am using the "Staged" framework pinned down, now problem is solved and consistent results.
Just my 2c

@pronkster
Copy link

@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.

@universam1
Copy link
Author

Thanks @pronkster for bringing up attention, the workaround is now permanently added to the iSpindel firmware with 5.2.1
@vitotai do you like to mention that and / or update the Readme?

@universam1
Copy link
Author

@vitotai I find the gravity calculation calibrationSG.htm very helpfull, may I use it please in my repo as well?

@vitotai
Copy link
Owner

vitotai commented Jul 5, 2017

@universam1
I am glad if it helps. Go ahead, please.

@vstoms
Copy link

vstoms commented Aug 19, 2017

So the workaround to fix iSpindel to work under brewpiless is to install newest Arduino IDE and start from start again?

@zandoga
Copy link

zandoga commented Aug 21, 2017

@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:
PlatformManager: Installing espressif8266_stage
Error: Detected unknown package 'espressif8266_stage'

@zandoga
Copy link

zandoga commented Aug 21, 2017

Darn! It worked before but now after I updated both BrewPiLess & iSpindel it seems that they do not communicate anymore.
I think that I figured out the 8266_stage on PlatformIO, however BrewPiLess is not showing iSpindel data.
Can somebody please post the terminal info from iSpindel when is sending data? I would like to compare with what I see:

FW 5.2.3
2.0.0(656edbf)
Worker run!
Boot-Mode: 5
mounting FS... mounted!
reading config file
opened config file

parsed json
offsets not available
parsed config:
{"Name":"iSpindel00","Token":"","Sleep":60,"Server":"192.168.1.100","API":3,"Port":80,"URL":"/gravity","Vfact":191.8,"SSID":"XXXXXXX","PSK":"XXXXXXXX","POLY":"-0.00031tilt^2+0.557tilt-14.054","aX":0,"aY":0,
"aZ":0}
woken from deepsleep, normal mode
Spl 0: 38.26
Spl 1: 38.27
Spl 2: 38.33
Spl 3: 38.51
Spl 4: 38.41
Spl 5: 38.24
Spl 6: 38.31

a: 648 10138 12848 absTilt: 38.30 T: 31.40 V: 4.24 owT: 30.69 Gravity: 6.83
After waiting 0.00 s, result 3
192.168.1.101

calling DTHTTP
genericHTTP: posting
POST /gravity HTTP/1.1
Host: 192.168.1.100
User-Agent: iSpindel00
Connection: close
Content-Type: application/json
Content-Length: 114

{"name":"iSpindel00","ID":"16729250","angle":38.30349,"temperature":30.6875,"battery":4.244004,"gravity":6.826229}
Final-sleep: 60s; RT:5025

@zandoga
Copy link

zandoga commented Aug 23, 2017

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.
In case anybody needs it, here is the serial monitor on iSpindel:

Worker run!
Boot-Mode: 5
mounting FS... mounted!
reading config file
opened config file
 
parsed json
offsets not available
parsed config:
{"Name":"iSpindel00","Token":"","Sleep":60,"Server":"192.168.1.100","API":3,"Port":80,"URL":"/gravity","Vfact":191.8,"SSID":"XXXXXXX","PSK":"XXXXXXX","POLY":"-0.00031tilt^2+0.557tilt-14.054","aX"
:0,"aY":0,"aZ":0}
woken from deepsleep, normal mode
Spl 0: 54.84
Spl 1: 54.93

Spl 2: 54.88
Spl 3: 54.86
Spl 4: 54.96
Spl 5: 54.95
Spl 6: 54.94
 
a: -11782       7870    7870    absTilt: 54.92  T: 30.57        V: 3.89 owT: 29.56      Gravity: 15.60
After waiting 0.00 s, result 3
192.168.1.101
 
calling DTHTTP
genericHTTP: posting
POST /gravity HTTP/1.1
Host: 192.168.1.100
User-Agent: iSpindel00
Connection: close
Content-Type: application/json
Content-Length: 114
 
{"name":"iSpindel00","ID":"16729250","angle":54.91775,"temperature":29.5625,"battery":3.889468,"gravity":15.60024}HTTP/1.1 200 OK
Content-Length: 2
Content-Type: application/json
Connection: close
Accept-Ranges: none
 
{}
Final-sleep: 60s; RT:16653

@pronkster
Copy link

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..

@zandoga
Copy link

zandoga commented Sep 6, 2017 via email

@vitotai
Copy link
Owner

vitotai commented Sep 6, 2017

@zandoga
The time after reset seems to be wrong. This bug has bothered me for a while.
Would you provide the log file for me to analyze?
Just use http://brewpiless.local(or IP):8008/filemanager
you should find the log file. Right click and download.
Thanks.

@zandoga
Copy link

zandoga commented Sep 7, 2017

@vitotai
I reinstalled the software several times and cleared the EPROM after I noticed the time thing so I am not sure if the log file will help.
I was not sure which file so I attached both, loginfo and log/Spiced_Honew_Wheat. I changed the extension to TXT so I can attach them.

loginfo.TXT
Spiced_Honew_Wheat.TXT

@vitotai
Copy link
Owner

vitotai commented Sep 7, 2017

@zandoga
Thank you, but the log is not the the photo you showed. Did you find "Peppere_Honey_Wheat.bin"? That is what I want.
If you already format the filesystem, everything is gone.

@zandoga
Copy link

zandoga commented Sep 7, 2017

@vitotai
I'm sorry but I did format the system and reinstalled hoping that it will fix the iSpindel issue. I will definitely save the log file and send it over if I see that behavior happen again.

@JETET
Copy link

JETET commented Oct 12, 2019

good I have installed brewpiless in wemos but what are the steps to start an ispindel in said brewpiless?

@Naesstrom
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants