-
Notifications
You must be signed in to change notification settings - Fork 638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sonoff Dual R2 Ver 1.0 #286
Comments
Original comment by Colin Shorts (Bitbucket: ColinShorts, GitHub: ColinShorts): On testing today (had to go out for mains cable), I've found that the R2 is a different beast altogether, there is no serial chip between the esp module and the relays as I think was the case in the original model. The esp chip is an 8285. There is a bi-colour status LED labeled D5 that is green when switch 1 is on, red with switch 2 (so far at least, not sure if that's the same as the original). I'll do a bit more testing then submit a pull request, unless there are any objections? |
Original comment by decoddeki (Bitbucket: decoddeki, GitHub: Unknown): Hi Colin, did you managed to get relays to work? I just received R2 version, flashed it with espurna-1.10.0-itead-sonoff-dual.bin. It connects to the Wi-Fi and MQTT fine, but relays don’t seem to work. Any suggestions? Thanks, Dejan |
Original comment by Colin Shorts (Bitbucket: ColinShorts, GitHub: ColinShorts): I've not gotten around to testing the button (and button headers) but the relays work fine. If you're up for a bit of testing yourself, there's not that much to it... https://bitbucket.org/ColinShorts/espurna-sonoff-dual-r2 Let me know if it works for you! |
Original comment by decoddeki (Bitbucket: decoddeki, GitHub: Unknown): Flashed espurna-1.10.0-itead-sonoff-dual-r2.bin. I only get single switch: Am I doing something wrong? |
Original comment by Colin Shorts (Bitbucket: ColinShorts, GitHub: ColinShorts): Let me check, I've probably made a minor mistake in the config. |
Original comment by Colin Shorts (Bitbucket: ColinShorts, GitHub: ColinShorts): Yup, sorry about that - had a definition for a dummy relay that was causing the issue. I think I must've been half way through testing something. I've uploaded the image to my own running one and can confirm both the switches are visible again. Please download a fresh bin file. Cheers, |
Original comment by decoddeki (Bitbucket: decoddeki, GitHub: Unknown): Thank you Colin, it works now. Now I only have to figure out how to get buttons to work :) |
Original comment by Colin Shorts (Bitbucket: ColinShorts, GitHub: ColinShorts): Thanks for testing. I don't currently have a use case for the button(s), but I'll give it a bash today if I get a chance. What are you planning to use, the front panel button by itself, or the gpio buttons from the side header? |
Looks like they have greatly simplified the board. You don't need to define a specific BAUDRATE for this and you can enable serial debug since there is no second micrcontroller. Also, can you check if BUTTON0 in the header is tied to physical button? A would bet it is, so the configuration would be:
|
Original comment by Colin Shorts (Bitbucket: ColinShorts, GitHub: ColinShorts): I'm struggling to see using the naked eye (I should really invest in a magnifying glass), but I'm pretty confident that that button 0 on the header is tied to the esp module directly on the via next to R9 (gpio0). button 1 comes out at the esp (gpio9) from a via just on the top edge of the physical button, and the button itself is connected directly to gpio10. I'll try to attach some pictures from my phone in a second (with the front one mirrored to make it easier to follow the tracks). Assuming that the physical button is on it's own gpio pin, and the header pins go to their own - how would you normally set them up? |
Original comment by Colin Shorts (Bitbucket: ColinShorts, GitHub: ColinShorts): Rear view zoomed on traces |
Original comment by Colin Shorts (Bitbucket: ColinShorts, GitHub: ColinShorts): Front view zoomed on traces |
Original comment by Colin Shorts (Bitbucket: ColinShorts, GitHub: ColinShorts): Front view zoomed on face and mirrored. |
It's hard to say by the pics, there are traces going from the header to the button but they could as well go to the microcontroller on the other side of the board. Do you have a tester? Set it in continuity mode and check if the BUTTON0 header is connected to either side of the physical button. If they were actually different GPIOs you will have to decide what each button does, for instance:
In this configuration button3 is the physical button (GPIO10) but trigger the first relay, just as the BUTTON0 header does. |
Original comment by Colin Shorts (Bitbucket: ColinShorts, GitHub: ColinShorts): Thanks for jumping in to help Xose:) My multimeter (annoyingly) doesn't have a continuity setting, so need to rely on resistance and it jumps around a little, so difficult to say for sure. I'll try for a bit of trial and error to see if the header pins and physical button can be used to control the relays - at least to figure out that I've got the right pins. I don't know what anyone would normally want to use the buttons for as I'm just tucking the units away and controlling them via mqtt (or Alexa). |
Original comment by decoddeki (Bitbucket: decoddeki, GitHub: Unknown): I will check when I get home from work, if I find my multimeter :) I would use buttton0 and button1 to attach physical switch to work in parallel with HA. |
Looks like this last one id the correct configuration. The physical button is indeed connected to GPIO10, not GPIO0. I have added the configuration for Dual R2 in the dev branch. Will be released with 1.10.1 |
Original comment by Colin Shorts (Bitbucket: ColinShorts, GitHub: ColinShorts): Thanks Xose! I'll kill off my fork and not bother with the PR. It did look to work (my relays switched on once), but I think I might have just fried the GPIO on the headers on this board... This isn't a problem for me as I'm not planning on using them anyway. Should we be using resistors - I thought the gpio pins on these modules could handle pulling the pins high internally and grounding them to 'switch' without resistors. It might be useful to have button 3 toggle on/off both relays, or toggle them in 2 bits 00, 01, 10, 11, but that would probably require a change to the DUMMY RELAY code and probably more trouble than it's worth. It looks as though you can't have a dummy relay along with real ones. |
Released with 1.10.1 |
Original comment by Colin Shorts (Bitbucket: ColinShorts, GitHub: ColinShorts): Please remember to add an entry in arduino.h too 😀 |
Removing milestone: 1.10.1 (automated comment) |
Originally reported by: Colin Shorts (Bitbucket: ColinShorts, GitHub: ColinShorts)
I've just received a pair of these from Ali Express, and realised that they were a little different to the original Dual's. Despite the resistors/capacitors around the esp chip looking similar (sorry - forgot to take a picture of the back), GPIO 0 is now pulled out to a pre-populated header on the board marked as 'BUTTON 0' and not seemingly not connected to the resistor as in the previous version. Much easier to flash at least 😄
I've attached a jpg showing a yellow jumper grounding GPIO0 in prep for flashing
I flashed the modules with the latest dev branch last night (using platformio), but have only tested that the relays work. They do connect to the wifi, and have connected fine to MQTT and my NTP server, and I can confirm fauxmo works too. I'll update this when I get a chance to test the buttons.
The text was updated successfully, but these errors were encountered: