Wireless Brewpi Via Wifi

HomeBrewTalk.com - Beer, Wine, Mead, & Cider Brewing Discussion Community.

Help Support Homebrew Talk:

mattrox

Well-Known Member
Joined
Oct 8, 2015
Messages
284
Reaction score
58
I just changed over from DSL to our new high(er) speed National Broadband Network.

New router and new IPs all round.

Had to reflash the D1 wifi module with esp-link. I think I fried one unit in the change over, thank goodness for spare. Then had to get the new IP and make it static.

Then on the Wheezy box had to update the network interfaces. Type in SSID and Passwork for my psk string....... find out my wifi dongle doesn't do 5khz so the computer can't connect to the network. Get new psk string with correct SSID.... of course I type in a 7 instead of a 2 somewhere in there and it takes ages to find that mistake..... Computer finally connects.
Can see brewpi page.

Change the brewpi config to new D1 module IP. all good so far. Hang on wait say cant read version and to re-flash Arduino..... Reflash it 5 times not working. Resest EEPROM reflash, not working.


....
...
...
OH, Wait!!! UFW ...... remind myself how UFW works, fix permissions.

Ok working.

Configure temp probes. Back online.

What a mission. I realised just how much of what I learned the 1st time I set it up that I forgot. Took me the best part of a day to get it all working with all the faffing about and the dead time looking up all the steps I had taken to get this thing running. Happy it is working again.
 
OP
thekraken

thekraken

Well-Known Member
Joined
Aug 18, 2014
Messages
1,960
Reaction score
449
Location
DFW
None. But that's an interesting board, nice find. The project in this thread uses the esp8266 as a transparent wireless serial bridge, meaning that you can flash the standard brewpi avr code without any modification. I wonder if this board can still easily be used in that fashion.
 

ElChangoGuero

Well-Known Member
Joined
Jul 29, 2016
Messages
123
Reaction score
22
None. But that's an interesting board, nice find. The project in this thread uses the esp8266 as a transparent wireless serial bridge, meaning that you can flash the standard brewpi avr code without any modification. I wonder if this board can still easily be used in that fashion..
Yes! Thats exactly what i am trying to do, flash without modifying any of the brewpi code, hopefully it should be something like @mattrox installation (fingers crossed) ill let you guys know how it works out when it arrives ;)
 

froot

Well-Known Member
Joined
Sep 7, 2014
Messages
114
Reaction score
13
Yes! Thats exactly what i am trying to do, flash without modifying any of the brewpi code, hopefully it should be something like @mattrox installation (fingers crossed) ill let you guys know how it works out when it arrives ;)
The only issue that may arise is which pins the esp uses at boot up, I suggest reading through both pocketmon and thorak's threads on wireless brewpi.
 

Thorrak

Supporting Member
HBT Supporter
Joined
Feb 7, 2016
Messages
2,433
Reaction score
1,336
Location
New York, NY
The only issue that may arise is which pins the esp uses at boot up, I suggest reading through both pocketmon and thorak's threads on wireless brewpi.
This is an interesting device, because it seems to have both the Atmel (Arduino) chip and the ESP8266 chip. That makes me think that it's actually hiding the ESP8266 functionality behind the Arduino WiFi libraries (for the WiFi shield, etc). Assuming that's the case, I doubt that the ESP's pins would really be exposed.

The irony of this is that the ESP8266 is actually the more powerful chip -- and the cheaper implementation. You lose out on exposed GPIO pins, but gain in most other areas. It's hard to argue with an established (if de facto) standard though - hence why so many of the ESP8266 chips are implemented in arduino like form factors/implementations.

EDIT - I was wrong. The pins for both are exposed, and selectable. Interesting!
 

ElChangoGuero

Well-Known Member
Joined
Jul 29, 2016
Messages
123
Reaction score
22
Looks like the magic happens on the DIP-Switch :eek: not sure what #8 is for though
Screenshot 2017-03-08 09.25.58.png
Screenshot 2017-03-06 21.32.04.png
 
OP
thekraken

thekraken

Well-Known Member
Joined
Aug 18, 2014
Messages
1,960
Reaction score
449
Location
DFW
Interesting... So when you have the Atmega328<-->ESP8266 connection what pins are connected to which?
 

