vitotai / BrewPiLess

Use an ESP8266 to replace RPI and Arduino. Running BrewPi without Pi, therefore, BrewPi-Less
357 stars 134 forks source link

Porting to ESP32 #128

Open ferchinas opened 6 years ago

ferchinas commented 6 years ago

Hi Vito: There is so far some work done to port to ESP32? I think there are many advantages as mensions in http://vito.tw/?p=720#comment-25109

I offer to collaborate to the best of my ability Regards

stefschin commented 4 years ago

is there a PCB for the ESP32 available? I want to swap from brewpiless esp8266 to ESP32 Version.

I'm on it...hope today I finish it and send to PCBWay if somebody wants to build it. Did you have ESP32-DOIT-DEVKIT-V1-Board with 30 or 36 GPIOs?

appi1 commented 4 years ago

great news, my Board is the following with 38 pins https://de.aliexpress.com/item/4000134023059.html?spm=a2g0s.9042311.0.0.27424c4diK4lbw

stefschin commented 4 years ago

I've found 3 models, with 30, 36 and 38 pins and they are not compatible to make 1 board. I can make 1 from each other if @vitotai want. And you prefer SMD or through hole components?

appi1 commented 4 years ago

the version with 38 pins is ok for me, thank you very much, SMD is ok. is it possible to integrate a DC Converter as AMS1117, so we can use 12V for the PCB and also for the relays.

lalo-uy commented 4 years ago

Be carefully with AMS1117, to input is 12v . With 12.5 or 13 burn in 12v pass thru. 4 esp8266 smoked that way. Old good 7805 or 78M05 mutch better.

El El mar, 28 de abr. de 2020 a la(s) 15:07, appi1 notifications@github.com escribió:

the version with 38 pins is ok for me, thank you very much, SMD is ok. is it possible to integrate a DC Converter as AMS1117, so we can use 12V for the PCB and also for the relays.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/vitotai/BrewPiLess/issues/128#issuecomment-620767928, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACXBW4JPX4CSJAT3P4F7GY3RO4LMTANCNFSM4FYSIBGA .

appi1 commented 4 years ago

hi Guys some news to the PCB?

stefschin commented 4 years ago

Hi! Give me some days to finish it, I was very busy these days

fabiojavaroni commented 4 years ago

Hello Guys, I finally got to assemble all the parts for the esp32 version. I´m using a Oled + rotary + esp32 + 2 channel relay + 2 ds18b20.

Using the tips in this posta i could upload with Vscode and Platformio. However the oled isnt working and i don´t know the reason.

Have i need to turn on something in frontend?

Environment Status Duration


esp32-dev IGNORED esp32 SUCCESS 00:00:52.666 esp32-oled IGNORED esp8266dev IGNORED classic FAILED 00:00:45.795 d1pro-classic FAILED 00:00:43.905 d1pro FAILED 00:00:45.761 classic-spanish FAILED 00:00:37.376 classic-portuguese-br FAILED 00:00:44.170 classic-slovak FAILED 00:00:37.015 classic-tw FAILED 00:00:24.978 classic-it FAILED 00:00:43.910 newui FAILED 00:00:19.642 newui-spanish FAILED 00:00:45.735 newui-portuguese-br FAILED 00:00:43.172 newui-slovak FAILED 00:00:42.643 newui-tw FAILED 00:00:42.355 newui-it FAILED 00:00:42.869 newui-oled FAILED 00:00:44.383 thorrax FAILED 00:00:20.144 thorrax-classic FAILED 00:00:48.503 sonoff FAILED 00:00:44.213 sonoff-esp8285 FAILED 00:00:44.012 ========================================= 19 failed, 1 succeeded in 00:13:33.249 ========================================= The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

Thank you

allthepies commented 4 years ago

esp32-oled IGNORED

That ^^ looks to be the reason, you haven't built the OLED version for ESP32

fabiojavaroni commented 4 years ago

How i do this? Thanky you

sedgington commented 4 years ago

