SuperHouse #30: Reflash ANY Sonoff, even if you don't know the pinout

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey I'm Jonathan Aqsa and this is super house now if you're into DIY home automation you've almost certainly come across the sign off it's a little Wi-Fi enabled power control device you simply splice it in line with the power to something and then you can control it the sign-off comes with software called a we link the firmware that comes on the device itself is designed to talk to the ear we link app which you can run on your phone that's really good for basic things but to really unlock the power of this device it's best if you can put your own software on it that gives you total control you can add new features you can link it into your own home automation system and you don't need to have it connect out to the Internet in order to control it now they're a whole lot of different sign-off models this is the sign of basic which is the most common one it's just Wi-Fi control of a single channel I've got a whole collection of them here there's the th 10 and the th 16 which have the temperature and humidity sensor inputs there's a four channel Pro which is a dinner rail mounted relay normally goes inside a switchboard it gives you four outputs there is thus on/off power which measures power consumption so not only can you control devices but you can see how much power they're using I also have here the slam phone which is a sawn-off in a strange form factor you unscrew a light globe screw this in its place put the light globe back in and now you've got Wi-Fi control of a light globe that wasn't set up for it previously and I've got the little touch controls use these to replace the light switches on your wall and then you've got control from your home automation system but the thing is that replacing the software on these can be a little bit tricky you need to find the connections inside so you've got to open them up find where the headers are make the appropriate connections and load the software what I'm going to do is take you through each one of these models open them up show you where the headers are and exactly what you need to do to reflash the software for each model now in some situations you can update this on/off using over the air or OTA updates that means that you send the new software to it over the Wi-Fi connection and you don't need to make any electrical connections to the board itself however that only works in certain circumstances the best way to get your own software onto it the first time at least is to connect directly onto the PCB and use a serial upload but first a word about safety this on/off is a mains powered device it will have lethal voltages connected to it while you have it linked to any device that you are normally controlling never ever plug connections into it and try to reprogram it while it is powered from the mains always make sure it's disconnected and only powered from the connections that I'll show you in a moment before you try reflashing in all currents on-off models use either the expressive esp8266 microcontroller or the esp8266 six and eight two eight five used the same core they can be programmed in the same way they can be put into a special bootloader mode where they'll accept a new program over a serial connection the esp8266 has three pins that are designated as strapping pins it checks the state of these pins when it first powers up and that controls what mode it goes into in just about every esp8266 base design you'll see something like this typically GPIO 15 is pulled down to zero volts GPIO two is pulled up to 3.3 volts and GPIO zero is also pulled up to 3.3 volts the one we care about now is GPIO zero because if that is pulled low it will force the esp8266 to go into bootloader mode so many designs include something like a button that will pull it down to zero volts then all you have to do is hold the button in while the system is powering up and it will go into bootloader mode once it's in bootloader mode it will be ready to listen on the TX and rx pins for communications with some serial length which will upload a new program to it so by connecting to TX and rx and by forcing GPIO 0 low in the sawn-off we can force it to go into bootloader mode and load new software into it the really cool thing is now you know how to put the esp8266 into later mode it doesn't matter what model of sawn-off you're trying to do this to in fact IT could release a new model of sanal five minutes after I upload this video and it doesn't matter as long as it's got the esp8266 processor and you can find ground TX Rx and the GPIO 0 pin in order to put it into bootloader mode you can reflash it if you want to write your own firmware to run on this on/off that's great but there are plenty of ready-to-go options that has motor firmware by thea Arends is legendary it's got lots of features it allows over there updates this is the one I personally use Esper all we know is another option and es Poorna both of these are good alternatives to e we link and let you control it from another home automation system there's also pete's goggles ESP MQTT code which he uses in his extensive home automation system so that's definitely worth a look and note MCU which allows you to write whatever you like using node however this video is not really about the software so whatever you need to do to set up your software environment you need to follow the instructions for the appropriate firmware first model we'll look at is this off basic a lot of people have got this they're really really common so we'll just treat this one as if we don't know anything about it and we want to try to figure out where the connections are start by pulling it apart this is a brand new one straight out of the box sometimes they've got a warranty sticker across here this one doesn't and I don't know why it's very easy to get apart just use your fingernail or a screwdriver or something shove it in here around the edge of the case and it all just clips apart and this is the bit that we care about so here we have the input on the left output on the right and there's the power supply which runs the circuitry on this on/off itself and then if we turn it over that is the esp8266 chip which is the one that provides Wi-Fi and it's the brains of the unit you can see the trace antenna on here as well so what we wanted to do is figure out how to get new firmware onto that chip now this is already well documented on the soft basic legislation let's imagine that we'd opened this for the very first time and we've never actually seen this board before how would we figure out how to get software onto that chip well we know what the pinout is on the microcontroller itself so we can start by tracing connections out from the MCU so if we chuck it under the microscope we can find out where they go so with the Somnath under their microscope we can see here the esp8266 chip and you can also see here a little dot that's pin one just over here so that indicates the orientation of the microcontroller the pin numbering starts from here it goes down 1 2 8 9 to 16 17 to 24 25 to 32 now from the esp8266 datasheet we know that pin 25 and pin 26 are Rx and TX so 25 is right here that is pin 25 which is the RX pin next to it is TX so if we trace here we can see that the RX pin comes down to this big pad the TX pin comes to this big pad so that means that the this connector that you can see well there is a row of five holes in the PCB one of them is TX and one of them is rx so let's dig a little bit further now just down here you can also see this one has got connections through to this polygon that's a giveaway that this is probably the ground connection so so far we've got ground we've got TX and rx and we don't know what this one is and also we need to find GPIO zero in order to be able to put this into bootloader mode because we need to pull GPIO zero low while it's booting in order to put it into the right mode now GPIO zero is on pin 15 which is this one right here if we follow along that trace we can see it comes along to hear there's a 1k resistor there it also comes through here it runs up to there and then to Avaya so it duck through to the other side of the PCB so if we turn the board over we can see that it comes through right here comes across and then ducks back down again so we'll turn it back over here and we see that that via comes up here and then there's this little trace it goes along the PCB ducks back down into another via this is a bit of a detective job so we know we're just near that hole there so if I turn that over and that hole is on the bottom of a part that's not placed but this right here is the vial where it comes up it goes to a pad that's not populated go through as your own resistor back up to here and down to yet another via so let's drop back down under the board yet again taking a long circuitous path and then from here the trace comes along and all the way down to the bottom part of the board right down here and you can see it's right down near this other 1k resistor and it connects through to yet another vial so if we turn the board over let's see where that buyer goes it comes to here and it's connected to this switch by this little push button now this is the push button that you use to put this on off into like programming mode or that you press to turn it on and off and then you see the other side of the switch is connected to the ground plane that means that the button on the Sun off when you press it will pull GPIO 0 down to ground now that is exactly what we want to put it into programming mode and now what we still need to find is the 3.3 volts supply because we need to be able to power up this esp8266 but we don't know where it's getting its power from now we can trace out a couple of things but let's just have a look around the board we don't have to look very far until we find this thing right here and it says triple 1 73.3 that's a bit of a giveaway I happen to know that a triple 1:7 is probably something like an LM triple one seven which is a 3.3 volt linear regulator and the big pad on that is the 3.3 volt output so if you can find the voltage regulator that's on the board then you can probably find the supply to the esp8266 so I've got my multimeter here and I've got it set in continuity test mode so you might be able to hear that beep being picked up through the microphone so we can just look around now and see some where I hand you that we can pick up 3.3 volts now of course we could just sold a straight-on here somewhere but it's probably somewhere more convenient and we can see that this is the 3.3 volt output and this test point one here tp1 is 3.3 volts you know we also know that pin 1 on the esp8266 which is right here is 3.3 volts so just to verify I'm going to put the contact on there from the multimeter and I'll touch up here on test point 1 and you can probably hear that the multimeter is telling us we've got continuity so the 3.3 volt supply to the esp8266 is definitely available here now a little bit of poking around and very suspiciously of course we think that we probably have the connection on here so we know that this is the ground connection it's not that one this is the Rx and TX pins so let's go from the test point and check this one no no we don't have any connection there and this is the other one and you can hear that that is connected to 3.3 volts so that means that now we have the 3.3 volt connection as well on the on that little header so I think we're pretty well set we now know that ground is coming in here we can tell that just by observing the connection to the polygons we know that TX and rx come in here we can tell that by tracing the connections through to the esp8266 we know that 3.3 volts is here and we know that GPIO zero is connected to this button so if we push that down during powerup it'll go into bootloader mode if you're curious there's an extra pin at the top as GPIO 14 but we don't actually care about that right now and now knowing absolutely nothing about the sawn-off until we opened it right now we've traced through and found all of the connections that we need to put it into bootloader mode and upload new software to it so if you get a new sign off model that you've never seen before you can follow this same principle you can trace out the connections from the esp8266 figure out where they go make yourself a little diagram of where the connections need to be to connect to the Sun off when it's something like an FTDI cable or something compatible it's got a serial connection on one side and USB connection on the other the FTDI serial header is a bit of a de-facto standard in the hardware community it provides a 6 pin connector with RTS rx T X via CTS and ground connections many boards have this exact header on them to match up to FTDI type adapters and the many clones that are available the sawn-off also has a serial header yep that it's only got ground rx TX and 3.3 volts so what we need to do is match up the connections between these two headers connecting ground is easy we just need a single ground reference between the two and then we need to supply 3.3 volts to this on/off that means we have to use an FTDI adapter that will provide 3.3 volts on its power output not 5 volts next we connect the TX line from the usb-to-serial adapter to the RX line on the sawn-off this is something that trips many people up you have to remember that you are swapping the TX and rx lines because transmit from one side is receive on the other likewise we take the RX line from the USB side on the FTDI header and connect it to TX on the sawn-off we can also optionally put a switch in line with the power connection this allows us to power cycle the song off so this little adapter that you can see here is what allows us to connect the FTDI serial header to the sana off serial header and then load new software onto it by following that diagram I just showed you you can make up a cable like this one I've just used a six pin header on one end four pin header on the other some ribbon cable and a switch this is essentially the same thing as we've just looked at as a diagram then if you've got an FTDI compatible adapter something that will run at 3.3 volts not 5 volts you can just plug that in and you're ready to go however I'm going to use this little board this was designed by my friend Luke Weston the nice thing about it is that it has a switch that lets you select either 5 volt or 3.3 volt mode by putting it into 3.3 volt mode it will only supply 3.3 volts out the power line and the logic lines will only be at 3.3 volts as well so what we can do is pair these up and then we're ready to connect up to s on off just plug in USB but because I've had so many people ask me to make these cables for them I've ended up designing a PCB that does the same thing this PCB is logically the same as that cable it's got the six pin connector on one end four pin serial connector on the other and I've got a little jumper on here so that you can isolate power if you want to so all you need to do is use an FTDI compatible USB to serial converter plug this in and now you've got a header that is compatible with this on off now as we've already seen all the connections were need for the sawn-off basic are right here on the little header and just for convenience what I'd like to do is get a 1 by 4 female header and solder it in place the sawn-off doesn't normally have anything in there at the factory they they probably just use pogo pins or something but what we can do is get a 1 by 4 header I'm gonna jam it in there with a bit of blue TAC just to hold it in place and then solder it in so let's come over here and solder these connections in place this will give us the 3.3 volt tx/rx and the ground connection that we need and GPIO 0 is on the button so now we can plug straight into there and with the our little adapter this is the USB to serial adapter with the converter on it all we have to do is plug in and as you can see there this has powered up the sawn-off through the the serial connection and if we put it into programming mode we can now upload to it so to put it into programming mode you need to have GPIO 0 held low during powerup and we can do that either by taking off this little jumper that isolates the power connection and then you've pressed down the button and hold it put the jumper back on let go and now this on/off is in programming mode so we could upload tez motor or whatever other firmware you want to the I put this on here just for convenience sake an isolate power but practically what I find myself doing most of the time is I just leave that in place and all I do is unplug it so what you can do is just press down the button plug in the programming adapter let go and you're done so that is now ready to accept an upload and that's how easy it is for the sawn-off basic now this off pal the th10 and the th 16 physically they all look like pretty much the same thing they're in the same case and the PCBs have got a very similar layout so they have the connections in the same place so what we're going to do is just look at one of them and use that as an example the same thing works on all of them now to open up any of these I've got a sawn-off pal here brand-new straight out of the box and we need a screwdriver with this one you can't just clip it apart like you can with the this on/off basic gotta get that cover off you can clip the main body apart but then as we'll see in a second the PCB itself is screwed inside the case unlike with the basic wear is just clipped in it's held in by the case itself so we have to undo these four screws in order to get to the bottom of the PCB you can actually see the connections even without doing this just down here you can see that there is it's got a label it says VDD and up here it says ground and the two in the middle are actually TX and rx so this one has an almost identical layout to this on off basic the difference is that on the song of basic it's got a fifth hole just up here which is GPIO 14 but otherwise this is the same as the bottom four holes on the son of basic so if we get one of our 1 by 4 hitters solder it in place here then we can use the exact same adapter the little thing I showed you earlier we can just plug this in and reprogram it so I'll just solder this connector on find myself a bit of handy blue tack once again very good for holding things in place so that you can solder them and not have them fall out while you're working on them and that's all there is to it and just like on the basic the Sun of power you has GPIO zero connected to the button this is the mode button that you can access from outside the case so if we hold this button in and then we connect in with that USB to serial adapter and either the little cable that I showed you how to make or one of these boards like over the button it'll be in programming mode and now I'll just quickly show you the inside of these just so you can see how similar they are so there's the song of power with the new connector this is the th10 I had already soldered a connector on there and this is a th 16 which hasn't been modified so if I was going to reflash this I would probably total one of these in now one of the things that you you might choose to do is not put one of these connectors in place if you make up an adapter cable like this you can just use these pins directly so we could insert these into the holes on the PCB and then just by applying a little bit of sideways force it doesn't need to be very much at all you'll see it flops around there but if we just push it gently and hold it we can then use the programmer and reflash it that way you can reflash it without even having to solder the connector in place personally though I like putting these connectors in because it means that you can just plug this in and you know it's got good electrical connection all the sonic models we've looked at so far have been pretty straightforward quite easy to deal with let's look at something a bit more exotic this is the 4 channel probe it's not designed to be mounted standalone or you can do that using these screw terminals it's designed to be mounted inside a switchboard which is why it's got there's din rail mount and it's got four outputs instead of one so your supply power in here and then you've got four switched outputs so we've got four buttons to turn the outputs on and off individually so that's all pretty straightforward if you're going to use it in its normal setup setup but we want to replace the firmware so start by unscrewing this to get inside and then we'll see that things are not quite the same as your typical sign-off bottles not quite enough there we go get the cover off so we can see here at the four relays that are used for the outputs status LEDs the buttons for attending outputs on and off and the connections but when you look at the circuitry you see that it's a little bit odd firstly where is the esp8266 well there isn't one there is actually an ESP a two and it's on this module right here so if we jump across to the microscope check it under there see if I can get a bit of focus happening something like that okay so this is the module which contains the ESP a 285 and it sits on top of the main PCB you see it's got this little castellated edges on it so it's soldered down basically as if it's like a an IC but it's a little sub circuit board with the ESP a 285 on it you can buy this module yourself from IT they sell it as a development module so you can build into your own products and if I lift this a little bit of sticker just here normally there is a socket on here so that you can plug in an external antenna because there is no antenna on this module but what they've done on this product is they've put a trace antenna on to the main carrier PCB and then that's connected down through one of these connections I assume it's this one right here so that the module itself uses the carrier PCB for its antenna and just across from here well what do you know we've got a little five way connector again and once again it's gotten ground TX Rx and 3.3 volts it also has SDA up here now on the song off basic it had a five pin connector but it was actually if you had it oriented the normal way it was up the other way so if you're used to looking at a sawn-off basic it would be a five-way connector but the GPIO connection on the basic is up here GPIO 14 and this bottom one isn't here so what we're looking at here is the equivalent of the bottom four pins on that connector on the side off basic so if we grab one of our four-way little headers and you solder this in here once again now if I slide this back over to the other camera so that we've got a better overview what this does is provide us a place that we can plug into it so of course I've got to do the standard thing grab the trusty BlueTEC heat up the soldering line and we'll be able to solder this header in place but don't jump ahead too quickly because there is a trap as I said before this is upside down compared to what you might be expecting to see on the Sun off basic with this on-off basic you have the ground at the top 3.3 volts at the bottom so if you grab the little adapter cable or adapter board like this and you plug it in this way it'll be reversed polarity you'll have ground and 3.3 volts connected which is really bad so it needs to go in this way instead essentially it's going in upside-down so for now I'm just going to solder this connection in place it's a bit backwards from where I'm sitting so it's quite hard for me to see this the bench setup is not really all that convenient when you're trying to orient things for a camera and not for human use so now we have that header we're 3.3 volts at the top and on the little breakout that I've made you can check whether you've got the orientation correct anyway because on the silkscreen I've got ground R X DX and 3.3 volts now remember also that Rx and TX are from the point of view of the device so our X from this modules point of view going in this way is actually TX coming out of the Sun off so if we turn this son off for Channel Pro upside down ground and ground match up 3.3 volt and 3 volt match up and TX from the Sun off goes to Oryx on the module Eric's from this one off goes to ticks on the module so we've plug it in that way and we could use the USB to serial adapter and everything is good disconnect power and put it our it up and put it into boot loading mode but okay now we've got a complication we need to pull GPIO 0 low on this and this is where one of the other interesting things about this design comes in now the ESP artistic six and eight five which are essentially the same thing have very very limited i/o one of the difficulties that I Ted faced when they are designing this board is they needed enough outputs they needed status LEDs they needed the input buttons and they just weren't enough IO pins on the eight 266 so what they did was drop another process onto the board it's this one right here let's check this one under the microscope it is that little processor now if I adjust the lighting I've set to get the lighting right for the the microscope you can just make out that it says stm32 it's an F 0 3 is 0 something something and that is a little stm32 microcontroller and what they're doing is using this as an i/o expander so if we come back across to here the the main brains of the system is the ESP 8 mm here and that's what we can reprogram through our little header and the stm32 is being used to interface with the different devices so the 8 - 8 - 8 5 sorry sends commands to the stm32 and that then does what it needs to do so that's a really handy little design trick if you want to use the 8 - 6 6 or the 82 85 for Wi-Fi and general control of your project but do you run into our limitations you can slave a second little microcontroller there and use that to control whatever you need to but now we need to put this into bootloader mode which means pulling GPIO 0 low now on this version this is the the 4 channel Pro there is also a 4 channel Pro r2 which is slightly different but I don't have one of those the on this one GPIO 0 is on the top of this little module and it's the second pin from the right so once again we'll chuck it back under the microscope and these little bit of solder as a pointer so this is from the bottom of the PCB you can see the module there that pin right there is GPIO 0 so that is the one that we need to pull low but how do we connect to it there is nothing else nearby well this is where you need to get a little bit creative so what I'm going to do firstly is I'm just going to touch that with the soldering iron to put a little bit of extra solder into there so nice bit of fresh solder into that joint without bridging it across to anything else and that will make it easier to get a little bit of wire and solder that in place so what I'm going to do is find myself an old jumper wire what have I got I've got a little orange one up here this will do and some cutters so I'm going to take this little jumper wire cut it in half and strip back a little bit of the end so that I can then tin it so I just get a bit of solder onto there trim it back so it's nice and short back under the microscope and here you can see once again our little module so I'm now going to Saul to the end of this wire onto that pad right there let's get the brightness up a little bit so we can see what's going on here we go so I'll just keep it buttered up against the pad get the soldering iron in there and reflow it so now we have this jumper wire connected to GPIO 0 now we need to pull it to ground and if we look around the board we can find some other headers around the place now just across from the D stm32 you can see a couple of four-way headers here now this one is actually the programming header for the stm32 so he can reflash that as well if you want to but we don't need to for our purposes but we can easily find a nice convenient ground connection here and it's even labelled for us so what we can do is in order to put this into programming mode first up we use our USB serial adapter and get that ready then we take this jumper put it into the ground connection right there just make sure it's got a good or connection we plug in our cable I got to do it around this way that's right and if it's then powered up from this little USB to serial adapter which I can do right now if I grab one from here I've got to remember to put it in the right way don't put it in this way which is the way that feels natural because you'll have the polarity reversed it goes in this way to match ground to ground and then that is now in programming mode so after a couple of seconds we pull out the jumper make sure it doesn't touch anything and right now this four channel pro is in programming mode ready to accept uploads and it's as easy as that now once you have finished doing your programming you will probably want to remove this lead because you don't want this lying around inside the box ready to show it against anything so what we'll do is just chuck it back under the microscope and I will take that lead off it's gone and then once you have alternative firmware on here if you've uploaded something that allows over-the-air updates you can then do updates whenever you want it you don't need to re solder that connection every time you want it to an update because all you do is connect to it over the Wi-Fi sender the update and it'll load it and then reboot and ready to go now if you have a four-channel Pro r2 you do a very similar thing it's just that the the GPIO zero point is brought out to a nice little test point and also VR 2 doesn't have this module it has the process is sitting directly on the mainboard they integrated it for that revision but the the test point just makes it an easy place to solder on to instead of having to solder onto the little castellated edge there so if you want the the details for that I don't have it in the video but make sure you look at the link in the video description which takes you to the page on the super house site and there I'll have photos diagrams and pin outs and everything for showing how this works on all the models that I'm showing in this video so far we've looked at pretty conventional models but let's get right out there this is a slam phone which is the the thing you stick in line with a light globe screw it into a normal socket and it gives you Wi-Fi control of your lights now with this one I've got to go straight for the screw driver to get it apart it's got a couple of screws on the back here so just pull those out and see what we can find inside this is quite different to the normal form factor of of a typical Sun off but electrically it should be pretty much the same it's got a funky around PCB apart from that this is really just like a sawn-off basic well it's on/off IRF it's got this module in here then one thing that's a little bit strange about this one is that this is an early prototype if you look on the PCB just down here you can see it's version 0.2 slamfire and i teed were nice enough to send me this when they were first prototyping them and I think they're currently up to version 2.0 is the current release but nevertheless electrically they haven't really changed and if you turn the board over what you can see just over here is a little 4-way hitter and amazingly it's in the same format as all the 4-way headers we've seen before in this particular one I've already soldered one in here I've sold it a little socket in there normally it's just a row of four plated hole so you can solder in the header if you've got it you've got one of these or just leave it and put the pins through the holes so on this particular one there are no markings on the silkscreen so you can't actually tell which end is ground but a little bit of checking with the continuity tester and it's pretty easy to tell that this end is ground this one up here and the other end is 3.3 volts so to connect our little adapter if we wanted to connect this up we've got ground at this end 3.3 volts down here so the orientation is basically like this the marking on this end the header aligns with 3.3 volts and if we plug that in we can power it up and communicate with the processor but there's a bit of a problem one thing that is different about the circuit for this one is that the button on this is not connected to GPIO zero and as we've seen already we need to get to GPIO zero in order to pull it down low and put the sign-off into bootloader mode now if we turn the ESP out you see six I'll turn the board over so I can see the esp8266 which is right here let's see what we can find check it under the microscope so you can get some focus there is the esp8266 right there and if we look up in the top left corner you can see there's a dot on the case of the microcontroller that signifies that this is pin one right here now we know that GPIO zero is on pin 15 counting down this way and then across the bottom it is the pin that is second from the right just there then we can see that there is a trace that comes out and it comes to this resistor says 102 which means that's a 1k resistor it comes the other end the resistor comes to here at this end of the capacitor this is 3.3 volts so that is a pull-up resistor on GPIO 0 so we need to be able to pull that low in order to put this into bootloader mode so let's start by grabbing the soldering iron and we'll just freshen up the solder on that joint so that we can make a connection to it and I've got this little jumper wire right here so I've solder this onto the end it's a little bit tricky because I can't really see anything much while I'm using the camera but if I am ah moving all over the place okay so try to align it there solder it on and now we have a jumper which we can use for bridging to ground and put it into bootloader mode all right so in order to do that what I need to do is find some ground elsewhere on the board and there are a couple of test pads there's even a test pair that's marked ground on this particular version so just over here see it's got G and D and there's a little test point right there and that would be a convenient place to put it down and there's also this big solder pad right here just there so I think that's probably a convenient place to connect you just need to find somewhere that there's ground on the board so what we can do now is grab our little USB to serial converter with the adapter on it and it's all powered up no I'll get it ready so that it's aligned and these two go in this way I'll just hold it over here this is all a bit tricky what you could do is solder another jumper on to ground and put a switch on or something if you like but now if I find that ground connection which is just there hold it against it and then while I'm holding it I slide in the USB to serial adapter and then let go of it and we now have the slammer running in bootloader mode so now we can use this to load whatever firmware we like onto it it's a little bit of fiddling around for this particular model just because of the lack of easy access to GPIO 0 but not too bad and once we've done it the first time you can do over-the-air updates so you only have to go through this once and then once you're done the first time just use the soldering iron to remove that I think I'll do that right now I'll unplug the adapter check this back under the microscope and just heat that joint take off the jumper and it's all back out again you know to put this back together you need to make sure that this long stock button goes through the hole in the case so just rotate the PCB to align the button with that hole and then the back goes on now it's actually easy to put this on in slightly the wrong place and then have trouble with the screws I've made this mistake a couple of times and wondered what was going on these little screw holes don't align with this pair of holes they align with this pair of holes so what you do is you just put the back cover on so that it's aligned with the small holes put the screws in screw it back together and then you're all done then you've got your own firmware running on it and you can do over there updates from that point on and they offer the b1 this one's even more unusual than the slam fuh this is the the like globe with all of the control built into it so it's intended to be sort of equivalent to something like a Phillips hue or a life exclave and when you first get it open go out at the box you might wonder how do you even open it and you have to do something that makes you feel like you're going to break it but it's okay now if you do break it don't blame me but basically what you have to do is unclip this cover right here now there are no screws there is no way to get into this so all you do is you firmly grasp it and you're sort of jiggle on twist and pull and the cover just clips off and that's all there is to it it's really the cept if you might think that it you can't get this open but it turns out you can now there are a few very interesting things about this because this has the lamp integrated into it there is a really big issue with heat and you see this with all intelligent line of clothes and in fact all LED globes what they need to do is try to make the globe run as cool as possible the PCB in this is a an aluminium based PCB so normal circuit boards are made by sandwiching copper on either side of a piece of fiberglass the fiberglass acts as the mechanical base and it insulates the two sides in the case of this PCB it's actually a slab of aluminium and then there are layers on top of that and that provides a really good conductive path so that heat can then pass very easily through it so instead of just having a PCB with heat sinks attached to components on the PCB the entire PCB becomes a heatsink so that's quite interesting and you can see on here that what they've done is used a variety of LEDs in order to be able to do reproduce different colors and still have bright white you can see that there are pairs of LEDs here and without knowing the details my guess is that these are probably pairs of warm white and cool white LEDs and then these ones in the middle here are add RGB LEDs and the idea is that what you can do is produce a fairly high level of illumination just with the white LEDs and then you can use the RGB LEDs to change it to different colors so overall it's quite an interesting little device now this one does not provide the the nice simple 4 penny connection so we need to figure out how we're actually going to connect to this now there are some test pads along here and let's put that under the microscope and see what we can work out from there I'll get this up high so I can get some focus and if we look at these test points which have very poor silkscreen on them you will notice that there are actually four test points that are in the same order as the regular 4 pin header that we need to use for everything else and look it's got GPIO zero right there so what that gives us is all the connections that we need all in one spot now because it's on that Elementium based PCB there are no hold through it in order to put the connector on but we can still solder onto it and then remove the connector later once we've got the firmware in there if I get a standard 0.1 inch header and if we just stick it around about here somewhere we should be able to tax all of that on so let's do that I'm gonna grab a bit of trusty blue tack and then get this header so that it tries to hold it in just the right place we want it to be overlapping from the 3.3 volt pin and then Rx and TX and down to ground let's solder that sucker in place so I just straight on to the pad and you work our way up so we've now got connections on 23.3 vaults our XTX and ground and now I'm going to get that little orange jumper wire that I've been using for everything else and I'll tin the GPIO 0 pad and solder that into place and this is what I'm going to need to use in order to put it into bootloader mode because there is no external button on this there is no other way that we can get this into bootloader mode so now I'll get the blue take out of the way so we have our header for the serial communications and we have 3.3 volts at this end ground at that end so if we have our header and it's aligned this way that is correct so we have ground at the top 3.3 volts at the bottom now we just need to find somewhere to pick up ground in order to put it into bootloader mode and let's see what we can find no of course we already know that we've got ground on this header here so we could just use that thought it'd be easy way to do it and look there's a little thing over here that's labeled GND so that's a ground connection as well so what I could do is bring the jumper around hold it against that at that point there so back to the normal overhead camera holding the jumper in position and then we insert our adapter powers up and remove the jumper and this is now in bootloader mode so once again we've now gone from brand-new out-of-the-box to ready to flash now in this particular case you would probably want to remove the header after doing the flashing so what I would do in this case is install tasmiyah or whatever firmware you want and then go through and remove these connections or return it back to its normal factory setting we'll remove the little header and I'll just apply a little bit of rotational pressure while I lift this and then come down to the other end rotate slightly the other way but clear it that in now basically just work backwards and forwards wriggling and you get it all off now you can see here that I've left a little bit of a bridge across a couple of those connections so I'm just gonna heat that up reflow it to get that off and we want it to do a bit of a nicer job I could get some solder wick pull some out here so it's all the wick is is stuff that you just heat up on a joint and the solder flows into it by capillary action so it's lay a little bit of it across this joint and put the soldering iron onto it to heat it up you can see it's sucking up all the solder off those connections and leaves a little bit of a mess because the flux in it but all of the the solder is removed from those joints a you don't get bridges and things across it doesn't look as nice as to do from the factory but that'll still be fine won't short-circuit and now to put this back together we want to get this cover back on it's a very simple process you just get it aligned what's in and push work your way around and now it's all clicked into place so we could now screw this into a light socket and it'll be running the firmware that we've just updated onto it finally let's finish up by looking at probably the strangest sauna format of all the song off touch this is a replacement for a wall-mounted switch so you take off your normal switch connect this in place and then it gives you control over lights or what have you would normally control with it so you need an active and a neutral just like with any normal song off and then it's gives us which to output and comes in US and European formats so let's start by having a look inside this one let's get the wall mount bracket off and the front cover pops off so to actually open it you can usually just do it with your fingers like that but if you can't all you need to do is get yourself something like a little flat blade screwdriver put it into the gap and then you can leave right up so it's pretty easy to get the front cover off what you find inside is that this is just a plastic cover there's nothing to it and then there is a little sub board on the front now it's attached with adhesive along the top edge here and in the bottom it plugs into a little four pin socket so to get it off what you might have to do is sort of start from the edge and apply a bit of pressure and twist and you'll be able to but you need to sort of brace yourself because if you pull it and the adhesive gives way quickly you might end up bending the PCB which is going to bend the socket so that's not good so make sure that you brace your fingers carefully wriggle it off and break it free from this end so the adhesive is off and then we can unplug it and there we have the little control board and then the main board in the back so in the case of this this is the US version of the song off touch that board in the back basically contains the power supply section and the high voltage switch and then the front contains the actual touch surface itself which is this little white rectangle you can see the LED which shows its status and on here is one of those at all modules with the ESP eight to 8/5 on it not the 80-66 but it's functionally equivalent yeah there are a couple of other interesting things on here but before we go any further yeah it's always noting there is the classic four pin connector right there just waiting for us to solder a little header onto it but let's check it under the microscope see what other interesting things we can spot on here so there is the asph there is the four pin header ground at one end 3.3 volts at the other Rx and TX in the middle there's not a little chip on here which doesn't have any markings on it that I can see that's actually the touch control I see so on the other side of the board there is this touch sensor with a couple of connections that go through here for illumination purposes and you can see if we look just in the corner down here this little via comes through from the other side of the board and that is where the the touch sensor is connected from this side so the touch sensor comes through here runs through a 1k resistor into this IC and this IC is what's doing the actual detection so when you grab the touch switch and you touch it like this it's doing like a capacitive sensing and that is all being managed on this little IC so the ESP 8 mm and then sends events through to the microcontroller which then detects that you've press something now what that means is once again like some of the other models we've looked at there's no button here on GPIO 0 the touch sensor itself is handled through that external chip so we still need to be able to pull GPIO 0 low now let's see if we can find it drop the focus here and just like on many of the other let's find pin 15 so there's a little marker up here in one comes down and across pin 15 is the second one from the ends just in here so putting my multimeter into continuity mode again and let's see if we can find where that comes out you know I can see it pretty obvious candidate but let's just assume that we knew nothing about this device and we want to find the connection so I want to find continuity from this pin here and then I'll just well first one that one there is obviously the antenna so that's not going to be it but if we just touch on here and then run along we don't have anything from here run along and oh we've got continuity there so disconnection from the edge of the module is connected to GPIO zero so we know that that is a GPIO zero connection there and then if we follow the trace up here we can see it goes to the end of this 10k resistor so that is probably a good place for us to pick up GPIO zero so while I've got it right here under the microscope I'm just going to grab the soldering iron it's nice and handy now so might as well do it while it's here and we'll just touch the end of that resistor with the solder double-prime it for connecting in this little jumper they're the same jumper that I've used on every one of these boards solder it to the end of the resistor and you know we have a connector on GPIO zero that we can use to pull it low just put that to ground and we're done now one of the things you have to be careful with with this particular model you can fall into a trap here is if you take this PCB out and you simply solder a four pin header in place just under here which is the obvious thing to do you will discover very quickly that you have a clearance problem now if you look at the position of visits slightly offset but almost directly above or opposite the four pin header now look in here open header directly above it is this big connection here now if I grab some calipers and we measure the height of that connector it's about eight and a half millimeters so if we mount this below the PCB and then try to put this back in place that is going to protrude down eight and a half millimeters but right where we want it to go there is this big solder connection right here so if we were putting it down just to the PCB like there we've got about nine millimeters of clearance but over here we've only got about six point seven millimeters so there is not enough clearance to put this header in place and still have it clear this now you can actually buy a low-profile headers similar to this but they just don't stick up as high and I've got a bunch of those so that's one option as well but they're not as easily available as the standard height headers whatever you use just make sure that you look at the mechanical clearance before you go soldering it in and then have trouble putting the switch back together what you can do is just leave it out entirely so if you have some kind of an adapter with pins on it like this one we've got 3.3 volts at that end ground at that end and you plug it in all we have to do is apply a little bit of pressure and that will make a good electrical connection and first we need to put it into bootloader mode just around here you can see a very handy label if ground on there so what I can do is just bring this jumper around hold it against the ground pin and then I've just got to line up three point three volts on this end ground on that end push it in let go and now we have this module in bootloader mode and we'd be able to upload new firmware to it then when the job is done just pull it out one solder this wire and push it back in use the existing adhesive to hold it in place and clip the cover back on so let's just have a look at the u.s. format switch and see how that compares to the European format see if there are any differences there just get the cover off and you can see here that the the front of the module is very similar it's got a separate standalone board on the front it's a different layout to the American one you can see that the physical shape is different the connector is in a different place and it's stuck down with adhesive on the front in a similar way so I'll start by just levering that adhesive off get that off and it's unplugged it's got the same sort of little four pin header once again the power portion of the circuit is in the bottom of the board and we have the four-way header here and just like before we have the module in here so we tuck this back under the microscope like the other one and orient it so that in one is in the top-left and what we can see is that just down here that's GPIO zero and we've already worked out on this module that this pin here is the one that goes to GPIO zero so we could very easily just solder the jumper on here and then the job would be done we'd be able to just put the header through same as with the other one we've got ground at one end 3.3 volts at the other and if we had the jumper in place we could push it in hold it sideways it come up in bootloader mode where you flash it reassemble it so reassembly is just reverse the process plug it in push it down into the adhesive click the cover back on and as you're putting it on make sure you get it oriented around the right way because it's not clear which way this is meant to go if you look at the front of the cover you'll see the little blue Wi-Fi symbol here the status LED goes behind that and if you look on the PCB you can see the little status led just there so make sure that you are int it so that that aligns with the LED put it together clip it closed and you're done make sure you do the same thing with the european-style so if that was plugged in you can see the status LED their symbol is there so it would go that way not that way so is what you've learned in this video you can now reflash any model of sawn-off even new ones that haven't been released yet as long as they use the esp8266 in fact it's not just sign-offs if you've got a device based on the esp8266 you can trace through those pins put it into bootloader mode and then reflash it so this little device that I made for my own purposes I'm going to make this available it's only a PCB and you know a couple of connectors on it I'll put it up for like four bucks or something on my site so if you want to reflash one offs this could be handy for you otherwise you can make up a cable yourself just using the diagram and if you want all the information about this including pictures with the pin outs of all the different models make sure you're not just watching this on youtube have a look in the video description go to the page that is linked there the episode page on the super house website and also for of course for my patrons everybody that supports me on patreon at any level they get a discount code I send those out regularly so you can get a discount on the $4 adapter so thank you very much for watching and if you have managed to flash another type of sawn-off that I haven't shown here and put details in the comments below or comment on the page on the super house and there will be more videos coming soon because I've been working on some really cool new assistive technology projects with my friend Chris briar and those are pretty awesome so in the meantime go out and make something cool
Info
Channel: SuperHouseTV
Views: 115,742
Rating: 4.9448981 out of 5
Keywords:
Id: BHzsWwd351I
Channel Id: undefined
Length: 64min 38sec (3878 seconds)
Published: Tue Dec 04 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.