Replacement firmware for iSpindel (GravityMon)

Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum

Help Support Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
Okay I get you. I uploaded the version with (USBC console) and I am getting the same log as above with my serial port monitor.

Saved PC:0x403d0f62
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd6100,len:0x438
load:0x403ce000,len:0x90c
load:0x403d0000,len:0x2358
entry 0x403ce000
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0xf (SPI_FAST_FLASH_BOOT)
 
Okay I get you. I uploaded the version with (USBC console) and I am getting the same log as above with my serial port monitor.

Saved PC:0x403d0f62
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd6100,len:0x438
load:0x403ce000,len:0x90c
load:0x403d0000,len:0x2358
entry 0x403ce000
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0xf (SPI_FAST_FLASH_BOOT)
When I try flashing using NodeMCU PyFlasher it's stuck at Detecting chip type... So maybe it isn't flashing correctly.
 
When I try flashing using NodeMCU PyFlasher it's stuck at Detecting chip type... So maybe it isn't flashing correctly.
I added a version of brewflasher on the release page in github. This version I built myself and this is the one I tested with today. Please try that version to check if that works. The C3 and S2 chip requires a different bootloader and flashparams so nodemcu might not support that chip.

The other option is to flash it via platformio and vscode. Remove the option -DUSE_SERIAL_PINS if you want the console to the usbc port.
 
I added a version of brewflasher on the release page in github. This version I built myself and this is the one I tested with today. Please try that version to check if that works. The C3 and S2 chip requires a different bootloader and flashparams so nodemcu might not support that chip.

The other option is to flash it via platformio and vscode. Remove the option -DUSE_SERIAL_PINS if you want the console to the usbc port.
Yes I did try that. Using brewflasher 1.5 and trying to flash Gravitymon 1.2 Beta Esp32C3 mini (USBC Console). Flashing works and everything looks good but when I reset the device no wifi hotspot appears. When I connect to the serial monitor I get.

Saved PC:0x403d0f62
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd6100,len:0x438
load:0x403ce000,len:0x90c
load:0x403d0000,len:0x2358
entry 0x403ce000
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0xf (SPI_FAST_FLASH_BOOT)

I have tried flashing with platformio before but ran into one error after another.
 
I just saw this in documentation

You need to add a resistor between A0 (Analog PIN) and ground of 470k. The reason is that the esp8266 has a build in resistor for a voltage divider which the esp32 does not have. So in order to get a valid voltage (less than 3.2V) on the A0 pin this is needed. Once the modification is done you might need to adjust the voltage factor so the battery reading is correct.

I have not done this. Is it required for it to work?
 
Yes I did try that. Using brewflasher 1.5 and trying to flash Gravitymon 1.2 Beta Esp32C3 mini (USBC Console). Flashing works and everything looks good but when I reset the device no wifi hotspot appears. When I connect to the serial monitor I get.

Saved PC:0x403d0f62
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd6100,len:0x438
load:0x403ce000,len:0x90c
load:0x403d0000,len:0x2358
entry 0x403ce000
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0xf (SPI_FAST_FLASH_BOOT)

I have tried flashing with platformio before but ran into one error after another.
Can you try the brewflasher.exe that i attached to the release in github?
https://github.com/mp-se/gravitymon/releases/tag/v1.2.0-beta1
 
I just saw this in documentation

You need to add a resistor between A0 (Analog PIN) and ground of 470k. The reason is that the esp8266 has a build in resistor for a voltage divider which the esp32 does not have. So in order to get a valid voltage (less than 3.2V) on the A0 pin this is needed. Once the modification is done you might need to adjust the voltage factor so the battery reading is correct.

I have not done this. Is it required for it to work?
Yes, if the voltage is to be detected correctly and not to damage the chip.
 

Attachments

  • c3_mini_v2.1.0_4_16x9.png
    c3_mini_v2.1.0_4_16x9.png
    193.8 KB · Views: 0
Okay this worked! Flashing was successful and my Ispindel is now broadcasting a wifi network!!! Thanks so much

One more question I noticed the pinouts are different between v1 and v2.1 of the c3 mini. Do I connect the 470k resistor from A0 to ground?
they have renamed the pins compared to the esp8266, so according to you picture it should be pin3 that is used to measure the voltage. (a0 pin according to the esp8266)

i will correct the doc and check with thorrak what could be wrong with brewflasher.
 
