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:

nhofer7

Member
Joined
Jun 5, 2013
Messages
21
Reaction score
0
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)
 

nhofer7

Member
Joined
Jun 5, 2013
Messages
21
Reaction score
0
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.
 
OP
OP
M

mper

Supporting Member
HBT Supporter
Joined
May 24, 2020
Messages
166
Reaction score
41
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.
 

nhofer7

Member
Joined
Jun 5, 2013
Messages
21
Reaction score
0
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.
 

nhofer7

Member
Joined
Jun 5, 2013
Messages
21
Reaction score
0
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?
 
OP
OP
M

mper

Supporting Member
HBT Supporter
Joined
May 24, 2020
Messages
166
Reaction score
41
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?
 
OP
OP
M

mper

Supporting Member
HBT Supporter
Joined
May 24, 2020
Messages
166
Reaction score
41
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.
 

nhofer7

Member
Joined
Jun 5, 2013
Messages
21
Reaction score
0
Can you try the brewflasher.exe that i attached to the release in github?
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?
 

Attachments

  • c3_mini_v2.1.0_4_16x9.png
    c3_mini_v2.1.0_4_16x9.png
    193.8 KB · Views: 0
OP
OP
M

mper

Supporting Member
HBT Supporter
Joined
May 24, 2020
Messages
166
Reaction score
41
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.
 

nhofer7

Member
Joined
Jun 5, 2013
Messages
21
Reaction score
0
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.
 
OP
OP
M

mper

Supporting Member
HBT Supporter
Joined
May 24, 2020
Messages
166
Reaction score
41
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:

nhofer7

Member
Joined
Jun 5, 2013
Messages
21
Reaction score
0
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.
 
OP
OP
M

mper

Supporting Member
HBT Supporter
Joined
May 24, 2020
Messages
166
Reaction score
41
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....
 

nhofer7

Member
Joined
Jun 5, 2013
Messages
21
Reaction score
0
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.
 

nhofer7

Member
Joined
Jun 5, 2013
Messages
21
Reaction score
0
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?
 
OP
OP
M

mper

Supporting Member
HBT Supporter
Joined
May 24, 2020
Messages
166
Reaction score
41
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
 
OP
OP
M

mper

Supporting Member
HBT Supporter
Joined
May 24, 2020
Messages
166
Reaction score
41
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.
 

gabeweisz

Well-Known Member
Joined
Nov 23, 2007
Messages
185
Reaction score
4
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:
OP
OP
M

mper

Supporting Member
HBT Supporter
Joined
May 24, 2020
Messages
166
Reaction score
41
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.
 

DuncB

Well-Known Member
Joined
Jun 5, 2019
Messages
2,791
Reaction score
1,621
Location
Paremata New Zealand
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.
 
OP
OP
M

mper

Supporting Member
HBT Supporter
Joined
May 24, 2020
Messages
166
Reaction score
41
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.
 

nhofer7

Member
Joined
Jun 5, 2013
Messages
21
Reaction score
0
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!
 
OP
OP
M

mper

Supporting Member
HBT Supporter
Joined
May 24, 2020
Messages
166
Reaction score
41
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.
 

DuncB

Well-Known Member
Joined
Jun 5, 2019
Messages
2,791
Reaction score
1,621
Location
Paremata New Zealand
@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
 
OP
OP
M

mper

Supporting Member
HBT Supporter
Joined
May 24, 2020
Messages
166
Reaction score
41
@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.
 

DuncB

Well-Known Member
Joined
Jun 5, 2019
Messages
2,791
Reaction score
1,621
Location
Paremata New Zealand
@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?
 
OP
OP
M

mper

Supporting Member
HBT Supporter
Joined
May 24, 2020
Messages
166
Reaction score
41
@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
 

DuncB

Well-Known Member
Joined
Jun 5, 2019
Messages
2,791
Reaction score
1,621
Location
Paremata New Zealand
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.
 
OP
OP
M

mper

Supporting Member
HBT Supporter
Joined
May 24, 2020
Messages
166
Reaction score
41
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.
 

DuncB

Well-Known Member
Joined
Jun 5, 2019
Messages
2,791
Reaction score
1,621
Location
Paremata New Zealand
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.
 

DuncB

Well-Known Member
Joined
Jun 5, 2019
Messages
2,791
Reaction score
1,621
Location
Paremata New Zealand
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.
 
OP
OP
M

mper

Supporting Member
HBT Supporter
Joined
May 24, 2020
Messages
166
Reaction score
41
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.
 

DuncB

Well-Known Member
Joined
Jun 5, 2019
Messages
2,791
Reaction score
1,621
Location
Paremata New Zealand
@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.
 
OP
OP
M

mper

Supporting Member
HBT Supporter
Joined
May 24, 2020
Messages
166
Reaction score
41
@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.
 
OP
OP
M

mper

Supporting Member
HBT Supporter
Joined
May 24, 2020
Messages
166
Reaction score
41
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.

 
Top