vitotai / BrewPiLessGx

BrewPiLess with touched TFT.
6 stars 4 forks source link

Access to second built-in skin #3

Open drbubbles opened 4 months ago

drbubbles commented 4 months ago

I have an ESP32_2432S032C and Pill but I don't see how to switch to the Pill skin (the pill was detected and selected in the gravity tab on the web interface). I tried adding: src/skins/skin_brewpi19.json src/skins/skin_hydro19.json

to the [env:ESP32_2432S032C] section of platformio.ini (copied from [env:ESP32_17320S019N]) but that didn't appear to help.

How do I get to the Pill skin? I can see the main skin with temperature and access to wifi settings. (This and the rest of brewpiless is absolutely fantastic by the way!)

DMT07 commented 4 months ago

I managed to switch skins by saving a backup of the settings under the "system" tab. Open the saved json file on your pc, change the "skin" field to 1, save and retore the settings to bpl. However, the "hydro19" skin doesn't seem to be working - nothing is updated on the screen. I haven't had time to dig into the problem - maybe something else need to be changed in the settings as well. So I haven't logged it as an issue yet.

DMT07 commented 4 months ago

I did a quick test and changing the "skin" field to 1 works.

My hydrometer skin initially didn't update because I had an invalid gravity formula saved under the gravity tab while testing.

It seems that the display will not update if the formula is invalid or the gavity is 0. That is good to remeber for those that want to use the hydrometer only as a beer-temperature sensor.

drbubbles commented 4 months ago

@DMT07 thanks, that worked for me too (I'm using an ESP32_2432S032C). Will see if I can make a couple of one-wire controlled relays (need to figure out parts to order). Like @vitotai pointed out, there's one less IO pin available than required for both heating and cooling control ( at least on the ESP32_2432S032C). Unless maybe one of the IOs isn't being used (or is used for something we don't require) and could be got at with a soldering iron.

DMT07 commented 4 months ago

@DMT07 thanks, that worked for me too (I'm using an ESP32_2432S032C). Will see if I can make a couple of one-wire controlled relays (need to figure out parts to order). Like @vitotai pointed out, there's one less IO pin available than required for both heating and cooling control ( at least on the ESP32_2432S032C). Unless maybe one of the IOs isn't being used (or is used for something we don't require) and could be got at with a soldering iron.

If you are not going to use a pressure sensor (or using a wireless pressure sensor) then you can reassign the pressure IO pin as an additional actuator pin in Config.h. Just choose another unused GPIO pin with adc capability for the pressure pin.

DMT07 commented 4 months ago

@drbubbles GPIO_38 (ADC1_CH2) is not routed out on the esp wroom-32 module, so it should be safe to set the pressure sensor pin in /src/brewpi/Config.h to 38.

Below is an example of what to search for and change in Config.h

#if ESP32_17320S019N
#define oneWirePin    21
#define actuatorPin1  47
#define PressureAdcPin  4
#else 
#define oneWirePin    22 
#define actuatorPin1  21 
#define actuatorPin2  35 // insert new line: the ADC pin becomes a second actuator pin
#define PressureAdcPin  38 // change from 35 to 38: The ADC pin is assigned as a dummy pin
#endif 

If you do test this, please let me know the outcome. I've ordered an ESP32_2432S032C board that I'm waiting for so I'm playing around with another board in the meantime. I intend to use the pressure pin on the ESP32_2432S032C as a second actuator pin for heating so I'm keen to know if it will work.

If I do find the need to monitor pressure in the future I'll have a look using a wireless pressure sensor like https://github.com/mp-se/pressuremon

drbubbles commented 4 months ago

Thanks @DMT07, having looked at the board I'm a bit worried about strain relief for any wires I solder there. I have a wired pressure gauge and realized I need 2 extra IO ports as I also would like to use a solenoid. So I plan to use a few DS2413 modules like @vitotai suggested. I'll post a picture if I get it going. Then I need to tackle interfacing an esp32 to the replacement induction hob controller I just got off AliExpress for mashing (I blew up the original one trying to automate it!)

vitotai commented 4 months ago

Sorry. I was busy and had no time to come back to this project. Somehow, I forgot to add the code, or some part of code was removed by accident. The skin skin switch code wasn't there...

Just updated it. I also created a simple skin editor. It's buggy and not complete, but it helps in positioning and sizing text elements of skins.

drbubbles commented 3 months ago

Thanks for the update, I did as you recommend, I added DS3413 1-wire to control the relays. So now on 1-wire i have: cool, heat, pressure release valve, beer temp, room temp. The pressure gauge goes direct to pin 35 (no adc), and there's a Pill on bluetooth (works through jacketed conical fermenter). I put phono plugs on the relays so I can remove them easily, and audio jacks for the sensors.

Now I just need to mount it all in a box or maybe on a piece of wood!

1

I had to get more pigtail connectors for the 4P sockets on the ESP32_2432S032C as it only arrives with one. I used "20 Set Micro JST MX 1.25 4Pins Connector Plug Socket 1.25mm" from amazon (totally overpriced but I was in a hurry). This was to get 1) pin 35, and 2) 5V for the pressure gauge.

Hwerow commented 3 months ago

@drbubbles Please could you sketch out the circuit connections Thanks

drbubbles commented 3 months ago

@hweror I put this together to describe it, I don't have an actual wiring diagram. I think this covers all the connections required though. image

For the two temperature sensors I use Sleeve for +V, Tip for Gnd, and Ring1 for the 1-wire signal (the sockets have 2 rings, the plugs have only one, and it mates with ring1 in the socket)

I edited the "pin configuration" section of the src/brewpi/Config.h file to set the 1-wire pin number to 21 and the pressure sensor to pin 35.

Although these connectors are convenient for testing, they are aren't good long-term. I'll change them to panel mount connectors and get my middle school kid to design a box for it with panel mount connectors in tinkerCAD and submit as homework :-)

Hwerow commented 3 months ago

@drbubbles thanks that helps Cheers

drbubbles commented 2 months ago

Sorry. I was busy and had no time to come back to this project. Somehow, I forgot to add the code, or some part of code was removed by accident. The skin skin switch code wasn't there...

Just updated it. I also created a simple skin editor. It's buggy and not complete, but it helps in positioning and sizing text elements of skins.

@vitotai Did this update enable a build flag to select one of the skins listed as default? I can change it using the backup json file like @DMT07 pointed out but I was hoping to select the info one for a fresh install (along with the pre-defined wifi settings, sorry, I should have posted that question here rather than in homebrewtalk forum). src/skins/skin_brewpi3224.json -> src/skins/skin_info3224.json