Could you give a little rundown how the bluetooth works. I can't get the c3 mini to broadcast a bluetooth signal. I have calibrated the device and picked a cap color in configuration. I then put the device in deep sleep mode. The serial monitor says Broadcast data over bluetooth and then enter deep sleep. I downloaded the tilt app and it's not detecting anything. Im also using nRF connect and can't find any new bluetooth signals.
 
Could you give a little rundown how the bluetooth works. I can't get the c3 mini to broadcast a bluetooth signal. I have calibrated the device and picked a cap color in configuration. I then put the device in deep sleep mode. The serial monitor says Broadcast data over bluetooth and then enter deep sleep. I downloaded the tilt app and it's not detecting anything. Im also using nRF connect and can't find any new bluetooth signals.
I haven't actually tested ble on the c3 yet. I will have a look. If you dont see anything in the tilt app then there is most likley an issue.

Since there were issues with the Wi-Fi to send at full strength then its plausible that there are similar issues with BLE. Did you get the v1.0 board of the C3 ?

I have done a quick test and the BLE power needs to be reduced, then the transmission works. Had to change these lines in the ble.cpp for it to work.

esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_DEFAULT, ESP_PWR_LVL_P6);
esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_ADV, ESP_PWR_LVL_P6);
esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_SCAN, ESP_PWR_LVL_P6);

I have replaced the (USBC) version on github with this fix. Just reflash with brewflasher and it should work.
 
Last edited:
I haven't actually tested ble on the c3 yet. I will have a look. If you dont see anything in the tilt app then there is most likley an issue.

Since there were issues with the Wi-Fi to send at full strength then its plausible that there are similar issues with BLE. Did you get the v1.0 board of the C3 ?

I have done a quick test and the BLE power needs to be reduced, then the transmission works. Had to change these lines in the ble.cpp for it to work.

esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_DEFAULT, ESP_PWR_LVL_P6);
esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_ADV, ESP_PWR_LVL_P6);
esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_SCAN, ESP_PWR_LVL_P6);

I have replaced the (USBC) version on github with this fix. Just reflash with brewflasher and it should work.
Okay thanks. No I have the v2.1 of the c3 mini.
 
Okay thanks. No I have the v2.1 of the c3 mini.
Let me know if the updated version works. I thought they had fixed the wifi issues with the newer hardware versions.... If this does the trick then the wifi/ble issues remain....
 
Let me know if the updated version works. I thought they had fixed the wifi issues with the newer hardware versions.... If this does the trick then the wifi/ble issues remain....
Seems like it works now. Not sure I did it right the first time. I was not aware that it sends a Bluetooth signal whatever update interval you have set in gravitymon just like WIFI. My ds182b temperature sensor doesn't work not sure if it's a hardware issue or not. It never worked from the beginning with this Ispindel so it could be a hardware issue.
 
So after testing the bluetooth for a bit I'm bit impressed on it's proformance. I set up the Ispindel to send a signal every 10 seconds and the tilt app for the most part kept receiving those signals. Sometimes the app wouldn't pick up a few signals in a row, the longest of that would maybe be 60 seconds. I never owned a tilt so can't really compare the two. I'm still waiting for supplies before I can begin testing the battery using bluetooth. I noticed the tilt sends signals every 5 seconds but the gravitymon minimum is 10s. Or would that be a battery killer?
 
So after testing the bluetooth for a bit I'm bit impressed on it's proformance. I set up the Ispindel to send a signal every 10 seconds and the tilt app for the most part kept receiving those signals. Sometimes the app wouldn't pick up a few signals in a row, the longest of that would maybe be 60 seconds. I never owned a tilt so can't really compare the two. I'm still waiting for supplies before I can begin testing the battery using bluetooth. I noticed the tilt sends signals every 5 seconds but the gravitymon minimum is 10s. Or would that be a battery killer?
I plan to do some long term battery tests with the esp32. The battery life is more or less related to the run time. If you only use ble it should skip wifi connection so it would be more efficient. In the ui you can see the average run time and it will also estimate the lifespan based on that (for a full battery) its displayed after the sleep interval. So you can see the effect directly when changing the interval, keep in mind its an estimation
 