OK, I'm responding to this post to help anyone else out there that has not gone through the (initial) pain of trying to get the ESP32 chip to work with brewpiless. While I have never had a problem with the 8266 D1 mini and the excellenbt .bin files of brewpiless, the ESP32 would never work for me with any of the .bin files I tried--either from the -4.0pre branch or from the Master branch. While Nodemcu-PyFlasher-4.0 on my macbook pro repeatedly would successfully load the .bin file to my ESP32, I would never get the brewpiless AP to come up so that I could then log in. At first, I thought it must be something wrong with the development board I had ordered: https://www.amazon.com/gp/product/B0718T232Z/ref=ppx_yo_dt_b_asin_title_o08_s00?ie=UTF8&psc=1 so I ordered a different board: https://www.amazon.com/gp/product/B07DBNHJW2/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&psc=1 same story. This sent me down the road of building and uploading my own .bin file using Visual Studio Code with PlatformIO--again on the same macbook pro. I'm happy to say this was successful in the end, but unlike Nodemcu, I had to physically press the boot or Ioo button and then (sometimes) the reset button while still holding down the boot button to get the board to go into bootloader mode so that PlatformIO could communicate with the device ( the last board of the second group of boards, balked on communicating through the USB port if I hit the reset button and would only work when I hit the boot button). So here are is the short version of the steps I had to do to get the ESP32 boards to successfully load brewpiless:

  1. Download Visual Studio Code and install it
  2. Add PlatformIO to VSC
  3. Download the brewpiless-4.0pre branch from github: https://github.com/vitotai/BrewPiLess/tree/v4.0pre
  4. Unzip this branch and copy it to a subdirectory of PlatformIO (mine was in the Documents folder)
  5. Open this folder that contains the platformio.ini from within VSC/Platformio
  6. Click on platformio.ini so that it is open in PlatformIO.
  7. At the top of the file find the line default_envs = esp8266dev under [platformio] and change it to #default_envs = esp8266dev 8 Under that line add: default_envs = esp32-dev
  8. Save the file
  9. find the line
    upload_port = /dev/cu.SLAB_USBtoUART under [env:esp32-dev] and change it to upload_port = /dev/cu.usbserial-0001 (I knew this was my usb port because Nodemcu had told me that information when I went to load the .bin file).
  10. Do the same for the line under it that begins monitor_port =
  11. Under "View" in VS Code, click on "Command Palette" begin typing in PlatformIO: Build until it finds the command. It will then run the build command. And don't forget to save the file again.
  12. Connect your development board to the USB port of your computer. Be sure to use a cable that is capable of transmitting data and is not just a power cable. The red led will come on. Either push and hold the "boot" or "Ioo" button and while still holding it down, briefly hit the "reset" button, then release the button you have been holding down. (if this doesn't work, just hold down the "boot" button and release it.)
  13. Assuming that the "PlatformIO: Build" command ran successfully, repeat the steps of 12. but begin typing in "PlatformIO: Upload" until the command is in the box. It will then run automatically.
  14. If you successfully found the correct upload port for your usb connection to the board, the program will run and at the bottom of the console you will see under the line that begins with "Environment" the line: esp32-dev SUCCESS 00:00:43.070 All the other Environments will state "IGNORED".
  15. Unplug the development board from the USB cable and then plug it back in.
  16. Monitor your wireless network for "brewpiless" and click on that network. Open a web browser after you successfully join brewpiless and type in 192.168.4.1 to bring you to the homepage of brewpiless. Go to the system tab, scan for your local network, select it, put in the password, save it and then, importanly, hit the "submit" button on the bottom right part of the screen. Brewpiless will join your network and you can set it up as desired.

Now, why is this pain worth it? Well, the ESP32 seems to be much faster, has more memory, and should be more stable than the 8266 boards. In addition, it has Bluetooth built in which means that down the road it might support Tilt Hydrometers as well as the currently supported wifi-enabled iSpindel Hydrometers (which are difficult to source in the USA because Tilt has apparently intimidated the German supplier of iSpindel kits to the degree that he will not ship to the USA).

I hope this helps someone and saves them from the pain of getting their ESP32 board to work. If I have missed something or there is a better way, please comment on this post on your way of doing this.

sedgington commented 4 years ago

As an addenda to my post above, I found that my driver problem listed in step 9 above: upload_port = /dev/cu.SLAB_USBtoUART under [env:esp32-dev] is apparently a common problem in the Mac operating system and to a degree with Windows as well. About the only OS that seems to not have encountered this issue reguarly is Linux. However, this is easily fixable (at least for me). If you navigate to the URL below and dowload the drivers for your operating system, you can then install them: https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers Once installed, I tested them within visual studio with the platformio extension by downloading the recently updated Master branch and then following my steps above without changing the upload port. A word of caution for the noviate: this version will build all the bin files of the branch unless you only specify the environment that you want at the top of platformio.ini. Once specified, I successfully built and loaded my ESP32 with the new drivers. However, Nodemcu would still not load a working copy of brewpiless from the precompiled .bin file in the master branch--even though it said it had successfully loaded the .bin. In any case, one small request for the various versions: Is there a place within brewpiless that one could see exactly which version has been loaded. Mine still says v4.0 after uploading the new Brewpiless.4.0r2.trial.esp32. Thanks!

vitotai commented 4 years ago

@sedgington I would like to add your instruction to the document, if you don't mind.

sedgington commented 4 years ago

Yes, please do. I didn’t know where to post it that everyone could use/see it. Regards, Stephen

On Jul 8, 2020, at 6:41 AM, vitotai notifications@github.com wrote:

@sedgington https://github.com/sedgington I would like to add your instruction to the document, if you don't mind.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vitotai/BrewPiLess/issues/128#issuecomment-655439042, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB3Z4RWBZFB4QCF5FEM3LU3R2RENLANCNFSM4FYSIBGA.

kall3 commented 4 years ago

Hi, I have a question while half way through my first brewpiless build.

I started off with the 8266 chip, but now I realize that if I use the ESP32 I should be able to read my tilt directly right?

vitotai commented 4 years ago

Hi, I have a question while half way through my first brewpiless build.

I started off with the 8266 chip, but now I realize that if I use the ESP32 I should be able to read my tilt directly right?

Not yet.

zorce commented 4 years ago

Have managed to get it build and installed, running on my esp32dev board, but seem to have some issue with my oled screen, connected up in i2c mode. Example code on the screen shows it working, but had some issues when not using the reset pin for it. brewpiless I have a constant black screen. DATA -> pin 21 CLK -> pin 22 build_flags = -DOLED_LCD=true -DSerialDebug=true

Have not wired any buttons or encoder yet. Thanks for the support so far!

zorce commented 4 years ago

Have changed the adress to 0x3D instead of 0x3C (default) but no luck on getting it to run. Have done a i2c scan and my version of the oled screen was on 0x3D. Using an adafruit 1.3" ssd1306 128x64 screen. Managed to get the display running now, but as in the arduino example for the screen, if not running with the reset pin i just get random pixels everywhere. In adafruits library ther have a -1 for the reset, this however dose not work, but when using eg. pin 4 as reset pin in the example it works as it should.. Don't know how and if i can add this to this project. Will have a look at it.

Now it works! Just had to reset the screen manually once :/ maybe some old setting that it remembered

stefschin commented 4 years ago

hi Guys some news to the PCB?

Hi Guys, sorry for delay, after work changes, being father again and other stuffs I finished my tentative design for this project. Here can you see Schematic and how would be this PCB design: https://github.com/stefschin/BrewPiLess-32-PCB If @vitotai agree I will finish PCB traces and publish it so everyone can buy this PCB, Best and Cheers!!! 🍺

AbeleToms commented 4 years ago

hi Guys some news to the PCB?

Hi Guys, sorry for delay, after work changes, being father again and other stuffs I finished my tentative design for this project. Here can you see Schematic and how would be this PCB design: https://github.com/stefschin/BrewPiLess-32-PCB If @vitotai agree I will finish PCB traces and publish it so everyone can buy this PCB, Best and Cheers!!! 🍺

cant wait for the PCB, just tried the build on ESP32, for me it works faster than 8266 and is stable for now.

looseends commented 3 years ago

Can two push buttons be used with the esp32 instead of rotary encoder?

vitotai commented 3 years ago

Can two push buttons be used with the esp32 instead of rotary encoder?

Yes with some code modification. but why? It's not easy to press two buttons "at the same time"

lalo-uy commented 3 years ago

I belive he wants to use 2 buttons as UP and DOWN. Will need some code changes but is doable.

stefschin commented 3 years ago

hi Guys some news to the PCB?

Hi Guys, sorry for delay, after work changes, being father again and other stuffs I finished my tentative design for this project. Here can you see Schematic and how would be this PCB design: https://github.com/stefschin/BrewPiLess-32-PCB If @vitotai agree I will finish PCB traces and publish it so everyone can buy this PCB, Best and Cheers!!! 🍺

cant wait for the PCB, just tried the build on ESP32, for me it works faster than 8266 and is stable for now.

Board is finished @AbeleToms ! please try it to find any bug in this PCB.

AbeleToms commented 3 years ago

hi Guys some news to the PCB?

Hi Guys, sorry for delay, after work changes, being father again and other stuffs I finished my tentative design for this project. Here can you see Schematic and how would be this PCB design: https://github.com/stefschin/BrewPiLess-32-PCB If @vitotai agree I will finish PCB traces and publish it so everyone can buy this PCB, Best and Cheers!!! 🍺

cant wait for the PCB, just tried the build on ESP32, for me it works faster than 8266 and is stable for now.

Board is finished @AbeleToms ! please try it to find any bug in this PCB.

thanks for the update @stefschin ! ordered the PCB, just received them today. will report

rkhanso commented 1 year ago

Hello @AbeleToms -- Did you have any trouble with the PCB? Or anyone with reports of the PCB working well? I'm considering ordering from PCB Way.