# pi based braumesiter wifi module



## RogueRanga (9/5/19)

I have been trying to figure out how to make a raspberry pi based wifi module for the BM. so far I have figured out the pinout for the UART port on the BM and I can connect a PC to the BM. When I connect the BM to the PC the lights turn green ready for the firmware to be uploaded. I dont have a wifi module handy to fix it if I brick it with my cable so I have not tried to flash new firmware yet. A few beers one night might change that...

The next step is to figure out how to get past the "wifi modul not present" message on the BM when I try to enable the wifi module. I have used a Bus Pirate to as a logic analyser but it does not output anything. I tried to reverse engineer the firmware but it looks like its encrypted. I looked at the strings in the firmware and it looks like the wifi module talks to the BM with AT commands. i have done some reading and the wifi module is a wifi to serial server. Something like a rs 9110:
http://www.redpinesignals.com/Produ...9110_Modules/Connect-io-n/RS-9110-N-11-24.php

I'm pretty sure there is some negotiation that happens when the wifi unit is plugged into the BM (baud rate etc) but I cant figure that pert out yet.

Does anyone have some pictures of the insides of the wifi unit? I would like to know what wifi to serial device speidel is using exactly so I can try to get a pi to do the same thing. any pics or input would be appreciated


----------



## mojonojo (17/5/19)

Some people have already done some work on this - https://forum.braumeisters.net/viewtopic.php?f=11&t=1418&start=30


----------



## RogueRanga (17/5/19)

mojonojo said:


> Some people have already done some work on this - https://forum.braumeisters.net/viewtopic.php?f=11&t=1418&start=30


Yeah someone has made a web front end for the wifi module but no one has tried to reverse engineer the wifi module or the protocol. 

My guess is that when the module is plugged in and powers on, it sends a connect packet to the BM. The hard part is working out what that is without a wifi module.

I've done some more digging and discovered that the other 8 headers in the middle of the board are JTAG. Atmel use a proprietary JTAG so I would need a dragon or atmel-ice to debug it (which I don't have)


----------



## RogueRanga (22/7/19)

So just an update to anyone interested. I was pretty much spot on with the guess of the wifi module being a RS-9110 from redpine signals. I have been able to figure out the pinout of the connector and successfully connect to the BM and assign it an ip address with a python script. The next task is to send it some recipes and key press requests.


----------



## f00b4r (22/7/19)

RogueRanga said:


> So just an update to anyone interested. I was pretty much spot on with the guess of the wifi module being a RS-9110 from redpine signals. I have been able to figure out the pinout of the connector and successfully connect to the BM and assign it an ip address with a python script. The next task is to send it some recipes and key press requests.



Just be aware that they changed things significantly in the last firmware update so if you get it all working then update you may find some of it then not working again.
Fantastic work though!


----------



## RogueRanga (22/7/19)

f00b4r said:


> Just be aware that they changed things significantly in the last firmware update so if you get it all working then update you may find some of it then not working again.
> Fantastic work though!



ah ok. i just updated it from 1.1.25 to 1.1.27 and it now has a register feature. is 1.1.27 what you are referring to?


----------



## f00b4r (22/7/19)

Yes. You need to have a MySpeidel account and to register the same email on the BM after updating.
Great to see it is working though.


----------



## f00b4r (26/7/19)

How is this working out?


----------



## RogueRanga (26/7/19)

Yeah still working on it. The wifi controller acts kind of like a server to the BM. I am able to reply to BM requests easily enough but it's proving difficult to send unsolicited requests to the BM ( like when you send a http request to the BM to press a button on it)


----------



## f00b4r (26/7/19)

I wonder if the previous firmware would be easier to start with, I am sure someone on the BM forum was sent a copy by Speidel when they insisted they wanted to revert.


----------



## RogueRanga (26/7/19)

Yeah tbh I'm not sure if it matters that much. I was on 1.1.25 and I tried to send a button press to it via http, but I could not get a response from the BM. Now on 1.1.27 when I press the register button, the BM sends a http request to the rpi should be passed on to the speidel site. It is passed on and the rpi gets a 200OK from speidel. It sends the 200OK to the BM via http, but again no response. Im think that I'm not encoding the http request/response to the BM properly or not including some headers or something. I'm making progress but it's lots of trial and error

I did actually extract the 1.1.25 firmware from the BM with avrosp.exe before upgrading so I might try to put it back on. At least with 1.1.25 it's 1 less step that I have to go through to get it working.


----------



## f00b4r (26/7/19)

I'm sure someone had created software (python?) that allowed you to control a WiFi BM, at least for software prior to the 1.1.27. It might be worth having a search to save you some time. I will try and find the links but am away from home at the moment so just on my phone.


----------



## RogueRanga (26/7/19)