So after testing the bluetooth for a bit I'm bit impressed on it's proformance. I set up the Ispindel to send a signal every 10 seconds and the tilt app for the most part kept receiving those signals. Sometimes the app wouldn't pick up a few signals in a row, the longest of that would maybe be 60 seconds. I never owned a tilt so can't really compare the two. I'm still waiting for supplies before I can begin testing the battery using bluetooth. I noticed the tilt sends signals every 5 seconds but the gravitymon minimum is 10s. Or would that be a battery killer?
I looked at the data I collected for the esp8266 and if you use 30s interval and it takes 2s to read and send data with a power consumption on 160mA you would probably get 7-9 days of runtime before the battery runs out. 300 can give you 3-5 weeks.

the esp32c3 could consume around 290mA (depends on wifi power) which means that you would probably get 4-5 days on the esp32. So going as low as 5 seconds might give you a day or two...

So for long life the esp8266 is a much better choice but I will gather some more data and facts on the topic.
 
This looks like a neat project. I've got an iSpindel with a failed switch, and I think the "Storage Mode" might let me short the switch instead of unsoldering it and the charger so I can replace the switch. Does that sound like a reasonable thing for me to do?

[Edit] It looks like other people proposed the same kind of thing on the main iSpindel thread, for the same reason, and that may have been part of the inspiration for this feature. I'll give it a shot.
 
Last edited:
This looks like a neat project. I've got an iSpindel with a failed switch, and I think the "Storage Mode" might let me short the switch instead of unsoldering it and the charger so I can replace the switch. Does that sound like a reasonable thing for me to do?

[Edit] It looks like other people proposed the same kind of thing on the main iSpindel thread, for the same reason, and that may have been part of the inspiration for this feature. I'll give it a shot.
That should work, it draws very little battery when in deep sleep mode. Just tap the reset it when you want to wake it up.
 
Pedant alert.

" This project builds on the excellet work "

Just a typo in the second paragraph.

But it's an excellent distillation and information source. I think you've done an amazing job.
 
Pedant alert.

" This project builds on the excellet work "

Just a typo in the second paragraph.

But it's an excellent distillation and information source. I think you've done an amazing job.
Thanks, I have fixed the spelling error Will show up when the cache is cleared.

Thanks for the feedback, it's a first version and I plan to extend it with more information when time permits. It also open ups for more features now that I have a domain name as a base.
 
I looked at the data I collected for the esp8266 and if you use 30s interval and it takes 2s to read and send data with a power consumption on 160mA you would probably get 7-9 days of runtime before the battery runs out. 300 can give you 3-5 weeks.

the esp32c3 could consume around 290mA (depends on wifi power) which means that you would probably get 4-5 days on the esp32. So going as low as 5 seconds might give you a day or two...

So for long life the esp8266 is a much better choice but I will gather some more data and facts on the topic.
My average runtime is at 0 seconds according to the main Beer Gravity Monitor. That's just using the Bluetooth and no Wi-Fi.

Is there a possibility there might be a programming error with the ds18b20 temperature sensor with the c3? I can't get the temp sensor to work. Gyro temp works fine.

Your website looks great btw!
 
My average runtime is at 0 seconds according to the main Beer Gravity Monitor. That's just using the Bluetooth and no Wi-Fi.

Is there a possibility there might be a programming error with the ds18b20 temperature sensor with the c3? I can't get the temp sensor to work. Gyro temp works fine.

Your website looks great btw!
I get temp from the ds temp, have you checked if there is connection to the esp? I had
one pcb that had a faulty connection.
 
@mper
Finally I got round to building a temperature only " ispindel " . The Tempmon

I have used a spare mikmonken mother board ( oned of the very early ones that stacked the gyro and wifi on one side and the battery controller on the other ) and then soldered it up without the gyro board.

I flashed the tempmon 0.1 binary via the esp8266 flasher with a full erase prior to the install. No option for it on brewflasher as a binary.
Success accessing the tempmon wifi AP called temp with the password of password.

Then added in my network SSID and password. Saved and then I can see the device on my network when I look at the admin portal of my router.

However I can't access it at all either via it's web address or the unique name tempmon******.local

What can I do to give you some more info?

Thanks
 
@mper
Finally I got round to building a temperature only " ispindel " . The Tempmon

I have used a spare mikmonken mother board ( oned of the very early ones that stacked the gyro and wifi on one side and the battery controller on the other ) and then soldered it up without the gyro board.