Thorrak

Supporting Member
HBT Supporter
Joined
Feb 7, 2016
Messages
2,433
Reaction score
1,336
Location
New York, NY
Apparently there is an official Arduino UNO WiFi with esp8266... Shows how much I pay attention.
Yeah - it looks like that uses the official Arduino wifi stack, which means that the wifi capability won't be utilized by a standard BrewPi sketch.

That said, I'm guessing you could use my modified BrewPi stack with a firmware tweaked similarly to how I tweaked the firmware for the ESP8266 to get a working WiFi BrewPi out of this hardware. At that point though I'd just suggest using my version of the firmware - but I'm biased. Heavily.

Again - that's assuming that I'm correct in how these inter operate. It could be that the ESP on this comes with some kind of serial bridge firmware in which case all bets are off.
 

pocketmon

Well-Known Member
Joined
Oct 12, 2015
Messages
684
Reaction score
217
Yes! Thats exactly what i am trying to do, flash without modifying any of the brewpi code, hopefully it should be something like @mattrox installation (fingers crossed) ill let you guys know how it works out when it arrives ;)
I wonder what's the benefit instead of using Thorrak's solution. Please shed some light on me.
 
OP
thekraken

thekraken

Well-Known Member
Joined
Aug 18, 2014
Messages
1,960
Reaction score
449
Location
DFW
There is no porting of the original avr code so theoretically all of this will work
Currently Unsupported/Untested
Rotary Encoder Support
Door Sensor Support (Note - May work, untested)
Buzzer Support
OneWire "actuators"
 
OP
thekraken

thekraken

Well-Known Member
Joined
Aug 18, 2014
Messages
1,960
Reaction score
449
Location
DFW
Unfortunately, I can't edit the post any more so the only one of those still true is rotary encorder support.

Admittedly though - that's a big one for some people.
I assume you're talking about your original post in your thread? The thought did occur to me, just fyi I pulled that off of the github page.
 

Thorrak

Supporting Member
HBT Supporter
Joined
Feb 7, 2016
Messages
2,433
Reaction score
1,336
Location
New York, NY
I assume you're talking about your original post in your thread? The thought did occur to me, just fyi I pulled that off of the github page.
...oops. :smack:

I've been focused on Fermentrack (the replacement web interface) and need to go back through and update the controller documentation. Sorry about that, and thanks for noticing it!
 

ElChangoGuero

Well-Known Member
Joined
Jul 29, 2016
Messages
123
Reaction score
22
I wonder what's the benefit instead of using Thorrak's solution. Please shed some light on me.
what @thekraken explained but also if it didnt work i could go with a USB Fuzze approach lol! :D For $11 i didnt think it twice
 

dibbz

Active Member
Joined
Aug 26, 2014
Messages
40
Reaction score
7
I'm ditching my esp-link/brewpi setup for brewpiless now that it has data logging without a server. There is no benefit in this solution over what brewpiless offers any more that I can see.
 

ame

Well-Known Member
Joined
Oct 25, 2015
Messages
378
Reaction score
60
For $10 you could get a Pi Zero W and try that with my software.

I'm going to test this configuration in April, or May.
 

pocketmon

Well-Known Member
Joined
Oct 12, 2015
Messages
684
Reaction score
217
If you can buy a zero w for 10, go with ame's solution. If I could buy a zero for $5, I wouldn't have created brewpiless.
 

Thorrak

Supporting Member
HBT Supporter
Joined
Feb 7, 2016
Messages
2,433
Reaction score
1,336
Location
New York, NY
If you can buy a zero w for 10, go with ame's solution. If I could buy a zero for $5, I wouldn't have created brewpiless.
The irony is, with a wifi (or other non-hard wired-serial connection) you could easily run BrewPi in a free virtual machine with VirtualBox.

Of course, if it provides what you want, with BrewPiLess there's no need. :)
 
OP
thekraken

thekraken

Well-Known Member
Joined
Aug 18, 2014
Messages
1,960
Reaction score
449
Location
DFW
The irony is, with a wifi (or other non-hard wired-serial connection) you could easily run BrewPi in a free virtual machine with VirtualBox.

Of course, if it provides what you want, with BrewPiLess there's no need. :)
I was doing exactly that until the old pc's hard drive kicked the bucket.
 

