tasmota 5.14 - strange switch behaviour with PIR

103 views
Skip to first unread message

g...@guysteven.co.nz

unread,
Oct 6, 2018, 2:02:25 AM10/6/18
to SonoffUsers
I have a wemos d1 mini flashed with tasmota Version 5.14.0-2_3_0. I have flashed it with this version as I can't get it to connect to my wifi if I flash the latest version. 

I wish to connect a PIR sensor, but the sensor I am using goes high on the signal pin when motion is detected, the opposite of what a switch or button does. 

Whilst experimenting with switchmode, I came across the following odd behaviour. I don't know if it is intended or not. 

I have set GPIO14 to 09 Switch 1

I have a 100k resistor pulling GPIO14 to ground, and a button which, when pressed, connects GPIO14 to 3.3v. I am trying to replicate the PIR sensor.

Immediately after flashing, pressing the button produces the following MQTT messages:
06:20:23 MQT: stat/test_wemos/RESULT = {"POWER":"OFF"}
06:20:23 MQT: stat/test_wemos/POWER = OFF

Releasing the button produces:
06:20:23 MQT: stat/test_wemos/RESULT = {"POWER":"ON"}
06:20:23 MQT: stat/test_wemos/POWER = ON

This is the behaviour I expected, but not what I wanted. 

If I then:
1) issue the command Switchmode1 3
2) press and release the button once
3) issue the command Switchmode1 0

I get the opposite behaviour. Pressing the button results in POWER = ON and releasing it results in POWER = OFF
This is the behaviour I want for the PIR sensor. 

I don't know if this behaviour is intended, but it is useful.




Philip Knowles

unread,
Oct 6, 2018, 2:53:26 AM10/6/18
to g...@guysteven.co.nz, SonoffUsers

I may be wrong but doesn’t Switch1n achieve what you are trying to do without the pullup/pulldown resistor?

 

Regards

 

Phil K

 

Sent from Mail for Windows 10

--
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...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

g...@guysteven.co.nz

unread,
Oct 6, 2018, 3:52:59 AM10/6/18
to SonoffUsers
tasmota 5.14 doesn't have Switch1N as an option. I can not use a newer version of Tasmota as I get wifi connection issues if I do. That is a subject for another time though.

Mike Robertson

unread,
Oct 7, 2018, 1:27:53 AM10/7/18
to SonoffUsers
My recent thread on the problems I had flashing 6.2.1 may be of some use to you.  Essentially you need to change CFG_HOLDER to ensure the connection parameters are updated.

Phil

unread,
Oct 8, 2018, 10:01:17 AM10/8/18
to SonoffUsers
Perhaps your focus should be on getting the latest version loaded and working. And take advantage of the latest features.

Can you flash via a serial connection and use your favourite terminal emulator to connect and monitor the serial output as the 6.x 'fails to connect to wifi' 

You may need to try different baud rates to connect and monitor .....  tho start with 115200 as usual. 

If when connected to the device it cycles trying to connect to your wifi without credentials and then attempting to establish an AP before resetting and starting all over?

Then Mike above could be on the money with your problem being a consequence of the CFG_HOLDER property in the user-config file. the fix can be found in the wiki, and involves changing the cfg_holder value compiling and flashing with this newly created binary before reflashing with either the precompiled binary from the web or after resetting CFG_HOLDER back to the default value build/compiling and reflashing with that new version..  subsiquent upgrades etc can then be carried out OTA without hassle..  

Reply all
Reply to author
Forward
0 new messages