Yeah I have seen that. I can't justify $200 for a wifi module so I'm trying to get a pi to replace the whole thing. Which a bit different the what's available now


----------



## f00b4r (26/7/19)

RogueRanga said:


> Yeah I have seen that. I can't justify $200 for a wifi module so I'm trying to get a pi to replace the whole thing. Which a bit different the what's available now



I just meant the software might help you with your clone as I'm sure someone figured out the control methods, at least prior to 1.1.27.


----------



## RogueRanga (26/7/19)

Ah ok. Yeah I might I'll re visit that software and see if it will help


----------



## RogueRanga (30/7/19)

ahh finally got the BM to reply to http requests from the rpi! ill work on a web interface for it now.


----------



## f00b4r (30/7/19)

RogueRanga said:


> ahh finally got the BM to reply to http requests from the rpi! ill work on a web interface for it now.



Which firmware version? Great work by the way, one of the most interesting things coming out on the BM side for a while.


----------



## RogueRanga (30/7/19)

f00b4r said:


> Which firmware version? Great work by the way, one of the most interesting things coming out on the BM side for a while.


Using 1.1.26 right now, so not with the registration part. Although I don't think it would be too hard to get it working with 1.1.27. When its on 1.1.27, the BM sends a DNS lookup for speidel.com (which I just return 127.0.0.1), then it does a http post to 127.0.0.1 with the email address. I should be able to just return a 200 OK to the POST to keep it happy.

Does 1.1.27 actually give you any more features? If so I could work on that firmware to start with.


----------



## f00b4r (30/7/19)

I think for most users it would be preferable to work on the 1.1.27 firmware, the release notes are below:


- Client function for the Braumeister to connect the Braumeister from everywhere via MySpeidel
- hop additions in X min, bugfixes. Includes also the serial veresion 1.1.25/ 1.1.26 and an optional update for the wifi-module 4.8.5 (if the wifi is on 4.8.4, then update this first - version visible on the wifi settings, update starts automatically after removing the updatecable and connecting to the electricity, afterwards install the firmware for the Braumeister).

There are seemingly a few that are unhappy with the new client function that 1.1.27 bought but it is now required for using the cloud functionality and connecting to the BM from anywhere, unless using the third party synch script.


----------



## jmls (22/8/19)

really curious to know where you are with this project .. any docs, cable howtos etc ? I write software for a living, so would be interested in helping write a ui for this ...


----------



## RogueRanga (2/9/19)

I have been pretty busy with work lately so I haven't had much time to work on this. I work in IT but not in development so it's slow going making this thing. I'll try to get something uploaded to github soon


----------



## RogueRanga (11/9/19)

jmls said:


> really curious to know where you are with this project .. any docs, cable howtos etc ? I write software for a living, so would be interested in helping write a ui for this ...


I'm currently writing the UI in flask. Would you recommend that or something else.


----------



## RogueRanga (3/10/19)

I have not been able to do much on this still. I have a repo on github which is a work in progress. The aim is to get a web interface on the rpi so it easy to upgrade the firmware, but that's a while away (really busy with work). There is info on how to make a cable so at least you can make one up and upgrade your firmware.

https://github.com/roguenorman/bmpi

There is a parts list for the cable. Just get the USB to serial adaptor and the 712 connector and the picture should help to get the pinout correct. let me know if it does not make sense..


----------



## f00b4r (3/10/19)

That’s awesome work. Hopefully you may get some developers interested to help with some pull requests.


----------



## vegard.vesterheim (19/1/22)

This is very interesting. I have created a pair of series-cables (one for RPi GPIO pins, and another with USB plug) using the instructions posted above by RogueRanga. Both cables are working fine for communicating with the Speidel with either a RPi or a Debian PC using the software at GitHub - roguenorman/bmpi. I had a few issues with the code as-is, so I forked it and created a branch at GitHub - vv3/bmpi at getting_it_working with some improvements. I still find the performance related to serial port handling in Python to be somewhat sluggish, but it is working. My first goal is to stated in this issue: Compatibility with wireless module (bm.tx, rz.txt etc). IMHO there is no need to create a totally new GUI, the existing GUI code from Speidel works mostly fine (just needs a few bugfixes), and it can also be served locally, even without a webserver. This is just HTML and Javascript, and can be loaded from your local filesystem. Now that the basics are in place, this should be fairly easy to replicate the simple HTTP functionality provided by the Wifi module.

I already have a Wifi module, but I find it interesting to be able to communicate with the speidel also without Wifi.

BTW, I have also created a solution for managing recipes on the Speidel.


----------



## vegard.vesterheim (20/1/22)

I have now implemented the functionality which emulates the simple HTTP-mechanisms provided by the Wifi module.


----------