ElChangoGuero

Well-Known Member
Joined
Jul 29, 2016
Messages
123
Reaction score
22
If you can buy a zero w for 10, go with ame's solution. If I could buy a zero for $5, I wouldn't have created brewpiless.
that future iSpindel integration to Brewpiless though...awesome! :rockin:
 

pocketmon

Well-Known Member
Joined
Oct 12, 2015
Messages
684
Reaction score
217
Damn straight. Looking forward to seeing how it works out!

mostly so I can steal it for Fermentrack, because I think @pocketmon is on to something.

Seriously though - it's exciting stuff!
It's almost done. The difficult things are
first, making a iSpindle. Fortunately, I will get one from a really kind friend.
second, designing a good user interface. I am sort of making-it-work-first type. It always can be refined afterward.

A friend asked me about TILT support, and I just told him to go with RPI zero W. It's simpler to support Bluetooth(BLE to be exact) on RPI. Buy a Bluetooth dongle, install the bluetooth stack, and start to get the gravity data.
Well, it is possible to support on ESP8266 by using a HM-10 BLE module. Configure it as a center device(AT+ROLE1, AT+IMME1), and read the data form iBeacon packet (AT+DISI?). However, a right version of the HM-10 is necessary, and I was forced to stop because of bricking my HM-10 module after issuing a sequence of commands. It would have been easier on RPI.
 

LBussy

