4CH PRO w/ BME280 and WS2812

123 views
Skip to first unread message

George Ioakimedes

unread,
Mar 22, 2018, 4:20:13 PM3/22/18
to SonoffUsers
I've got my system setup with what I thought was working well but I've discovered an issue. I soldered a header to the Sonoff board and am plugging in a board that I made which has the sensor and a WS2812 light ring. I have the system configured as:

  • GPIO1 WS2812
  • GPIO2 SDA
  • GPIO3 SCL
If I power up the Sonoff (plug in AC power) with the sensor board plugged in the system starts with some of the channel turned on and I don't see it connected to WiFi. 

If I power up the Sonoff and then plug in the board everything works as expected. The system powers up with no relays on, the system connects to WiFi, and the sensor and WS2812 ring work.

Anyone have any ideas what's going on? I'm using I think the latest code (it's no more than 2 weeks old)

Colin Law

unread,
Mar 22, 2018, 4:50:46 PM3/22/18
to George Ioakimedes, SonoffUsers
Just a guess but if you are powering the additional board from the
Sonoff could the additional power drain be messing up the boot phase?

Colin

George Ioakimedes

unread,
Mar 22, 2018, 4:52:22 PM3/22/18
to SonoffUsers
Some additional information:

  • My BME280 board has 10k pull-ups on SDA and SCL
  • According to the 4CH PRO schematic the boot pins are configured like this:
    • GPIO15 has 10k pull down and nothing else
    • GPIO0 is KEY1 and connected directly to the STM32 MCU
    • GPIO2 is SDA and is only connected to the header

George Ioakimedes

unread,
Mar 22, 2018, 4:59:04 PM3/22/18
to Colin Law, SonoffUsers
Yes, both the BME280 and WS2812 are connected to 3.3V header of the Sonoff. The WS2812 powers up off and the current draw of the BME280 is next to nothing. The 3.3V rail on the Sonoff is generated by a LM1117 which is good for 800mA which should have plenty of reserve.

I've got the unit mounted in the garage so it's not easy to check things or hook up a scope but my guess is that for some reason one of the boot pins is changed on boot up when the board is plugged in and that causes it not to boot from flash. Since GPIO0 and GPIO2 need to be high and the board has 10k pull-ups that should make those high at boot.


Message has been deleted

George Ioakimedes

unread,
Mar 23, 2018, 2:14:48 PM3/23/18
to SonoffUsers
For some reason my last post got deleted. It's definitely something with the WS2812 but I don't think it's a power issue. I say that because I noticed in the Sonoff 4CH PRO schematic they show only 1uF on the output of the AMS1117 regulator. They have 2 caps in parallel right next to the ESP but I thought I would try adding a cap right at the AMS1117 first. That didn't help so I then soldered a wire at the 5V input to the AMS1117 and used that to power the WS2812 LED ring (BTW it's 12 LEDs). That still didn't allow the Sonoff to boot properly. As soon as I disconnect the Din pin of the WS2812 ring to GPIO1 the Sonoff boots properly.

GPIO1 is the Tx pin of the ESP and I've disabled the hardware serial port:

10:10:29 CMD: seriallog
10:10:29 MQT: stat/sonoff/RESULT = {"SerialLog":"2 (Active 2)"}

So I'm back to being confused as to what the problem could be. Is anyone else running WS2812 LEDs on GPIO1?

On Thursday, March 22, 2018 at 1:59:04 PM UTC-7, George Ioakimedes wrote:
Yes, both the BME280 and WS2812 are connected to 3.3V header of the Sonoff. The WS2812 powers up off and the current draw of the BME280 is next to nothing. The 3.3V rail on the Sonoff is generated by a LM1117 which is good for 800mA which should have plenty of reserve.

I've got the unit mounted in the garage so it's not easy to check things or hook up a scope but my guess is that for some reason one of the boot pins is changed on boot up when the board is plugged in and that causes it not to boot from flash. Since GPIO0 and GPIO2 need to be high and the board has 10k pull-ups that should make those high at boot.


> I've got my system setup with what I thought was working well but I've
> discovered an issue. I soldered a header to the Sonoff board and am plugging
> in a board that I made which has the sensor and a WS2812 light ring. I have
> the system configured as:
>
> GPIO1 WS2812
> GPIO2 SDA
> GPIO3 SCL
>
> If I power up the Sonoff (plug in AC power) with the sensor board plugged in
> the system starts with some of the channel turned on and I don't see it
> connected to WiFi.
>
> If I power up the Sonoff and then plug in the board everything works as
> expected. The system powers up with no relays on, the system connects to
> WiFi, and the sensor and WS2812 ring work.
>
> Anyone have any ideas what's going on? I'm using I think the latest code
> (it's no more than 2 weeks old)

George Ioakimedes

unread,
Mar 23, 2018, 2:40:50 PM3/23/18
to SonoffUsers
I did some experimenting but didn't end up with any combination that works.

  1. My original configuration was this and this does not boot if Din of the WS2812 is connected. It works if Din is connected after the system boots.
    1. GPIO1 - WS2812
    2. GPIO2 - SDA
    3. GPIO3 - SCL
  2. Next I tried moving connections. With this connection the sensor was not recognized and when I activate the WS2812 from the web interface the system LED turns on, not the WS2812
    1. GPIO1 - SDA
    2. GPIO2 - SCL
    3. GPIO3 - WS2812
  3. The final combination yields the same result as the first combination. The system does not boot if the Din of the WS2812 is connected during boot but functions fine if connected after booting
    1. GPIO1 - SDA
    2. GPIO2 - WS2812
    3. GPIO3 - SCL
I am running 5.12.0 and am flashing from my compile of the source which just has user_config.ini changes.

Colin Law

unread,
Mar 23, 2018, 5:50:49 PM3/23/18
to George Ioakimedes, SonoffUsers
If you pull that pin low or high with a resistor (rather than connect to WS1812) does it stop it booting?

Colin

--
You received this message because you are subscribed to the Google Groups "SonoffUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/sonoffusers.
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/72805893-56c7-4e60-8dab-441ffd6ead19%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
0 new messages