I flashed the tempmon 0.1 binary via the esp8266 flasher with a full erase prior to the install. No option for it on brewflasher as a binary.
Success accessing the tempmon wifi AP called temp with the password of password.

Then added in my network SSID and password. Saved and then I can see the device on my network when I look at the admin portal of my router.

However I can't access it at all either via it's web address or the unique name tempmon******.local

What can I do to give you some more info?

Thanks
Since there is no gyro, the only way for it to get into config mode is to ensure that you have a charger attached so it will start the web server. So start charging the battery and it should work.
 
@mper
I've now tried the tempmon with the charger plugged in, I can connect to the tempmon via it's 192.168.4.1 startup after pushing the reset and configure it for my wifi ssid and password then save.

But I don't see the blue light flashing after the save of wifi info or when I plug into the charging port and turn it on to charge, I do see the red light though.

The network does show the tempmon ip address but the configuration web server isn't there.

What shall I try next?
 
@mper
I've now tried the tempmon with the charger plugged in, I can connect to the tempmon via it's 192.168.4.1 startup after pushing the reset and configure it for my wifi ssid and password then save.

But I don't see the blue light flashing after the save of wifi info or when I plug into the charging port and turn it on to charge, I do see the red light though.

The network does show the tempmon ip address but the configuration web server isn't there.

What shall I try next?
Ok, let me try to flash one of my devices and check it. It has been a while since I tried it
 
I've just flashed the gravitymon 1.1.1 via brewflasher, again I can enter the WIFi setup details but again no blue flashing light plugged in to the charging port or without plugging it in.
This doesn't have a gyro on it so that might be upsetting the gravitymon firmware and ongoing setup.

I'm wondering if it's hardware and will swap out the esp8266 then try again.
 
I've just flashed the gravitymon 1.1.1 via brewflasher, again I can enter the WIFi setup details but again no blue flashing light plugged in to the charging port or without plugging it in.
This doesn't have a gyro on it so that might be upsetting the gravitymon firmware and ongoing setup.

I'm wondering if it's hardware and will swap out the esp8266 then try again.
Gravitymon should start without the gyro. Could you connected it to a serial terminal to see what the output is ? That could give some hints.. Do it without the battery connected so you dont overload that.
 
Okay, I've tried a new ESP8266 on it.

Same as before with the tempmon firmware.

Just loaded the 1.1.1 gravitymon and same wifi parameters and the webinterface for config has popped up. It confirms that it can't connect to a gyro.

So might have been something dodgy with the first esp8266.

I'll go and try reloading the tempmon now without an erase to see if any difference.
 
Okay
I've just flashed the tempmon without an erase and now it's into the configuration page.

It's showing a temperature that seems about right and I'll carry on and configure now.

So counted as working with a workaround of the install. Now to package it up and put the wireless charger on it. Great work.
 
Okay
I've just flashed the tempmon without an erase and now it's into the configuration page.

It's showing a temperature that seems about right and I'll carry on and configure now.

So counted as working with a workaround of the install. Now to package it up and put the wireless charger on it. Great work.
Thanks, i will add it to brewflasher as an option to make the flashing easier.
 
@mper
An option in brewflasher will make it easier, but a note to users that I had to install the gravitymon first and then tempmon after that to get it to work.
I couldn't get a tempmon install clean into the hardware to work without the double install.
 
@mper
An option in brewflasher will make it easier, but a note to users that I had to install the gravitymon first and then tempmon after that to get it to work.
I couldn't get a tempmon install clean into the hardware to work without the double install.
I've added it to brewflasher and I did a flash erase when testing it. It started as it should. So it might have been something with the other flash program you used. Let me know what you think and if you have any ideas for other features.
 
New beta for 1.2 focused on supporting ESP32 chips. I'm waiting for my new ESP32c3 v2.1 chips to test that properly. I've been doing some battery testing with ESP32 wifi, ESP8266wifi and ESP32 ble. There is quite a difference between the options.

ESP32 wifi, 12000 reads -> 5 min interval = 43 days
ESP8266 wiif, 26000 reads -> 5 min interval = 90 days
ESP32 ble, 56000 reads -> 5 min interval = 196 days

I've also added support for the floaty hydrometer DIY build based on the ESP32 lite. All options are available in brewflasher.

https://github.com/mp-se/gravitymon/releases/tag/v1.2.0-beta2
 
Back
Top