A Cunning Linguist
HBT Sponsor HBT Supporter
Joined
Jan 19, 2013
Messages
2,553
Reaction score
862
Location
Kansas City
Necroposting for a teaser (gonna xpost this into the regular mega thread as well since it's part of the Master branch):
Code:
[email protected]:/home/brewpi/logs $ tail -f std*.txt
==> stderr.txt <==


==> stdout.txt <==

tail: stdout.txt: file truncated
2019-03-16 15:43:08   Opening serial port.
2019-03-16 15:43:08   Notification: Script started for beer 'My First Legacy BrewPi Run'
2019-03-16 15:43:23   Checking software version on controller.
2019-03-16 15:43:24   Found BrewPi v0.2.10 build unknown, running on an Arduino Uno with a revC shield on port socket://192.168.168.143:23
2019-03-16 15:43:25   {"BeerTemp":null,"BeerSet":null,"BeerAnn":null,"FridgeTemp":null,"FridgeSet":null,"FridgeAnn":null,"State":0}
:D

Posting here for a technical discussion if anyone is interested.
 

LBussy

A Cunning Linguist
HBT Sponsor HBT Supporter
Joined
Jan 19, 2013
Messages
2,553
Reaction score
862
Location
Kansas City
[ETA: In order to "Future-Proof" this post, I've made a version on the BrewPi Remix website which I will be able to update as needed. Please see it here.]

I wanted to be able to support BrewPi Remix over WiFi, and this thread gave me some great ideas. The script support for this has been in BrewPi Remix since 0.5.1.2 I think, it's definitely in the current 0.5.2.0 release. Here's how to pull it off:

Buy yourself one of these fancy UNO R3 (ATmega328P) + WiFi (ESP8266) cards currently priced at $6.49 ... get a couple just in case. I expect any of the others out there will work as well with some changes but you are on your own if you go a different direction:
Board.PNG
UNO+WiFi R3 ATmega328P+ESP8266 Module 32Mb Memory USB-TTL CH340G Compatible For Arduino


You might need to Google up some drivers for the CH340 chip if you are using your PC, unless you've messed with one of the Uno clones before. The "official" drivers appear to be on this page in Chinese. You can either translate or click on the very obvious download button and throw caution to the wind.

Install those drivers, and find yourself a USB micro cable because this board ditched the HUGE type "B" plug. Before you plug it in, you need to set the DIP switches to let the CH340 talk to the ESP8266.

Switch configuration to allow CH340 to connect to ESP8266 (upload sketch to the ESP8266):
  1. Off
  2. Off
  3. Off
  4. Off
  5. On
  6. On
  7. On
  8. Off (Do Not Use)
Go ahead and plug the board in to your PC to hear the pleasing "boing" showing you that it connected. Now you'll need the NodeMCU Firmware Programmer if you have not already downloaded it before. You can get it here. If you don't know whether you are on a 32 or 64-bit system, just grab the ESP8266Flasher.exe file from the Win32/Release directory.

Now you will need some firmware for the ESP8266 side. First, download "esp-link" version 2.2.3 from the releases page. I should point out that this is not the most current and right now I can't tell you WHY I used this version. I'll probably try one of the 3.x versions later on but for now, I know this works.

You will also need the esp_init_data_default.bin file from the Expressif Systems GitHub.

Go ahead and execute the NodeMCU Firmware Programmer and set up the following firmware images at the addresses indicated on the "Config" tab:
  • boot_v1.5.bin @ 0x00000
  • blank.bin @ 3FE000
  • esp_init_data_default.bin @ 0x3FC000
  • user1.bin @ 0x01000
FlasherConfig.PNG


If you are curious about the "Advanced" tab, I did not make any changes. The settings were:
  • Baudrate: 230400
  • Flash size: 4MByte
  • Flash speed: 40MHz
  • SPIO mode: DIO
On the "Operation" tab, select the proper COM port, then click "Flash".

FlasherComplete.PNG


When complete, go ahead and close, unplug, and set the switches to connect the CH340 to the ATmega328:

Switch configuration to allow the CH340 to connect to the ATmega328 (upload sketch to the ATmega328):
  1. Off
  2. Off
  3. On
  4. On
  5. Off
  6. Off
  7. Off
  8. Off (Do Not Use)
Now flash the BrewPi Remix firmware with whatever tool you like. I just plugged it into my Pi and used "sudo /home/brewpi/tools/updateFirmware.py" since it downloads the latest firmware automatically. In theory this board will allow flashing the ATmega328 over the air, I've just not tried that yet. Once you have the BrewPi firmware loaded, unplug and set the switches to connect the ESP8266 to the ATmega328.

Switch configuration to allow the ESP8266 to connect to the ATmega328 (normal operation):
  1. On
  2. On
  3. Off
  4. Off
  5. Off
  6. Off
  7. Off
  8. Off (Do Not Use)
Unplug from your Pi and power the board up separate from your PC or Pi. Now from your computer, phone, or whatever; search for the access point created by the board. It will be something like ESP_XXXXXX. Connect to it, no password needed. Open your web browser and navigate to 192.168.4.1. After a moment the esp-link page will show up.

Go to the "WiFi Station" tab, and follow along. Click the link under "WiFi State" to switch to STA+AP Mode:

State.PNG


Select your desired wireless network (if they do not show up, refresh the page) and provide the proper password. When done click the Connect! button:

Association.PNG


After it connects successfully, record the WiFi IP Address under "WiFi State." For the purposes of demonstration, we'll assume it's 192.168.168.143.

IPAddress.PNG


Now connect your PC to your normal network and connect to the board again via it's new address (192.168.168.143). Go to the µC Console tab and set the following:
Switch Baud Rate to 57600
Click the Reset µC button to commit the change.

Baud.PNG


Now press the MCU RESET button on the controller (or simply power-cycle.) If you left it on the µC Console tab, you should see json from the controller in the console window after reset is complete. Success!

Console.PNG


The last step is to configure your BrewPi instance for the controller. Assuming you are using a custom config (config.cfg), change the port to point to your board's IP address and port 23 like this:
Code:
port = socket://192.168.168.143:23
Re-start your script and you should be connected via WiFi!

One thing I came across which requires a small hardware change: If you are using one of @CadiBrewer's shields with the LCD you will notice that the LCD does not work. This is because the shield attempts to separate the power for the shift register and LCD from the rest of the board by taking it off the ICSP header. This header does not line up with the combo board. So, you must jumper 5v and ground off the header on the shield to the ICSP header on the shield and all will be well.
 
Last edited:

LBussy

A Cunning Linguist
HBT Sponsor HBT Supporter
Joined
Jan 19, 2013
Messages
2,553
Reaction score
862
Location
Kansas City
I received an email via my website from a "Rob S" but the email address given was invalid so I can;t reply. Rob, if you wan to go over what's happening here that's fine, or you can try the email again.
 

Beldin

New Member
Joined
Feb 24, 2015
Messages
4
Reaction score
0
Hey Lee

Not sure why the email got bounced sorry. I can't figure out what I'm doing wrong. I can flash the esp firmware files fine (3.0.14), I can even setup the WiFi part at the end. but the pi will not flash the hex file to the ATmega328 portion. However I noticed in the post above your using older files compared to web page (2.2.3). I tried those also but was not able to flash the esp_init_data_default.bin file from the Expressif Systems GitHub.

Any ideas would be great.
 
Last edited:

Beldin

New Member
Joined
Feb 24, 2015
Messages
4
Reaction score
0
I was able to flash 2.2.3 files. the default.bin file must have been a bad download. Still no luck with flashing brewpi-arduino-uno-revC-0_2_11.hex
 

LBussy

A Cunning Linguist
HBT Sponsor HBT Supporter
Joined
Jan 19, 2013
Messages
2,553
Reaction score
862
Location
Kansas City
I was able to flash the newer esp firmware, that's what's on my test bench right now. I updated that on my website, can't edit the above anymore.

How is it you are trying to flash the Arduino? What position are your switches in and what errror(s) are you getting?
 

Beldin

New Member
Joined
Feb 24, 2015
Messages
4
Reaction score
0
1. OFF
2. OFF
3. ON
4. ON
5. OFF
6. OFF
7. OFF
8. OFF
[email protected]:~ $ sudo /home/brewpi/utils//updateFirmware.py

Arduino program script started.

Settings will not be restored
Devices will not be restored
2019-04-23 18:24:39 Opening serial port.
Loading programming settings from board.txt
Checking hex file size with avr-size.
Program size: 27954 bytes out of max 32256
Programming Arduino with avrdude:
/usr/share/arduino/hardware/tools/avrdude -F -e -p atmega328p -c arduino -b 115200 -P /dev/ttyUSB0 -U flash:w:"brewpi-arduino-uno-revC-0_2_11.hex" -C /usr/share/arduino/hardware/tools/avrdude.conf
Result of invoking avrdude:
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00

avrdude done. Thank you.


There was an error while programming.

BrewPi script will restart automatically.


I Also tried XLoader from a windows box but it just locks the program up.
 

LBussy

A Cunning Linguist
HBT Sponsor HBT Supporter
Joined
Jan 19, 2013
Messages
2,553
Reaction score
862
Location
Kansas City
If you try this on Windows you will need to make sure you have the CH340 drivers installed. If it shows up as a COM port then you have that part handled. If you are comfortable with the Arduino IDE, you can try flashing a blank sketch or even the Blink one to see if that goes.

Basically it's a communications issue. Do you have anything else connected to the board when you try this? If you have anything connected other than the USB, it could be that you have it connected in the wrong spot and it's interfering with the upload. You mentioned in your email that you have multiple boards, did you try one of the other ones?

You'll also want to make sure nothing else is trying to communicate out that port while you flash. Make sure BrewPi is stopped and the do_not_run_brewpi file is being created in your /var/www/html directory, or you issue the command 'sudo systemctl stop brewpi'.

I'm assuming a single chamber here. If you have a multi-chamber then some of the above will need to be modified.
 

Beldin

New Member
Joined
Feb 24, 2015
Messages
4
Reaction score
0
Morning Lee
CH340 is installed and was working according to the NodeMCU Firmware Programmer. I agree its a communications thing, before i gave up last nite, I did try to flash using the Arduino IDE. It failed but I don't remember the exact message. I have a feeling its something really silly I'm doing wrong, but because i have so little time to play with this I'm always rushing.

I found this page in my searches. https://www.instructables.com/id/How-to-fix-bad-Chinese-Arduino-clones/
"In some cases the board might still not work. This is because there is no bootloader installed on the Atmel microcontroller chip."
What do you think


Funny thing i noticed when using NodeMCU Firmware Programmer, 2 of the three boards have the same MAC address.
 

LBussy

A Cunning Linguist
HBT Sponsor HBT Supporter
Joined
Jan 19, 2013
Messages
2,553
Reaction score
862
Location
Kansas City
Have you tried your other boards as well? I bought several and had no issues. You never know of course.

I was under the impression that no boot loader would cause the script to fail to detect the board but I may be wrong on that. Never came across one to test it.

Do you have the ability to flash the boot loader?
 
Top